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

Configurable UUID

Hello,

I want to change the 16-bit of 128-bit UUID at runtime. is this possible?

let me explain...

1)the first both central and peripheral set 128-bit UUID like this....

6e400000-b5a3-f393-e0a9-e50e24dcca9e

  1. now after connection the central send 16-bit service UUID to peripheral this will overwrite too 0x0000 number and disconnect from central and than after advertise with newer one service UUID like this..

6e400004-b5a3-f393-e0a9-e50e24dcca9e

is this possible?

please correct me if i m wrong..

thank you..

  • The only way how to change GATT Server objects with Nordic Soft Device is to "restart" it (typically softreset of the chip is faster way). UUIDs are assumed to be static identifiers.

  • is there any chance to configure the UUID which i describe as in Question?

    the actual case is like this...

    there are ten BLE enabled board which are advertise. we give...10 different the serial number so that in central we have a choice to select any one of them Using Different UUID.

  • UUID shouldn't be identifier of particular device but it should be class of devices (= providers of specific kind of service). Devices are identified by MAC and if you don't want or cannot use it then you should define your own proprietary identifier (and place it to your APP data e.g. in Manufacturer Specific AD element of ADV/SCAN_RSP data). But back to the technical side of your proposed solution: Nordic (G)ATT Server API supports only adding Services/Characteristics not hiding or deleting so I'm afraid you will either need to go with different stack (Zephyr might be good choice because if it doesn't support this you may implement it yourself) or change your solution or try to get some more help from Nordic (maybe they have such feature in a back log but I don't see any indication of that from outside).

  • But "standard" way how to implement this with current Nordic SD would be:

    1. Let some default UUID (saying "I'm unpersonalized device of yours").
    2. Once master connects and is allowed to modify/personalize it assigns new UUID.
    3. Devices must disconnect. GATT Server saves new configuration and reboots.
    4. As soon as GAP Peripheral/GATT Server boots it uses new UUID to populate GATT Server differently then before and it's ready to be used as you intended.

    If you are fine with that disconnection you have your solution. Otherwise go with different BLE stack.

  • I do this same thing....let me explain......my code flow as following.....

    1. UART Setup();
    2. BLE_INIT();
    3. BLE_ADVERTISE();

    from Central send new UUID to peripheral. after receiving the new UUID .....

    call sd_ble_gap_disconnect() function. and again i restart the advertising..

    1. BLE_INIT();
    2. BLE_ADVERTISE();

    is this correct way?

    please correct me if i m wrong...

    Thank You.

Related