Skip to content

Commit 3650640

Browse files
committed
Add explanation of ArduinoIoTCloud class
1 parent 60e6264 commit 3650640

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,23 @@ The library is divided into various classes:
4949
- The `setDebugMessageLevel(uint8_t _debugLevel)` function is used to set a debug level. Every debug message comes with a level which goes from 0 to 4. Higher level means higher verbosity. Debug messages with level higher than `_debugLevel` will not been showed.
5050

5151
### ArduinoIoTCloud
52-
[todo]
53-
### CloudSerial
54-
[todo]
52+
53+
- The `int begin(ConnectionManager *connection = ArduinoIoTPreferredConnection, String brokerAddress = "mqtts-sa.iot.arduino.cc")` function is used to initialize the connection to MQTT broker and to the cloud.
54+
55+
- The `connect()` function is used to connect to the MQTT broker and to the cloud
56+
57+
- `disconnect()` stops the MQTT Client
58+
59+
- The `update()` function checks the connnection with the MQTT broker, retrieve data from it and pushes back data using `writeProperties()`. `update()` is called periodically in the loop of .ino file.
60+
61+
- `connected()` simply returns the current status of the MQTT connection.
62+
63+
- `reconnect(Client&)` clean up existing MQTT connection, create a new one and initialize it by calling `connect()`
64+
65+
- `writeProperties(const byte data[], int length)` writes message to the MQTT Broker
66+
67+
- `setThingId(String const thing_id)` sets the *THING_ID*
68+
69+
- `getThingId()` returns the *THING_ID*
70+
71+
- `connectionCheck()` function is like `check()` from *ConnectionManager*. Uses a finite state machine and it's responsible for the connection to MQTT and the Cloud. It also uses *debugMessage* from *ConnectionManager* to print debug messages

0 commit comments

Comments
 (0)