forked from knolleary/pubsubclient
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rebuild docs to make them easier to maintain
- Loading branch information
Showing
35 changed files
with
716 additions
and
590 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
_site/ | ||
.jekyll-cache | ||
.DS_Store | ||
.ruby-version | ||
tests/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{% | ||
for param in include.params | ||
%}{% | ||
if param.optionalGroup | ||
%}[{% include paramsList.html params=param.params %}]{% | ||
else | ||
%}{% | ||
if param.optional %}[{%endif %}{{param.name}}{% if param.optional %}]{%endif | ||
%}{%endif | ||
%}{% if forloop.last == false %}, {%endif%}{% endfor | ||
%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{% | ||
for param in include.params | ||
%}<li>{% | ||
if param.optionalGroup | ||
%}<span class="methodparams">{{param.name}}</span> - <span class="methodparamoptional">(optional)</span><ul>{% include paramsListLong.html params=param.params %}</ul>{% | ||
else | ||
%} | ||
<span class="methodparams">{{param.name}}</span> {% if param.type %}<span class="methodparamstype">{{param.type}}</span> {% endif %} {% if param.optional %}<span class="methodparamoptional">(optional)</span> {%endif %} - | ||
{{param.description}} | ||
|
||
{% endif %}</li>{% endfor | ||
%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
tag: api | ||
type: constructor | ||
name: PubSubClient | ||
|
||
--- | ||
|
||
Creates an uninitialised client instance. | ||
|
||
Before it can be used, it must be configured with the property setters: | ||
|
||
``` | ||
EthernetClient ethClient; | ||
PubSubClient client; | ||
void setup() { | ||
client.setClient(ethClient); | ||
client.setServer("broker.example.com",1883); | ||
// client is now configured for use | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
tag: api | ||
type: constructor | ||
name: PubSubClient | ||
params: | ||
- name: client | ||
description: the network client to use, for example <code>WiFiClient</code> | ||
--- | ||
|
||
|
||
Creates a partially initialised client instance. | ||
|
||
Before it can be used, the server details must be configured: | ||
|
||
``` | ||
EthernetClient ethClient; | ||
PubSubClient client(ethClient); | ||
void setup() { | ||
client.setServer("broker.example.com",1883); | ||
// client is now ready for use | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
tag: api | ||
type: constructor | ||
name: PubSubClient | ||
params: | ||
- name: server | ||
description: the address of the server | ||
type: IPAddress, uint8_t[] or const char[] | ||
- name: port | ||
description: the port to connect to | ||
type: int | ||
- name: callback | ||
optional: true | ||
description: a pointer to a <a href="#callback">message callback function</a> called when a message arrives for a subscription created by this client | ||
type: function* | ||
- name: client | ||
description: the network client to use, for example <code>WiFiClient</code> | ||
- name: stream | ||
optional: true | ||
description: a stream to write received messages to | ||
type: Stream | ||
--- | ||
|
||
|
||
Creates a fully configured client instance. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
tag: api | ||
type: function | ||
name: connect | ||
params: | ||
- name: clientID | ||
description: the client ID to use when connecting to the server | ||
type: const char[] | ||
- name: Credentials | ||
optionalGroup: true | ||
params: | ||
- name: username | ||
description: the username to use. If <code>NULL</code>, no username or password is used | ||
type: const char[] | ||
- name: password | ||
description: the password to use. If <code>NULL</code>, no password is used | ||
type: const char[] | ||
- name: Will | ||
optionalGroup: true | ||
params: | ||
- name: willTopic | ||
description: the topic to be used by the will message | ||
type: const char[] | ||
- name: willQoS | ||
description: the quality of service to be used by the will message | ||
type: 'int: 0,1 or 2' | ||
- name: willRetain | ||
description: whether the will should be published with the retain flag | ||
type: boolean | ||
- name: willMessage | ||
description: the payload of the will message | ||
type: const char[] | ||
- name: cleanSession | ||
description: whether to connect clean-session or not | ||
type: boolean | ||
optional: true | ||
returns: | ||
type: boolean | ||
values: | ||
- value: 'false' | ||
description: connection failed | ||
- value: 'true' | ||
description: connection succeeded | ||
--- | ||
|
||
|
||
Connects the client. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
tag: api | ||
type: function | ||
name: disconnect | ||
returns: | ||
type: void | ||
--- | ||
|
||
Disconnects the client. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
tag: api | ||
type: function | ||
name: publish | ||
params: | ||
- name: topic | ||
description: the topic to publish to | ||
type: const char[] | ||
- name: payload | ||
description: the message to publish | ||
type: const char[], byte[] | ||
- name: length | ||
optional: true | ||
description: the length of the payload. Required if <span class="methodparams">payload</span> is a <span class="methodparamstype">byte[]</span> | ||
type: unsigned int | ||
- name: retained | ||
optional: true | ||
description: whether the message should be retained | ||
<ul> | ||
<li>false - not retained</li> | ||
<li>true - retained</li> | ||
</ul> | ||
type: boolean | ||
returns: | ||
type: boolean | ||
values: | ||
- value: 'false' | ||
description: publish failed, either connection lost or message too large | ||
- value: 'true' | ||
description: publish succeeded | ||
--- | ||
|
||
Publishes a message to the specified topic. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
tag: api | ||
type: function | ||
type: function | ||
name: publish_P | ||
params: | ||
- name: topic | ||
description: the topic to publish to | ||
type: const char[] | ||
- name: payload | ||
description: the message to publish | ||
type: const char[], byte[] | ||
- name: length | ||
optional: true | ||
description: the length of the payload. Required if <span class="methodparams">payload</span> is a <span class="methodparamstype">byte[]</span> | ||
type: unsigned int | ||
- name: retained | ||
optional: true | ||
description: whether the message should be retained | ||
<ul> | ||
<li>false - not retained</li> | ||
<li>true - retained</li> | ||
</ul> | ||
type: boolean | ||
returns: | ||
type: boolean | ||
values: | ||
- value: 'false' | ||
description: publish failed, either connection lost or message too large | ||
- value: 'true' | ||
description: publish succeeded | ||
--- | ||
|
||
Publishes a message stored in PROGMEM to the specified topic. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
tag: api | ||
type: function | ||
name: beginPublish | ||
params: | ||
- name: topic | ||
description: the topic to publish to | ||
type: const char[] | ||
- name: length | ||
description: the length of the payload to be sent | ||
type: unsigned int | ||
- name: retained | ||
description: whether the message should be retained | ||
<ul> | ||
<li>false - not retained</li> | ||
<li>true - retained</li> | ||
</ul> | ||
type: boolean | ||
returns: | ||
type: boolean | ||
values: | ||
- value: 'false' | ||
description: publish failed, either connection lost or message too large | ||
- value: 'true' | ||
description: publish succeeded | ||
--- | ||
|
||
Begins sending a publish message. The payload of the message is provided by one or more calls to <code>write</code> followed by a call to <code>endPublish</code>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
tag: api | ||
type: function | ||
name: write | ||
params: | ||
- name: byte | ||
description: a byte to write to the publish payload | ||
type: uint8_t | ||
returns: | ||
type: int | ||
values: | ||
- value: int | ||
description: the number of bytes written | ||
--- | ||
|
||
Writes a byte as a component of a publish started with a call to <code>beginPublish</code>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
tag: api | ||
type: function | ||
name: write | ||
params: | ||
- name: payload | ||
description: the bytes to write | ||
type: byte[] | ||
- name: length | ||
description: the length of the payload to be sent | ||
type: unsigned int | ||
returns: | ||
type: int | ||
values: | ||
- value: int | ||
description: the number of bytes written | ||
--- | ||
|
||
Writes an array of bytes as a component of a publish started with a call to <code>beginPublish</code>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
tag: api | ||
type: function | ||
name: endPublish | ||
returns: | ||
type: boolean | ||
values: | ||
- value: 'false' | ||
description: publish failed, either connection lost or message too large | ||
- value: 'true' | ||
description: publish succeeded | ||
--- | ||
|
||
Finishing sending a message that was started with a call to <code>beginPublish</code>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
tag: api | ||
type: function | ||
name: subscribe | ||
params: | ||
- name: topic | ||
description: the topic to subscribe to | ||
type: const char[] | ||
- name: qos | ||
optional: true | ||
description: the qos to subscribe at | ||
type: 'int: 0 or 1 only' | ||
returns: | ||
type: boolean | ||
values: | ||
- value: 'false' | ||
description: sending the subscribe failed, either connection lost or message too large | ||
- value: 'true' | ||
description: sending the subscribe succeeded | ||
--- | ||
|
||
Subscribes to messages published to the specified topic. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
tag: api | ||
type: function | ||
name: unsubscribe | ||
params: | ||
- name: topic | ||
description: the topic to unsubscribe from | ||
type: const char[] | ||
returns: | ||
type: boolean | ||
values: | ||
- value: 'false' | ||
description: sending the unsubscribe failed, either connection lost or message too large | ||
- value: 'true' | ||
description: sending the unsubscribe succeeded | ||
--- | ||
|
||
Unsubscribes from the specified topic. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
tag: api | ||
type: function | ||
name: loop | ||
returns: | ||
type: boolean | ||
values: | ||
- value: 'false' | ||
description: the client is no longer connected | ||
- value: 'true' | ||
description: the client is still connected | ||
--- | ||
|
||
This should be called regularly to allow the client to process incoming messages and maintain its connection to the server. | ||
|
Oops, something went wrong.