NordicSemiconductor / Android-nRF-Mesh-Library

The Bluetooth Mesh Provisioner and Configurator library.
https://www.nordicsemi.com/
BSD 3-Clause "New" or "Revised" License
414 stars 177 forks source link

Fix of by one error #549

Closed Rawa closed 1 year ago

Rawa commented 1 year ago

Importing a json with a transmission count of 8 is broken and throws an error.

https://github.com/NordicSemiconductor/Android-nRF-Mesh-Library/blob/9adcaeb3ac0e19b4b69068f5d78676594a0919a0/mesh/src/main/java/no/nordicsemi/android/mesh/utils/NetworkTransmitSettings.java#L14-L15

The values checked in the if statement was 0-7, and not 1-8 as by the text. This mean that the NodeDeserializer will fail if the value of the count is 8.

See deserializer:

https://github.com/NordicSemiconductor/Android-nRF-Mesh-Library/blob/main/mesh/src/main/java/no/nordicsemi/android/mesh/transport/NodeDeserializer.java#L111

philips77 commented 1 year ago

Thank you for the PR!