Update docs
This commit is contained in:
parent
46572927e7
commit
cc0e2ae5cd
@ -1,61 +1,25 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
|
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
|
||||||
<head profile="http://gmpg.org/xfn/11">
|
<head profile="http://gmpg.org/xfn/11">
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
<title>Arduino Client for MQTT « knolleary</title>
|
<title>Arduino Client for MQTT</title>
|
||||||
<link href='http://fonts.googleapis.com/css?family=Questrial' rel='stylesheet' type='text/css'>
|
<link href='http://fonts.googleapis.com/css?family=Questrial' rel='stylesheet' type='text/css'>
|
||||||
<link href='http://fonts.googleapis.com/css?family=Lora:400,400italic' rel='stylesheet' type='text/css'>
|
<link href='https://fonts.googleapis.com/css?family=Cutive+Mono' rel='stylesheet' type='text/css'>
|
||||||
<style type="text/css" media="screen">
|
<link href='style.css' rel='stylesheet' type='text/css'>
|
||||||
@import url( http://knolleary.net/blog/wp-content/themes/wp-knolleary-theme/style.css );
|
<meta name="HandheldFriendly" content="true" />
|
||||||
</style>
|
<meta name="viewport" content="width=device-width, height=device-height, user-scalable=no" />
|
||||||
|
|
||||||
<link href='style.css' rel='stylesheet' type='text/css'>
|
|
||||||
|
|
||||||
|
|
||||||
<script type='text/javascript' src='http://knolleary.net/blog/wp-includes/js/jquery/jquery.js?ver=1.7.2'></script>
|
|
||||||
|
|
||||||
<meta name="HandheldFriendly" content="true" />
|
|
||||||
<meta name="viewport" content="width=device-width, height=device-height, user-scalable=no" />
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="banner"><div class="nav"><ul><li class="{% if page.title == 'Arduino Client for MQTT' %}active{% endif %}"><a href="./index.html">Arduino Client for MQTT</a></li><!--<li class="{% if page.title == 'Tutorial' %}active{% endif %}"><a href="./tutorial.html">Tutorial</a></li>--><li class="{% if page.title == 'API Docs' %}active{% endif %}"><a href="./api.html">API Docs</a></li></ul><h1><a href="http://knolleary.net/">knolleary</a></h1></div></div>
|
<div id="content">
|
||||||
<div id="header"><h1><a href="http://knolleary.net/">knolleary</a></h1><h2>stuff by nick o'leary</h2>
|
<div id="header">
|
||||||
<div class="nav">
<ul><li class="{% if page.title == 'Arduino Client for MQTT' %}active{% endif %}"><a href="./index.html">Arduino Client for MQTT</a></li><!--<li class="{% if page.title == 'Tutorial' %}active{% endif %}"><a href="./tutorial.html">Tutorial</a></li>--><li class="{% if page.title == 'API Docs' %}active{% endif %}"><a href="./api.html">API Docs</a></li></ul></div>
|
<ul>
|
||||||
<div class="clearfloat"></div>
|
<li><a href="index.html">Arduino Client for MQTT</a></li><li><a href="api.html">API Documentation</a></li>
|
||||||
</div><!-- end header div -->
|
</ul>
|
||||||
<div id="content">
|
</div>
|
||||||
<!-- end header -->
|
<h1>{{ page.title }}</h1>
|
||||||
<div class="page type-page status-publish hentry">
|
<div class="content">
|
||||||
<div class="storypage">
|
{{ content }}
|
||||||
<div class="title"><a href="http://knolleary.net/arduino-client-for-mqtt/" rel="bookmark">{{ page.title }}</a></div>
|
</div>
|
||||||
|
</div>
|
||||||
<div class="storycontent">
{{ content }}
|
</body>
|
||||||
</div><!-- end storycontent -->
|
|
||||||
<div class="clearfloat"></div>
|
|
||||||
</div><!-- end story -->
|
|
||||||
</div><!-- end post -->
|
|
||||||
|
|
||||||
<!-- begin footer -->
|
|
||||||
</div> <!-- end content div -->
|
|
||||||
|
|
||||||
<div id="menu">
|
|
||||||
<div id="menu-container">
|
|
||||||
<div id="menu-col1">
<div class="menu-block mbtop">
</div></div>
|
|
||||||
<div id="menu-col2">
|
|
||||||
<div class="menu-block mbtop">
|
|
||||||
finally<ul><li>The postings on this site are my own and don’t necessarily represent IBM’s positions, strategies or opinions.</li></ul>
|
|
||||||
<ul><li><a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.0/uk/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-sa/2.0/uk/80x15.png" /></a><br />All content on this site is licenced under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.0/uk/">Creative Commons Licence</a>.</li></ul>
|
|
||||||
</div> <!-- /menu-block -->
|
|
||||||
</div><!--end col2 -->
|
|
||||||
<div id="menu-col3"><div class="menu-block mbtop">
</div></div>
|
|
||||||
</div> <!-- end menu-container div -->
|
|
||||||
<div class="clearfloat"></div>
|
|
||||||
</div> <!-- end menu div -->
|
|
||||||
<!-- end sidebar -->
|
|
||||||
|
|
||||||
<div id="footer">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
</html>
|
||||||
|
575
api.html
575
api.html
@ -1,278 +1,401 @@
|
|||||||
---
|
---
|
||||||
layout: default
|
layout: default
|
||||||
title: API Docs
|
title: API Documentation
|
||||||
---
|
---
|
||||||
<p><i>These docs refer to the latest version of the library on <a href="https://github.com/knolleary/pubsubclient">GitHub</a></i></p>
|
|
||||||
|
|
||||||
<section class="method" id="toc">
|
<section class="method" id="toc">
|
||||||
<h5>Constructors</h5>
|
<h3>Constructors</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#PubSubClient"><span class="methodname">PubSubClient</span> <span class="methodparams">(server, port, callback, client)</span></a></li>
|
<li><a href="#PubSubClient"><span class="methodname">PubSubClient</span> <span class="methodparams">()</span></a></li>
|
||||||
<li><a href="#PubSubClient2"><span class="methodname">PubSubClient</span> <span class="methodparams">(serverDNS, port, callback, client)</span></a></li>
|
<li><a href="#PubSubClient1"><span class="methodname">PubSubClient</span> <span class="methodparams">(client)</span></a></li>
|
||||||
</ul>
|
<li><a href="#PubSubClient2"><span class="methodname">PubSubClient</span> <span class="methodparams">(server, port, [callback], client, [stream])</span></a></li>
|
||||||
<h5>Functions</h5>
|
</ul>
|
||||||
<ul>
|
<h3>Functions</h3>
|
||||||
<li><a href="#connect1"><span class="methodreturn">boolean</span> <span class="methodname">connect</span> <span class="methodparams">(clientID)</span></a></li>
|
<ul>
|
||||||
<li><a href="#connect2"><span class="methodreturn">boolean</span> <span class="methodname">connect</span> <span class="methodparams">(clientID, willTopic, willQoS, willRetain, willMessage)</span></a></li>
|
<li><a href="#connect1"><span class="methodreturn">boolean</span> <span class="methodname">connect</span> <span class="methodparams">(clientID)</span></a></li>
|
||||||
<li><a href="#connect3"><span class="methodreturn">boolean</span> <span class="methodname">connect</span> <span class="methodparams">(clientID, username, password)</span></a></li>
|
<li><a href="#connect2"><span class="methodreturn">boolean</span> <span class="methodname">connect</span> <span class="methodparams">(clientID, willTopic, willQoS, willRetain, willMessage)</span></a></li>
|
||||||
<li><a href="#connect4"><span class="methodreturn">boolean</span> <span class="methodname">connect</span> <span class="methodparams">(clientID, username, password, willTopic, willQoS, willRetain, willMessage)</span></a></li>
|
<li><a href="#connect3"><span class="methodreturn">boolean</span> <span class="methodname">connect</span> <span class="methodparams">(clientID, username, password)</span></a></li>
|
||||||
<li><a href="#disconnect"><span class="methodreturn">void</span> <span class="methodname">disconnect</span> <span class="methodparams">()</span></a></li>
|
<li><a href="#connect4"><span class="methodreturn">boolean</span> <span class="methodname">connect</span> <span class="methodparams">(clientID, username, password, willTopic, willQoS, willRetain, willMessage)</span></a></li>
|
||||||
<li><a href="#publish1"><span class="methodreturn">int</span> <span class="methodname">publish</span> <span class="methodparams">(topic, payload)</span></a></li>
|
<li><a href="#disconnect"><span class="methodreturn">void</span> <span class="methodname">disconnect</span> <span class="methodparams">()</span></a></li>
|
||||||
<li><a href="#publish2"><span class="methodreturn">int</span> <span class="methodname">publish</span> <span class="methodparams">(topic, payload, length)</span></a></li>
|
<li><a href="#publish1"><span class="methodreturn">int</span> <span class="methodname">publish</span> <span class="methodparams">(topic, payload)</span></a></li>
|
||||||
<li><a href="#publish3"><span class="methodreturn">int</span> <span class="methodname">publish</span> <span class="methodparams">(topic, payload, length, retained)</span></a></li>
|
<li><a href="#publish2"><span class="methodreturn">int</span> <span class="methodname">publish</span> <span class="methodparams">(topic, payload, length)</span></a></li>
|
||||||
<li><a href="#publish4"><span class="methodreturn">int</span> <span class="methodname">publish_P</span> <span class="methodparams">(topic, payload, length, retained)</span></a></li>
|
<li><a href="#publish3"><span class="methodreturn">int</span> <span class="methodname">publish</span> <span class="methodparams">(topic, payload, length, retained)</span></a></li>
|
||||||
<li><a href="#subscribe"><span class="methodreturn">boolean</span> <span class="methodname">subscribe</span> <span class="methodparams">(topic)</span></a></li>
|
<li><a href="#publish4"><span class="methodreturn">int</span> <span class="methodname">publish_P</span> <span class="methodparams">(topic, payload, length, retained)</span></a></li>
|
||||||
<li><a href="#loop"><span class="methodreturn">boolean</span> <span class="methodname">loop</span> <span class="methodparams">()</span></a></li>
|
<li><a href="#subscribe"><span class="methodreturn">boolean</span> <span class="methodname">subscribe</span> <span class="methodparams">(topic, [qos])</span></a></li>
|
||||||
<li><a href="#connected"><span class="methodreturn">int</span> <span class="methodname">connected</span> <span class="methodparams">()</span></a></li>
|
<li><a href="#unsubscribe"><span class="methodreturn">boolean</span> <span class="methodname">unsubscribe</span> <span class="methodparams">(topic)</span></a></li>
|
||||||
</ul>
|
<li><a href="#loop"><span class="methodreturn">boolean</span> <span class="methodname">loop</span> <span class="methodparams">()</span></a></li>
|
||||||
<h5>Other</h5>
|
<li><a href="#connected"><span class="methodreturn">int</span> <span class="methodname">connected</span> <span class="methodparams">()</span></a></li>
|
||||||
<ul>
|
<li><a href="#setserver"><span class="methodreturn">PubSubClient</span> <span class="methodname">setServer</span> <span class="methodparams">(server, port)</span></a></li>
|
||||||
<li><a href="#configoptions">Configuration Options</a></li>
|
<li><a href="#setcallback"><span class="methodreturn">PubSubClient</span> <span class="methodname">setCallback</span> <span class="methodparams">(callback)</span></a></li>
|
||||||
<li><a href="#callback">Subscription Callback</a></li>
|
<li><a href="#setclient"><span class="methodreturn">PubSubClient</span> <span class="methodname">setClient</span> <span class="methodparams">(client)</span></a></li>
|
||||||
</ul>
|
<li><a href="#setstream"><span class="methodreturn">PubSubClient</span> <span class="methodname">setStream</span> <span class="methodparams">(stream)</span></a></li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
<h3>Other</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="#configoptions">Configuration Options</a></li>
|
||||||
|
<li><a href="#callback">Subscription Callback</a></li>
|
||||||
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="method" id="PubSubClient">
|
<section class="method" id="PubSubClient">
|
||||||
<h4><span class="methodname">PubSubClient</span> <span class="methodparams">(server, port, callback, client)</span></h4>
|
<h4><span class="methodname">PubSubClient</span> <span class="methodparams">()</span></h4>
|
||||||
<p>Creates a client instance, with the server specified by IP address.</p>
|
<p>Creates an uninitialised client instance.</p>
|
||||||
<h5>Parameters</h5>
|
<p>Before it can be used, it must be configured with the property setters:</p>
|
||||||
<ul>
|
<pre>EthernetClient ethClient;
|
||||||
<li>server : the IP address of the server (array of 4 bytes)</li>
|
PubSubClient client;
|
||||||
<li>port : the port to connect to (int)</li>
|
|
||||||
<li>callback : a pointer to a function called when a message arrives for a subscription created by this client. If no callback is required, set this to 0. See <a href="#callback">Subscription Callback</a>.</li>
|
void setup() {
|
||||||
<li>client : an instance of <code>Client</code>, typically <code>EthernetClient</code>.</li>
|
client.setClient(ethClient);
|
||||||
</ul>
|
client.setServer("broker.example.com",1883);
|
||||||
|
// client is now configured for use
|
||||||
|
}</pre>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="method" id="PubSubClient2">
|
<section class="method" id="PubSubClient2">
|
||||||
<h4><span class="methodname">PubSubClient</span> <span class="methodparams">(serverDNS, port, callback, client)</span></h4>
|
<h4><span class="methodname">PubSubClient</span> <span class="methodparams">(client)</span></h4>
|
||||||
<p>Creates a client instance, with the server specified by DNS name.</p>
|
<p>Creates a partially initialised client instance.</p>
|
||||||
<h5>Parameters</h5>
|
<p>Before it can be used, the server details must be configured:</p>
|
||||||
<ul>
|
<pre>EthernetClient ethClient;
|
||||||
<li>serverDNS : the DNS name of the server (char*)</li>
|
PubSubClient client(ethClient);
|
||||||
<li>port : the port to connect to (int)</li>
|
|
||||||
<li>callback : a pointer to a function called when a message arrives for a subscription created by this client. If no callback is required, set this to 0. See <a href="#callback">Subscription Callback</a>.</li>
|
void setup() {
|
||||||
<li>client : an instance of <code>Client</code>, typically <code>EthernetClient</code>.</li>
|
client.setServer("broker.example.com",1883);
|
||||||
</ul>
|
// client is now ready for use
|
||||||
|
}</pre>
|
||||||
|
<h5>Parameters</h5>
|
||||||
|
<ul>
|
||||||
|
<li><span class="methodparams">client</span> : an instance of <code>Client</code>, typically <code>EthernetClient</code>.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="method" id="PubSubClient3">
|
||||||
|
<h4><span class="methodname">PubSubClient</span> <span class="methodparams">(server, port, [callback], client, [stream])</span></h4>
|
||||||
|
<p>Creates a fully configured client instance.</p>
|
||||||
|
<h5>Parameters</h5>
|
||||||
|
<ul>
|
||||||
|
<li><span class="methodparams">server</span> : the address of the server (IPAddress, uint8_t[] or const char[])</li>
|
||||||
|
<li><span class="methodparams">port</span> : the port to connect to (int)</li>
|
||||||
|
<li><span class="methodparams">callback</span> : <i>optional</i> a pointer to a <a href="#callback">message callback</a> function called when a message arrives for a subscription created by this client.</li>
|
||||||
|
<li><span class="methodparams">client</span> : an instance of <code>Client</code>, typically <code>EthernetClient</code>.</li>
|
||||||
|
<li><span class="methodparams">stream</span> : <i>optional</i> an instance of <code>Stream</code>, used to store received messages. See the <code>mqtt_stream</code> example for more information.</li>
|
||||||
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="method" id="connect1">
|
<section class="method" id="connect1">
|
||||||
<h4><span class="methodreturn">boolean</span> <span class="methodname">connect</span> <span class="methodparams">(clientID)</span></h4>
|
<h4><span class="methodreturn">boolean</span> <span class="methodname">connect</span> <span class="methodparams">(clientID)</span></h4>
|
||||||
<p>Connects the client.</p>
|
<p>Connects the client.</p>
|
||||||
<h5>Parameters</h5>
|
<h5>Parameters</h5>
|
||||||
<ul>
|
<ul>
|
||||||
<li>clientID : the client ID to use when connecting to the server. As per MQTT, this must be between 1 and 23 characters long.</li>
|
<li><span class="methodparams">clientID</span> : the client ID to use when connecting to the server. As per MQTT, this must be between 1 and 23 characters long.</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h5>Returns</h5>
|
<h5>Returns</h5>
|
||||||
<ul>
|
<ul>
|
||||||
<li>false – connection failed.</li>
|
<li>false - connection failed.</li>
|
||||||
<li>true – connection succeeded.</li>
|
<li>true - connection succeeded.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="method" id="connect2">
|
<section class="method" id="connect2">
|
||||||
<h4><span class="methodreturn">boolean</span> <span class="methodname">connect</span> <span class="methodparams">(clientID, willTopic, willQoS, willRetain, willMessage)</span></h4>
|
<h4><span class="methodreturn">boolean</span> <span class="methodname">connect</span> <span class="methodparams">(clientID, willTopic, willQoS, willRetain, willMessage)</span></h4>
|
||||||
<p>Connects the client with a Will message specified.</p>
|
<p>Connects the client with a Will message specified.</p>
|
||||||
<h5>Parameters</h5>
|
<h5>Parameters</h5>
|
||||||
<ul>
|
<ul>
|
||||||
<li>clientID : the client ID to use when connecting to the server. As per MQTT, this must be between 1 and 23 characters long.</li>
|
<li><span class="methodparams">clientID</span> : the client ID to use when connecting to the server. As per MQTT, this must be between 1 and 23 characters long.</li>
|
||||||
<li>willTopic : the topic to be used by the will message (char*)</li>
|
<li><span class="methodparams">willTopic</span> : the topic to be used by the will message (const char[])</li>
|
||||||
<li>willQoS : the quality of service to be used by the will message (int : 0,1 or 2)</li>
|
<li><span class="methodparams">willQoS</span> : the quality of service to be used by the will message (int : 0,1 or 2)</li>
|
||||||
<li>willRetain : whether the will should be published with the retain flag (int : 0 or 1)</li>
|
<li><span class="methodparams">willRetain</span> : whether the will should be published with the retain flag (boolean)</li>
|
||||||
<li>willMessage : the payload of the will message (char*)</li>
|
<li><span class="methodparams">willMessage</span> : the payload of the will message (const char[])</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h5>Returns</h5>
|
<h5>Returns</h5>
|
||||||
<ul>
|
<ul>
|
||||||
<li>false – connection failed.</li>
|
<li>false - connection failed.</li>
|
||||||
<li>true – connection succeeded.</li>
|
<li>true - connection succeeded.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="method" id="connect3">
|
<section class="method" id="connect3">
|
||||||
<h4><span class="methodreturn">boolean</span> <span class="methodname">connect</span> <span class="methodparams">(clientID, username, password)</span></h4>
|
<h4><span class="methodreturn">boolean</span> <span class="methodname">connect</span> <span class="methodparams">(clientID, username, password)</span></h4>
|
||||||
<p>Connects the client with a username and password specified.</p>
|
<p>Connects the client with a username and password specified.</p>
|
||||||
<h5>Parameters</h5>
|
<h5>Parameters</h5>
|
||||||
<ul>
|
<ul>
|
||||||
<li>clientID : the client ID to use when connecting to the server. As per MQTT, this must be between 1 and 23 characters long.</li>
|
<li><span class="methodparams">clientID</span> : the client ID to use when connecting to the server. As per MQTT, this must be between 1 and 23 characters long.</li>
|
||||||
<li>username : the username to use. If NULL, no username or password is used (char*)</li>
|
<li><span class="methodparams">username</span> : the username to use. If NULL, no username or password is used (const char[])</li>
|
||||||
<li>password : the password to use. If NULL, no password is used (char*)</li>
|
<li><span class="methodparams">password</span> : the password to use. If NULL, no password is used (const char[])</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h5>Returns</h5>
|
<h5>Returns</h5>
|
||||||
<ul>
|
<ul>
|
||||||
<li>false – connection failed.</li>
|
<li>false - connection failed.</li>
|
||||||
<li>true – connection succeeded.</li>
|
<li>true - connection succeeded.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="method" id="connect4">
|
<section class="method" id="connect4">
|
||||||
<h4><span class="methodreturn">boolean</span> <span class="methodname">connect</span> <span class="methodparams">(clientID, username, password, willTopic, willQoS, willRetain, willMessage)</span></h4>
|
<h4><span class="methodreturn">boolean</span> <span class="methodname">connect</span> <span class="methodparams">(clientID, username, password, willTopic, willQoS, willRetain, willMessage)</span></h4>
|
||||||
<p>Connects the client with a Will message, username and password specified.</p>
|
<p>Connects the client with a Will message, username and password specified.</p>
|
||||||
<h5>Parameters</h5>
|
<h5>Parameters</h5>
|
||||||
<ul>
|
<ul>
|
||||||
<li>clientID : the client ID to use when connecting to the server. As per MQTT, this must be between 1 and 23 characters long.</li>
|
<li><span class="methodparams">clientID</span> : the client ID to use when connecting to the server. As per MQTT, this must be between 1 and 23 characters long.</li>
|
||||||
<li>username : the username to use. If NULL, no username or password is used (char*)</li>
|
<li><span class="methodparams">username</span> : the username to use. If NULL, no username or password is used (const char[])</li>
|
||||||
<li>password : the password to use. If NULL, no password is used (char*)</li>
|
<li><span class="methodparams">password</span> : the password to use. If NULL, no password is used (const char[])</li>
|
||||||
<li>willTopic : the topic to be used by the will message (char*)</li>
|
<li><span class="methodparams">willTopic</span> : the topic to be used by the will message (const char[])</li>
|
||||||
<li>willQoS : the quality of service to be used by the will message (int : 0,1 or 2)</li>
|
<li><span class="methodparams">willQoS</span> : the quality of service to be used by the will message (int : 0,1 or 2)</li>
|
||||||
<li>willRetain : whether the will should be published with the retain flag (int : 0 or 1)</li>
|
<li><span class="methodparams">willRetain</span> : whether the will should be published with the retain flag (int : 0 or 1)</li>
|
||||||
<li>willMessage : the payload of the will message (char*)</li>
|
<li><span class="methodparams">willMessage</span> : the payload of the will message (const char[])</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h5>Returns</h5>
|
<h5>Returns</h5>
|
||||||
<ul>
|
<ul>
|
||||||
<li>false – connection failed.</li>
|
<li>false - connection failed.</li>
|
||||||
<li>true – connection succeeded.</li>
|
<li>true - connection succeeded.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="method" id="disconnect">
|
<section class="method" id="disconnect">
|
||||||
<h4><span class="methodreturn">void</span> <span class="methodname">disconnect</span> <span class="methodparams">()</span></h4>
|
<h4><span class="methodreturn">void</span> <span class="methodname">disconnect</span> <span class="methodparams">()</span></h4>
|
||||||
<p>Disconnects the client.</p>
|
<p>Disconnects the client.</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="method" id="publish1">
|
<section class="method" id="publish1">
|
||||||
<h4><span class="methodreturn">int</span> <span class="methodname">publish</span> <span class="methodparams">(topic, payload)</span></h4>
|
<h4><span class="methodreturn">int</span> <span class="methodname">publish</span> <span class="methodparams">(topic, payload)</span></h4>
|
||||||
<p>Publishes a string message to the specified topic.</p>
|
<p>Publishes a string message to the specified topic.</p>
|
||||||
<h5>Parameters</h5>
|
<h5>Parameters</h5>
|
||||||
<ul>
|
<ul>
|
||||||
<li>topic – the topic to publish to (char*)</li>
|
<li>topic - the topic to publish to (const char[])</li>
|
||||||
<li>payload – the message to publish (char*)</li>
|
<li>payload - the message to publish (const char[])</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h5>Returns</h5>
|
<h5>Returns</h5>
|
||||||
<ul>
|
<ul>
|
||||||
<li>false – publish failed.</li>
|
<li>false - publish failed.</li>
|
||||||
<li>true – publish succeeded.</li>
|
<li>true - publish succeeded.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="method" id="publish2">
|
<section class="method" id="publish2">
|
||||||
<h4><span class="methodreturn">int</span> <span class="methodname">publish</span> <span class="methodparams">(topic, payload, length)</span></h4>
|
<h4><span class="methodreturn">int</span> <span class="methodname">publish</span> <span class="methodparams">(topic, payload, length)</span></h4>
|
||||||
<p>Publishes a message to the specified topic.</p>
|
<p>Publishes a message to the specified topic.</p>
|
||||||
<h5>Parameters</h5>
|
<h5>Parameters</h5>
|
||||||
<ul>
|
<ul>
|
||||||
<li>topic – the topic to publish to (char*)</li>
|
<li>topic - the topic to publish to (const char[])</li>
|
||||||
<li>payload – the message to publish (byte array)</li>
|
<li>payload - the message to publish (byte array)</li>
|
||||||
<li>length – the length of the message (byte)</li>
|
<li>length - the length of the message (byte)</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h5>Returns</h5>
|
<h5>Returns</h5>
|
||||||
<ul>
|
<ul>
|
||||||
<li>false – publish failed.</li>
|
<li>false - publish failed.</li>
|
||||||
<li>true – publish succeeded.</li>
|
<li>true - publish succeeded.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="method" id="publish3">
|
<section class="method" id="publish3">
|
||||||
<h4><span class="methodreturn">int</span> <span class="methodname">publish</span> <span class="methodparams">(topic, payload, length, retained)</span></h4>
|
<h4><span class="methodreturn">int</span> <span class="methodname">publish</span> <span class="methodparams">(topic, payload, length, retained)</span></h4>
|
||||||
<p>Publishes a message to the specified topic, with the retained flag as specified.</p>
|
<p>Publishes a message to the specified topic, with the retained flag as specified.</p>
|
||||||
<h5>Parameters</h5>
|
<h5>Parameters</h5>
|
||||||
<ul>
|
<ul>
|
||||||
<li>topic – the topic to publish to (char*)</li>
|
<li>topic - the topic to publish to (const char[])</li>
|
||||||
<li>payload – the message to publish (byte array)</li>
|
<li>payload - the message to publish (byte array)</li>
|
||||||
<li>length – the length of the message (byte)</li>
|
<li>length - the length of the message (byte)</li>
|
||||||
<li>retained – whether the message should be retained (byte)
|
<li>retained - whether the message should be retained (byte)
|
||||||
<ul>
|
<ul>
|
||||||
<li>0 – not retained</li>
|
<li>0 - not retained</li>
|
||||||
<li>1 – retained</li>
|
<li>1 - retained</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h5>Returns</h5>
|
<h5>Returns</h5>
|
||||||
<ul>
|
<ul>
|
||||||
<li>false – publish failed.</li>
|
<li>false - publish failed.</li>
|
||||||
<li>true – publish succeeded.</li>
|
<li>true - publish succeeded.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="method" id="publish4">
|
<section class="method" id="publish4">
|
||||||
<h4><span class="methodreturn">int</span> <span class="methodname">publish_P</span> <span class="methodparams">(topic, payload, length, retained)</span></h4>
|
<h4><span class="methodreturn">int</span> <span class="methodname">publish_P</span> <span class="methodparams">(topic, payload, length, retained)</span></h4>
|
||||||
<p>Publishes a message stored in <code>PROGMEN</code> to the specified topic, with the retained flag as specified.</p>
|
<p>Publishes a message stored in <code>PROGMEN</code> to the specified topic, with the retained flag as specified.</p>
|
||||||
<h5>Parameters</h5>
|
<h5>Parameters</h5>
|
||||||
<ul>
|
<ul>
|
||||||
<li>topic – the topic to publish to (char*)</li>
|
<li>topic - the topic to publish to (const char[])</li>
|
||||||
<li>payload – the message to publish (PROGMEM byte array)</li>
|
<li>payload - the message to publish (PROGMEM byte array)</li>
|
||||||
<li>length – the length of the message (byte)</li>
|
<li>length - the length of the message (byte)</li>
|
||||||
<li>retained – whether the message should be retained (byte)
|
<li>retained - whether the message should be retained (byte)
|
||||||
<ul>
|
<ul>
|
||||||
<li>0 – not retained</li>
|
<li>0 - not retained</li>
|
||||||
<li>1 – retained</li>
|
<li>1 - retained</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h5>Returns</h5>
|
<h5>Returns</h5>
|
||||||
<ul>
|
<ul>
|
||||||
<li>false – publish failed.</li>
|
<li>false - publish failed.</li>
|
||||||
<li>true – publish succeeded.</li>
|
<li>true - publish succeeded.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="method" id="subscribe">
|
<section class="method" id="subscribe">
|
||||||
<h4><span class="methodreturn">boolean</span> <span class="methodname">subscribe</span> <span class="methodparams">(topic)</span></h4>
|
<h4><span class="methodreturn">boolean</span> <span class="methodname">subscribe</span> <span class="methodparams">(topic, [qos])</span></h4>
|
||||||
<p>Subscribes to messages published to the specified topic.</p>
|
<p>Subscribes to messages published to the specified topic.</p>
|
||||||
<h5>Parameters</h5>
|
<h5>Parameters</h5>
|
||||||
<ul>
|
<ul>
|
||||||
<li>topic – the topic to publish to (char*)</li>
|
<li>topic - the topic to subscribe to (const char[])</li>
|
||||||
</ul>
|
<li>qos - <i>optional</i> the qos to subscribe at (int: 0 or 1 only)
|
||||||
<h5>Returns</h5>
|
</ul>
|
||||||
<ul>
|
<h5>Returns</h5>
|
||||||
<li>false – sending the subscribe failed.</li>
|
<ul>
|
||||||
<li>true – sending the subscribe succeeded. The request completes asynchronously.</li>
|
<li>false - sending the subscribe failed.</li>
|
||||||
</ul>
|
<li>true - sending the subscribe succeeded. The request completes asynchronously.</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="method" id="unsubscribe">
|
||||||
|
<h4><span class="methodreturn">boolean</span> <span class="methodname">unsubscribe</span> <span class="methodparams">(topic)</span></h4>
|
||||||
|
<p>Unsubscribes from the specified topic.</p>
|
||||||
|
<h5>Parameters</h5>
|
||||||
|
<ul>
|
||||||
|
<li>topic - the topic to unsubscribe from (const char[])</li>
|
||||||
|
</ul>
|
||||||
|
<h5>Returns</h5>
|
||||||
|
<ul>
|
||||||
|
<li>false - sending the unsubscribe failed.</li>
|
||||||
|
<li>true - sending the unsubscribe succeeded. The request completes asynchronously.</li>
|
||||||
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="method" id="loop">
|
<section class="method" id="loop">
|
||||||
<h4><span class="methodreturn">boolean</span> <span class="methodname">loop</span> <span class="methodparams">()</span></h4>
|
<h4><span class="methodreturn">boolean</span> <span class="methodname">loop</span> <span class="methodparams">()</span></h4>
|
||||||
<p>This should be called regularly to allow the client to process incoming messages and maintain its connection to the server.</p>
|
<p>This should be called regularly to allow the client to process incoming messages and maintain its connection to the server.</p>
|
||||||
<h5>Returns</h5>
|
<h5>Returns</h5>
|
||||||
<ul>
|
<ul>
|
||||||
<li>false – the client is no longer connected</li>
|
<li>false - the client is no longer connected</li>
|
||||||
<li>true – the client is still connected</li>
|
<li>true - the client is still connected</li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="method" id="connected">
|
<section class="method" id="connected">
|
||||||
<h4><span class="methodreturn">int</span> <span class="methodname">connected</span> <span class="methodparams">()</span></h4>
|
<h4><span class="methodreturn">int</span> <span class="methodname">connected</span> <span class="methodparams">()</span></h4>
|
||||||
<p>Checks whether the client is connected to the server.</p>
|
<p>Checks whether the client is connected to the server.</p>
|
||||||
<h5>Returns</h5>
|
<h5>Returns</h5>
|
||||||
<ul>
|
<ul>
|
||||||
<li>false – the client is no longer connected</li>
|
<li>false - the client is no longer connected</li>
|
||||||
<li>true – the client is still connected</li>
|
<li>true - the client is still connected</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="method" id="state">
|
||||||
|
<h4><span class="methodreturn">int</span> <span class="methodname">state</span> <span class="methodparams">()</span></h4>
|
||||||
|
<p>Returns the current state of the client. If a connection attempt fails,
|
||||||
|
this can be used to get more information about the failure.</p>
|
||||||
|
<h5>Returns</h5>
|
||||||
|
<ul>
|
||||||
|
<li>int - the client state, which can take the following values (constants defined in <code>PubSubClient.h</code>): <ul>
|
||||||
|
<li>-4 : <code>MQTT_CONNECTION_TIMEOUT</code> - the server didn't respond within the keepalive time</li>
|
||||||
|
<li>-3 : <code>MQTT_CONNECTION_LOST</code> - the network connection was broken</li>
|
||||||
|
<li>-2 : <code>MQTT_CONNECT_FAILED</code> - the network connection failed</li>
|
||||||
|
<li>-1 : <code>MQTT_DISCONNECTED</code> - the client is disconnected cleanly</li>
|
||||||
|
<li>0 : <code>MQTT_CONNECTED</code> - the cient is connected</li>
|
||||||
|
<li>1 : <code>MQTT_CONNECT_BAD_PROTOCOL</code> - the server doesn't support the requested version of MQTT</li>
|
||||||
|
<li>2 : <code>MQTT_CONNECT_BAD_CLIENT_ID</code> - the server rejected the client identifier</li>
|
||||||
|
<li>3 : <code>MQTT_CONNECT_UNAVAILABLE</code> - the server was unable to accept the connection</li>
|
||||||
|
<li>4 : <code>MQTT_CONNECT_BAD_CREDENTIALS</code> - the username/password were rejected</li>
|
||||||
|
<li>5 : <code>MQTT_CONNECT_UNAUTHORIZED</code> - the client was not authorized to connect</li>
|
||||||
|
</ul></li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="method" id="setserver">
|
||||||
|
<h4><span class="methodreturn">PubSubClient</span> <span class="methodname">setServer</span> <span class="methodparams">(server, port)</span></h4>
|
||||||
|
<p>Sets the server details.</p>
|
||||||
|
<h5>Parameters</h5>
|
||||||
|
<ul>
|
||||||
|
<li><span class="methodparams">server</span> : the address of the server (IPAddress, uint8_t[] or const char[])</li>
|
||||||
|
<li><span class="methodparams">port</span> : the port to connect to (int)</li>
|
||||||
|
</ul>
|
||||||
|
<h5>Returns</h5>
|
||||||
|
<ul>
|
||||||
|
<li>PubSubClient - the client instance, allowing the function to be chained</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="method" id="setcallback">
|
||||||
|
<h4><span class="methodreturn">PubSubClient</span> <span class="methodname">setCallback</span> <span class="methodparams">(callback)</span></h4>
|
||||||
|
<p>Sets the message callback function.</p>
|
||||||
|
<h5>Parameters</h5>
|
||||||
|
<ul>
|
||||||
|
<li><span class="methodparams">callback</span> : a pointer to a <a href="#callback">message callback</a> function called when a message arrives for a subscription created by this client.</li>
|
||||||
|
</ul>
|
||||||
|
<h5>Returns</h5>
|
||||||
|
<ul>
|
||||||
|
<li>PubSubClient - the client instance, allowing the function to be chained</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="method" id="setclient">
|
||||||
|
<h4><span class="methodreturn">PubSubClient</span> <span class="methodname">setClient</span> <span class="methodparams">(client)</span></h4>
|
||||||
|
<p>Sets the client.</p>
|
||||||
|
<h5>Parameters</h5>
|
||||||
|
<ul>
|
||||||
|
<li><span class="methodparams">client</span> : an instance of <code>Client</code>, typically <code>EthernetClient</code>.</li>
|
||||||
|
</ul>
|
||||||
|
<h5>Returns</h5>
|
||||||
|
<ul>
|
||||||
|
<li>PubSubClient - the client instance, allowing the function to be chained</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="method" id="setstream">
|
||||||
|
<h4><span class="methodreturn">PubSubClient</span> <span class="methodname">setStream</span> <span class="methodparams">(stream)</span></h4>
|
||||||
|
<p>Sets the stream.</p>
|
||||||
|
<h5>Parameters</h5>
|
||||||
|
<ul>
|
||||||
|
<li><span class="methodparams">stream</span> : an instance of <code>Stream</code>, used to store received messages. See the <code>mqtt_stream</code> example for more information.</li>
|
||||||
|
</ul>
|
||||||
|
<h5>Returns</h5>
|
||||||
|
<ul>
|
||||||
|
<li>PubSubClient - the client instance, allowing the function to be chained</li>
|
||||||
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="method" id="configoptions">
|
<section class="method" id="configoptions">
|
||||||
<h4>Configuration Options</h4>
|
<h4>Configuration Options</h4>
|
||||||
<p>The following configuration options can be used to configure the library. They are contained in <code>PubSubClient.h</code>.</p>
|
<p>The following configuration options can be used to configure the library.
|
||||||
<dl>
|
They are contained in <code>PubSubClient.h</code>.</p>
|
||||||
<dt><code>MQTT_MAX_PACKET_SIZE</code></dt>
|
<dl>
|
||||||
<dd>Sets the largest packet size, in bytes, the client will handle. Any packet received that exceeds this size will be ignored.</p>
|
<dt><code>MQTT_MAX_PACKET_SIZE</code></dt>
|
||||||
<p>Default: 128 bytes
|
<dd>Sets the largest packet size, in bytes, the client will handle. Any
|
||||||
</dd>
|
packet received that exceeds this size will be ignored.</p>
|
||||||
<dt><code>MQTT_KEEPALIVE</code></dt>
|
<p>Default: 128 bytes</p>
|
||||||
<dd>Sets the keepalive interval, in seconds, the client will use. This is used to maintain the connection when no other packets are being<br />
|
</dd>
|
||||||
sent or received.</p>
|
<dt><code>MQTT_KEEPALIVE</code></dt>
|
||||||
<p>Default: 15 seconds
|
<dd>Sets the keepalive interval, in seconds, the client will use. This
|
||||||
</dd>
|
is used to maintain the connection when no other packets are being<br />
|
||||||
</dl>
|
sent or received.</p>
|
||||||
|
<p>Default: 15 seconds</p>
|
||||||
|
</dd>
|
||||||
|
<dt><code>MQTT_VERSION</code></dt>
|
||||||
|
<dd>Sets the version of the MQTT protocol to use. This defaults to interval, in seconds, the client will use. This is used to maintain the connection when no other packets are being<br />
|
||||||
|
sent or received.</p>
|
||||||
|
<p>Default: MQTT 3.1.1</p>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="method" id="callback">
|
|
||||||
<h4>Subscription Callback</h4>
|
|
||||||
<p>If the client is used to subscribe to topics, a callback function must be provided in the constructor. This function
|
|
||||||
is called when new messages arrive at the client.</p>
|
|
||||||
<p>The callback function has the following signature:
|
|
||||||
<pre>
|
|
||||||
void callback(char* topic, byte* payload, unsigned int length)
|
|
||||||
</pre>
|
|
||||||
<h5>Parameters</h5>
|
|
||||||
<ul>
|
|
||||||
<li>topic – the topic the message arrived on (char*)</li>
|
|
||||||
<li>payload – the message payload (byte array)</li>
|
|
||||||
<li>length – the length of the message payload (unsigned int)</li>
|
|
||||||
</ul>
|
|
||||||
<p>Internally, the client uses the same buffer for both inbound and outbound
|
|
||||||
messages. After the callback function returns, or if a call to either <code>publish</code>
|
|
||||||
or <code>subscribe</code> is made from within the callback function, the <code>topic</code>
|
|
||||||
and <code>payload</code> values passed to the function will be overwritten. The application
|
|
||||||
should create its own copy of the values if they are required beyond this.</p>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
|
|
||||||
|
<section class="method" id="callback">
|
||||||
|
<h4>Subscription Callback</h4>
|
||||||
|
<p>If the client is used to subscribe to topics, a callback function must be
|
||||||
|
provided in the constructor. This function is called when new messages
|
||||||
|
arrive at the client.
|
||||||
|
</p>
|
||||||
|
<p>The callback function has the following signature:</p>
|
||||||
|
<pre>void callback(const char[] topic, byte* payload, unsigned int length)</pre>
|
||||||
|
<h5>Parameters</h5>
|
||||||
|
<ul>
|
||||||
|
<li>topic - the topic the message arrived on (const char[])</li>
|
||||||
|
<li>payload - the message payload (byte array)</li>
|
||||||
|
<li>length - the length of the message payload (unsigned int)</li>
|
||||||
|
</ul>
|
||||||
|
<p>Internally, the client uses the same buffer for both inbound and outbound
|
||||||
|
messages. After the callback function returns, or if a call to either <code>publish</code>
|
||||||
|
or <code>subscribe</code> is made from within the callback function, the <code>topic</code>
|
||||||
|
and <code>payload</code> values passed to the function will be overwritten. The application
|
||||||
|
should create its own copy of the values if they are required beyond this.
|
||||||
|
</p>
|
||||||
|
</section>
|
||||||
|
55
index.html
55
index.html
@ -2,26 +2,64 @@
|
|||||||
layout: default
|
layout: default
|
||||||
title: Arduino Client for MQTT
|
title: Arduino Client for MQTT
|
||||||
---
|
---
|
||||||
<p>This library provides a client for doing simple publish/subscribe messaging with a server that supports MQTT v3.</p>
|
<p>This library provides a client for doing simple publish/subscribe messaging with a server that supports MQTT</p>
|
||||||
<p>For more information about MQTT, visit <a href="http://mqtt.org">mqtt.org</a>.</p>
|
<p>For more information about MQTT, visit <a href="http://mqtt.org">mqtt.org</a>.</p>
|
||||||
|
|
||||||
<section id="Download">
|
<section id="Download">
|
||||||
<h3>Download</h3>
|
<h2>Download</h2>
|
||||||
<p>The latest version of the library can be downloaded from <a href="https://github.com/knolleary/pubsubclient/tags">GitHub</a>.</p>
|
<p>The latest version of the library can be downloaded from <a href="https://github.com/knolleary/pubsubclient/tags">GitHub</a>.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="Documentation">
|
<section id="Documentation">
|
||||||
<h3>Documentation</h3>
|
<h2>Documentation</h2>
|
||||||
<p>The library comes with a number of example sketches. See <code>File > Examples > PubSubClient</code> within the Arduino application.</p>
|
<p>The library comes with a number of example sketches. See <code>File > Examples > PubSubClient</code> within the Arduino application.</p>
|
||||||
<p>Full <a href="api.html">API Documentation</a></p>
|
<p>Full <a href="api.html">API Documentation</a></p>
|
||||||
</section>
|
</section>
|
||||||
<section id="License">
|
<section id="Hardware">
|
||||||
<h3>License</h3>
|
<h2>Compatible Hardware</h2>
|
||||||
<p>This library is released under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT License</a>.</p>
|
<p>
|
||||||
</section>
|
The library uses the Arduino Ethernet Client api for interacting with the
|
||||||
|
underlying network hardware. This means it Just Works with a growing number of
|
||||||
|
boards and shields, including:
|
||||||
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li>Arduino Ethernet</li>
|
||||||
|
<li>Arduino Ethernet Shield</li>
|
||||||
|
<li>Arduino YUN – use the included <code>YunClient</code> in place of <code>EthernetClient</code>, and
|
||||||
|
be sure to do a <code>Bridge.begin()</code> first</li>
|
||||||
|
<li>Arduino WiFi Shield</li>
|
||||||
|
<li>Sparkfun WiFly Shield – when used with <a href="https://github.com/dpslwk/WiFly">this library</a></li>
|
||||||
|
<li>Intel Galileo/Edison</li>
|
||||||
|
<li>ESP8266</li>
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
The library cannot currently be used with hardware based on the ENC28J60 chip –
|
||||||
|
such as the Nanode or the Nuelectronics Ethernet Shield. For those, there is an
|
||||||
|
<a href="https://github.com/njh/NanodeMQTT">alternative library</a> available.
|
||||||
|
</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section id="Author">
|
||||||
|
<h2>Author</h2>
|
||||||
|
<p>Nick O'Leary - <a href="https://twitter.com/knolleary">@knolleary</a></p>
|
||||||
|
</section>
|
||||||
|
<section id="License">
|
||||||
|
<h2>License</h2>
|
||||||
|
<p>This library is released under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT License</a>.</p>
|
||||||
|
</section>
|
||||||
<section id="ChangeHistory">
|
<section id="ChangeHistory">
|
||||||
<h3>Change History</h3>
|
<h2>Change History</h2>
|
||||||
<p>The complete change history is available on <a href="https://github.com/knolleary/pubsubclient/commits/master">GitHub</a>.</p>
|
<p>The complete change history is available on <a href="https://github.com/knolleary/pubsubclient/commits/master">GitHub</a>.</p>
|
||||||
<dl>
|
<dl>
|
||||||
|
<dt>2.0</dt>
|
||||||
|
<dd>
|
||||||
|
<ul>
|
||||||
|
<li>Add (and default to) MQTT 3.1.1 support</li>
|
||||||
|
<li>Fix PROGMEM handling for Intel Galileo/ESP8266</li>
|
||||||
|
<li>Add overloaded constructors for convenience</li>
|
||||||
|
<li>Add chainable setters for server/callback/client/stream</li>
|
||||||
|
<li>Add state function to return connack return code</li>
|
||||||
|
</ul>
|
||||||
|
</dd>
|
||||||
<dt>1.9</dt>
|
<dt>1.9</dt>
|
||||||
<dd>
|
<dd>
|
||||||
<ul>
|
<ul>
|
||||||
@ -100,4 +138,3 @@ title: Arduino Client for MQTT
|
|||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
77
style.css
77
style.css
@ -1,20 +1,74 @@
|
|||||||
|
body {
|
||||||
|
font-family: 'Arial', sans-serif;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
h1,h2,h3,h4,h5 {
|
||||||
|
font-family: 'Questrial', serif;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
font-size: 1.953em;
|
||||||
|
}
|
||||||
|
h2 {
|
||||||
|
font-size: 1.563em;
|
||||||
|
}
|
||||||
|
h3 {
|
||||||
|
font-size: 1.25em;
|
||||||
|
}
|
||||||
|
h4 {
|
||||||
|
font-size: 1.15em;
|
||||||
|
}
|
||||||
|
pre, code {
|
||||||
|
font-family: 'Cutive Mono',monospace;
|
||||||
|
}
|
||||||
|
pre {
|
||||||
|
border: 1px solid #aaa;
|
||||||
|
padding: 10px;
|
||||||
|
margin: auto 10px;
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
a, a:visited{
|
||||||
|
color: #4178BE;
|
||||||
|
}
|
||||||
|
#content {
|
||||||
|
max-width: 900px;
|
||||||
|
padding: 10px;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
section {
|
section {
|
||||||
padding-top:40px;
|
padding-top:40px;
|
||||||
margin-top: -40px;
|
margin-top: -40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.method {
|
#header ul {
|
||||||
border-bottom: 3px solid #eee;
|
list-style-type: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 10px 0;
|
||||||
|
}
|
||||||
|
#header li {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0 10px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
#header li:not(:first-child) {
|
||||||
|
border-left: 1px solid #999;
|
||||||
|
}
|
||||||
|
#header li:first-child {
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
.method {
|
||||||
|
border-bottom: 2px solid #eee;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
padding-bottom: 15px;
|
padding-bottom: 15px;
|
||||||
}
|
}
|
||||||
.methodname {}
|
.methodname { font-weight: bold;color: #333;}
|
||||||
.methodreturn { font-weight: normal; color: #777;}
|
.methodreturn { font-weight: normal; color: #777;}
|
||||||
.methodparams { font-weight: normal; color: #777;}
|
.methodparams { font-weight: normal; color: #777;}
|
||||||
|
ul a {
|
||||||
li.active {
|
text-decoration: none;
|
||||||
font-weight: bold;
|
}
|
||||||
text-decoration: underline !important;
|
ul a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ChangeHistory * dd { margin-left: 25px;}
|
#ChangeHistory * dd { margin-left: 25px;}
|
||||||
@ -22,14 +76,13 @@ li.active {
|
|||||||
#toc a {
|
#toc a {
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
h4 { font-size: 1.3em; }
|
|
||||||
h5 {
|
h5 {
|
||||||
margin: 0px;
|
margin: 15px 0px 5px 0;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
font-size: 1.0em;
|
font-size: 1.1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#content ul {
|
#content ul {
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
|
line-height: 1.4em;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
---
|
|
||||||
layout: default
|
|
||||||
title: Tutorial
|
|
||||||
---
|
|
||||||
<h1>The little book of MQTT on Arduino</h1>
|
|
||||||
<p>More to come...</p>
|
|
Loading…
x
Reference in New Issue
Block a user