Skip to content

Commit

Permalink
Rebuild docs to make them easier to maintain
Browse files Browse the repository at this point in the history
  • Loading branch information
knolleary committed May 21, 2020
1 parent 09a3de6 commit a9d9bad
Show file tree
Hide file tree
Showing 35 changed files with 716 additions and 590 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
_site/
.jekyll-cache
.DS_Store
.ruby-version
tests/bin
11 changes: 11 additions & 0 deletions _includes/paramsList.html
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
%}
12 changes: 12 additions & 0 deletions _includes/paramsListLong.html
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
%}
2 changes: 1 addition & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div id="content">
<div id="header">
<ul>
<li><a href="index.html">Arduino Client for MQTT</a></li><li><a href="api.html">API Documentation</a></li>
<li><a href="/">Arduino Client for MQTT</a></li><li><a href="/api">API Documentation</a></li>
</ul>
</div>
<h1>{{ page.title }}</h1>
Expand Down
21 changes: 21 additions & 0 deletions _posts/2000-01-01-PubSubClient.md
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
}
```
23 changes: 23 additions & 0 deletions _posts/2000-01-02-PubSubClient1.md
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
}
```
25 changes: 25 additions & 0 deletions _posts/2000-01-03-PubSubClient2.md
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.
48 changes: 48 additions & 0 deletions _posts/2000-02-01-connect.md
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.

9 changes: 9 additions & 0 deletions _posts/2000-02-02-disconnect.md
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.
34 changes: 34 additions & 0 deletions _posts/2000-03-01-publish.md
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.

34 changes: 34 additions & 0 deletions _posts/2000-03-02-publish_p.md
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.
28 changes: 28 additions & 0 deletions _posts/2000-03-03-beginPublish.md
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>.
16 changes: 16 additions & 0 deletions _posts/2000-03-04-write1.md
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>.
19 changes: 19 additions & 0 deletions _posts/2000-03-05-write2.md
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>.
14 changes: 14 additions & 0 deletions _posts/2000-03-06-endPublish.md
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>.
23 changes: 23 additions & 0 deletions _posts/2000-04-01-subscribe.md
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.

18 changes: 18 additions & 0 deletions _posts/2000-04-02-unsubscribe.md
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.
15 changes: 15 additions & 0 deletions _posts/2000-05-01-loop.md
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.

Loading

0 comments on commit a9d9bad

Please sign in to comment.