This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Android-nRF-Mesh-Library: How to consume/invalidate a unicast address?

Dear Nordic Bluetooth experts,

In the Android-nRF-Mesh-Library, is there a way to mark a unicast address as used? The reason why I'd like to do it is the following:
 
When adding a new node, my Bluetooth mesh app performs the these steps:

  1. Provisions the device.
  2. Connects to the new node.
  3. Assigns the net/app keys and unicast address.

Every now and than it happens that the connection to the new proxy node (step 2.) gets lost because of either "Error: (0x85): GATT ERROR" or "Error: (0x13): GATT CONN TERMINATE PEER USER". If that happens the app simply reconnects and restarts step 3. Sounds like the right thing to do, doesn't it? 

The problem is, that MeshNetwork.nextAvailableUnicastAddress() returns the same unicast address than before the disconnect/reconnect. Passing that address to BaseMeshNetwork.assignUnicastAddress() fails with:
W/System.err: java.lang.IllegalArgumentException: Unicast address is already in use.
 
Now the question is, how can you prevent nextAvailableUnicastAddress() from returning an address that assignUnicastAddress() rejects?
My first idea was to consume (or invalidate) an address if assginUnicastAddress() fails and then simply try again. Question is, how can it be done? Or is there a better way to fix this issue?
 
Any advise from an expert in that matter is very much appreciated.
Thank  you.
 

Parents
  • Hi

    Due to the summer vacation period we are currently understaffed, so delayed replies must be expected. I am sorry about any inconvenience this might cause. I'm currently waiting for an answer internally on this bug you have reported and it's under investigation. Thank you for your patience. I will get back to you as soon as I have more information.

    Best regards,

    Simon

Reply
  • Hi

    Due to the summer vacation period we are currently understaffed, so delayed replies must be expected. I am sorry about any inconvenience this might cause. I'm currently waiting for an answer internally on this bug you have reported and it's under investigation. Thank you for your patience. I will get back to you as soon as I have more information.

    Best regards,

    Simon

Children
Related