Add downlink callbacks on a per-port basis. A single message will be
handled as many times as users have registered matching ports. Callbacks
will also be run on "meta" downlink packets on port 0, such as confirmed
uplink acknowledgements.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Add a callback to notify applications when the datarate has changed.
This allows applications to know when payload sizes have changed without
needing to call `lorawan_get_payload_sizes` before each transmission.
This also enables:
* Monitoring of network conditions on the device
* Determining if a network connection has been lost
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Add a function to query the minimum possible datarate on the network.
This value may change over the lifetime of the connection as a result
of commands from the network server.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Add the ability for applications to query the maximum size of packets
that can be sent. This must be dynamically queried as the sizes change
with datarate, region, and as MAC commands are added by the stack.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Provide the LoRaWAN stack with an optional callback to be
called whenever the battery level needs to be read.
In the case of callback not being provided, the LoRaWAN
stack will report 255 (battery level unavailable) as per
the LoRaWAN spec.
Signed-off-by: Kuba Sanak <contact@kuba.fyi>