@@ -42,12 +42,12 @@ See the [DeviceInfo](https://github.com/TheThingsNetwork/arduino-device-lib/blob
42
42
Sets a function which will be called to process incoming messages.
43
43
44
44
``` c
45
- void onMessage (void (* cb)(const byte* payload, size_t length, uint8_t port));
45
+ void onMessage (void (* cb)(const byte* payload, size_t length, port_t port));
46
46
```
47
47
48
48
- `const byte* payload`: Bytes received.
49
49
- `size_t length`: Number of bytes.
50
- - `uint8_t port`: The port addressed.
50
+ - `port_t port`: The port addressed.
51
51
52
52
See the [Receive](https://github.com/TheThingsNetwork/arduino-device-lib/blob/master/examples/Receive/Receive.ino) example.
53
53
@@ -90,12 +90,12 @@ See the [ABP](https://github.com/TheThingsNetwork/arduino-device-lib/blob/master
90
90
Send a message to the application using raw bytes.
91
91
92
92
```c
93
- int sendBytes(const byte* payload, size_t length, uint8_t port = 1, bool confirm = false);
93
+ int sendBytes(const byte* payload, size_t length, port_t port = 1, bool confirm = false);
94
94
```
95
95
96
96
- ` const byte* payload ` : Bytes to send.
97
97
- ` size_t length ` : The number of bytes. Use ` sizeof(payload) ` to get it.
98
- - ` uint8_t port = 1` : The port to address. Defaults to ` 1 ` .
98
+ - ` port_t port = 1` : The port to address. Defaults to ` 1 ` .
99
99
- ` bool confirm = false ` : Whether to ask for confirmation. Defaults to ` false ` .
100
100
101
101
Returns a success or error code and logs the related error message:
@@ -113,7 +113,7 @@ Also in sendBytes, due to TTN's 30 second fair access policy, we update the airt
113
113
## Method: poll
114
114
Calls ` sendBytes() ` with ` { 0x00 } ` as payload to poll for incoming messages.
115
115
116
- - ` uint8_t port = 1` : The port to address. Defaults to ` 1 ` .
116
+ - ` port_t port = 1` : The port to address. Defaults to ` 1 ` .
117
117
- ` bool confirm = false ` : Whether to ask for confirmation.
118
118
119
119
Returns the result of ` sendBytes() ` .
0 commit comments