Skip to content

Commit 698296d

Browse files
authored
Update TheThingsNetwork.md (#159)
* Update TheThingsNetwork.md * Update TheThingsNetwork.md
1 parent cc79bab commit 698296d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/TheThingsNetwork.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Total airtime: 0.00 s
3939
See the [DeviceInfo](https://github.com/TheThingsNetwork/arduino-device-lib/blob/master/examples/DeviceInfo/DeviceInfo.ino) example.
4040

4141
## Method: onMessage
42-
Sets a function which will be called to process incoming messages.
42+
Sets a function which will be called to process incoming messages. You'll want to do this in your `setup()` function and then define a `void (*cb)(const byte* payload, size_t length, port_t port)` function somewhere else in your sketch.
4343

4444
```c
4545
void onMessage(void (*cb)(const byte* payload, size_t length, port_t port));
@@ -96,7 +96,7 @@ int8_t sendBytes(const byte* payload, size_t length, port_t port = 1, bool confi
9696
- `const byte* payload `: Bytes to send.
9797
- `size_t length`: The number of bytes. Use `sizeof(payload)` to get it.
9898
- `port_t port = 1`: The port to address. Defaults to `1`.
99-
- `bool confirm = false`: Whether to ask for confirmation. Defaults to `false`.
99+
- `bool confirm = false`: Whether to ask for confirmation. Defaults to `false`. If confirmation fails, the method will return error code `-10`.
100100

101101
Returns a success or error code and logs the related error message:
102102

@@ -132,4 +132,4 @@ bool provision(const char *appEui, const char *appKey);
132132
```
133133

134134
- `const char *appEui`: Application Identifier for the device.
135-
- `const char *appKey`: Application Key assigned to the device.
135+
- `const char *appKey`: Application Key assigned to the device.

0 commit comments

Comments
 (0)