mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-22 15:39:01 +00:00
lorawan: increment devnonce don't just create a new one each join attempt
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
@@ -33,8 +33,8 @@ func (o *Otaa) generateDevNonce() {
|
|||||||
|
|
||||||
func (o *Otaa) incrementDevNonce() {
|
func (o *Otaa) incrementDevNonce() {
|
||||||
nonce := uint16(o.devNonce[1])<<8 | uint16(o.devNonce[0]) + 1
|
nonce := uint16(o.devNonce[1])<<8 | uint16(o.devNonce[0]) + 1
|
||||||
o.devNonce[0] = uint8(nonce & 0xff)
|
o.devNonce[0] = uint8(nonce)
|
||||||
o.devNonce[1] = uint8((nonce >> 8) & 0xff)
|
o.devNonce[1] = uint8((nonce >> 8))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set configures the Otaa AppEUI, DevEUI, AppKey for the device
|
// Set configures the Otaa AppEUI, DevEUI, AppKey for the device
|
||||||
|
|||||||
Reference in New Issue
Block a user