Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

why it doesn't allow me modify the uuid in ble characteristic tutorial to battery service and battery level uuid ?

Dear Nordic Team,

I have practiced the " ble-characteristics-a-beginners-tutorial" on DK board PCA10028, and it worked perfectly.  Then I tried to change the user defined UUIDs by replace the base UUID to Battery service base UUID, and the 16-bit characteristic UUID to 16-bit battery level UUID, hoping that I could see Battery service with a battery level characteristic on my Android App. But  it doesn't work. The board seems frozen.

Could you tell me why it doesn't work?

Here are the only original statements for UUID.

// FROM_SERVICE_TUTORIAL: Defining 16-bit service and 128-bit base UUIDs
#define BLE_UUID_OUR_BASE_UUID {{0x23, 0xD1, 0x13, 0xEF, 0x5F, 0x78, 0x23, 0x15, 0xDE, 0xEF, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00}} // 128-bit base UUID
#define BLE_UUID_OUR_SERVICE_UUID 0xF00D // Just a random, but recognizable value
//ALREADY_DONE_FOR_YOU: Defining 16-bit characteristic UUID
#define BLE_UUID_OUR_CHARACTERISTC_UUID 0xBEEF // Just a random, but recognizable value

Here are the new statements for UUID, which causing problem.  Nothing else changed.

//following is battery service uuid
#define BLE_UUID_OUR_BASE_UUID {{0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0x0f, 0x18, 0x00, 0x00}} /**< battery service UUID. */
#define BLE_UUID_OUR_SERVICE_UUID 0x180f
#define BLE_UUID_OUR_CHARACTERISTC_UUID 0x2A19 /*battery level*/

Thanks,

Jacky

Parents
  • What if you keep the same base UUID as in the first part & only change the 16-bit Bluetooth SIG service UUID?

    #define BLE_UUID_OUR_BASE_UUID {{0x23, 0xD1, 0x13, 0xEF, 0x5F, 0x78, 0x23, 0x15, 0xDE, 0xEF, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00}}

     

  • Hi Bjorn,

    Thanks for your message. I guess I didn't clarify my purpose. My purpose is to send a byte array of 58 bytes using Battery Level characteristic notification at 100Hz rate.  

    If I keep the base UUID, the App on cell phone won't recognize it because the App expects the Battery level characteristic under Battery service. So I have to use the UUIDs for battery service and battery characteristic. I tried to modify the ble-nus example, replaced the nus's UUIDs with the Battery service/batter level's UUIDs, but the code fail to work at the sd_ble_gatts_characteristic_add().

    I guess the problem is that by the definition of Bluetooth.org, the battery level characteristic is a 8-bit value and SDK performed certain validity check for this kind of UUIDs.  If possible, could you try it on your side and give me an solution?

    Thank you,

  • Have you taken a look at this custom service tutorial too? Could be helpful in addition to the characteristics tutorial you took a look at. If you are using a different sdk version, the tutorial should be updated for most sdk versions, so just choose another version.

    I believe you have misunderstood what I was trying to say: what if you keep the same 128 bit base UUID & use the battery service & characteristic Bluetooth SIG UUIDs?

Reply Children
Related