Modified nRF52 SDK Nordic UART GATT Attributes

Hello.

I am building a solution on nRF52820 based on the ble_nus service, starting form the uart example. 

The solution I am building is a GAP peripheral and a GATT server.

I have modified the base UUID.

The result is that the this new UUID is advertised as a service.

However, when connecting to the device, the discovered GATT services and attributes are still the unmodified uart service with UUID 6E400001-B5A3-F393-E0A9-E50E24DCCA9E.

Could you please indicate where I can change this UUID to the modified one?

Thanks!

Jan

Parents
  • Hi Jan,

    Are you using the nRF5 SDK or the nRF Connect SDK? And how did you do the changes?

    Generally, the list of UUIDs in the advertising packet and in the GATT server are completely independent, but it normally makes sense to use the same defines for the UUIDs, and just change a single place. It does not sound like that is the case in your code, though (as you see a difference). Perhaps you can elaborate on what you did?

    Another explanation could be caching in the peer device, and if that is the case, disabling/re-enabling bluetooth and/or connecting to the device might solve the issue. Or you could verify with something like nRF Connect for Desktop, which does not do caching.

  • I am using nRF5 SDK V17.1

    Could you please indicate where in the code the GATT service parameters are defined? 

    I have modified the attributes:

    #define BLE_UUID_HS_TX_CHARACTERISTIC 0x4302 /**< The UUID of the TX Characteristic. */
    #define BLE_UUID_HS_RX_CHARACTERISTIC 0x4303 /**< The UUID of the RX Characteristic. */

    And the base UUID:

    #define HS_BASE_UUID                  {{0xDE, 0xBC, 0x5A, 0x04, 0x11, 0xB0, 0x40, 0x31, 0x50, 0x25, 0xDA, 0xFE, 0x01, 0x43, 0x6F, 0x72}}

    And the service UUID:

    #define BLE_UUID_HS_SERVICE 0x4301

    But the softdevice seems not happy with that....

    I also do not want this service to be advertised, but only discovered after a connection has been made. I do not find the parameter to modify to get this behavior.

  • Hi,

    janvb said:
    I also do not want this service to be advertised, but only discovered after a connection has been made. I do not find the parameter to modify to get this behavior.

    Refering to the ble_app_uart sample you can see that the service UUIDs in the scan response packet is part of the m_adv_uuids, and you can see how it is added to the advertising packet in advertising_init(). If you don't want to advertise any UUIDs, simply remove the m_adv_uuids instance, and remove the two linse which includes includes this in the scan response packet in advertising_init() (same thing if it had been in the advertising packet).

    janvb said:

    And the service UUID:

    #define BLE_UUID_HS_SERVICE 0x4301

    But the softdevice seems not happy with that....

    I do not see enough of how you did things here. How did you add this new base UUID? Please show in detail, for instance with a diff form the example or simply the full application if that is easier. Also, how did the SoftDevice not seem happy with it (which error code did you get from where)?

Reply
  • Hi,

    janvb said:
    I also do not want this service to be advertised, but only discovered after a connection has been made. I do not find the parameter to modify to get this behavior.

    Refering to the ble_app_uart sample you can see that the service UUIDs in the scan response packet is part of the m_adv_uuids, and you can see how it is added to the advertising packet in advertising_init(). If you don't want to advertise any UUIDs, simply remove the m_adv_uuids instance, and remove the two linse which includes includes this in the scan response packet in advertising_init() (same thing if it had been in the advertising packet).

    janvb said:

    And the service UUID:

    #define BLE_UUID_HS_SERVICE 0x4301

    But the softdevice seems not happy with that....

    I do not see enough of how you did things here. How did you add this new base UUID? Please show in detail, for instance with a diff form the example or simply the full application if that is easier. Also, how did the SoftDevice not seem happy with it (which error code did you get from where)?

Children
No Data
Related