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

How to switch UUID at Android apps

Hi

I now is developing Android apps on the basis of NRF UART v2.0. My s110 NRF51 device will switch two modes for differnet 128-bit UUID. These two modes have independent service and TX/RX characteristcis.Except UUID base, the operation of these two are same.

Mode A Service: 6E400001-B5A3-F393-E0A9-E50E55534243 TX characteristic: 6E400002-B5A3-F393-E0A9-E50E55534243 RX characteristic: 6E400003-B5A3-F393-E0A9-E50E55534243 Mode B Service: 6E400001-B5A3-F393-E0A9-E50E55535253 TX characteristic: 6E400002-B5A3-F393-E0A9-E50E55535253 RX characteristic: 6E400003-B5A3-F393-E0A9-E50E55535253

My apps connected NRF51 at mode A. It can work normally. Then, I switch NRF51 to mode B. I found apps cannot change to connect NRF51 at mode B which has different UUID base.

At my apps code, I really switch to the UUID at mode B. However, it seems apps will be stuck at UUID of mode A. Would you have any comment or solution about it? Thanks.

Parents
  • I assume you are resetting your device and changing the services in the Attribute Table when changing modes.

    Allthough you are switching between two modes, the Bluetooth address remains the same and the Android phone will therefore treat it as the same device with the same services and characteritics as before and not perform a new Service Discovery unless the peripheral indicates that its services has changed.

    You can do this by calling sd_ble_gatts_service_changed() after connecting to indicate that the Attribute table has changed and that the peer should perform a Service Discovery.

    -Bjørn

Reply
  • I assume you are resetting your device and changing the services in the Attribute Table when changing modes.

    Allthough you are switching between two modes, the Bluetooth address remains the same and the Android phone will therefore treat it as the same device with the same services and characteritics as before and not perform a new Service Discovery unless the peripheral indicates that its services has changed.

    You can do this by calling sd_ble_gatts_service_changed() after connecting to indicate that the Attribute table has changed and that the peer should perform a Service Discovery.

    -Bjørn

Children
No Data
Related