Skip to content

Commit 60e6264

Browse files
committed
Add explanation of ConnectionManager
1 parent 48674f4 commit 60e6264

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,22 @@ The library is divided into various classes:
3131
- `CloudSerial` it's similar to [Serial](https://www.arduino.cc/reference/en/language/functions/communication/serial/), but used in combination with the cloud.
3232

3333
### ConnectionManager
34-
[todo]
34+
35+
*Connection Manager* is capable of knowing which board is being used through some `ifdef`.
36+
37+
- Instantiate the class with `ConnectionManager *ArduinoIoTPreferredConnection = new WiFiConnectionManager(SECRET_SSID, SECRET_PASS);` if you are using a WiFi board
38+
39+
- `check()` function does all the job. It uses a finite state machine and it's responsible for the connection and reconnection to the Internet. The function is non blocking thanks to *millis*
40+
41+
- `getTime()` function actually return the time from a NTP server. It's used for the connection to the cloud
42+
43+
- `&getClient()` returns the client
44+
45+
- ` getStatus()` returns the network connection status
46+
47+
- `debugMessage(char *_msg, uint8_t _debugLevel)` function used to print debug messages on the serial
48+
49+
- 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.
3550

3651
### ArduinoIoTCloud
3752
[todo]

0 commit comments

Comments
 (0)