Is there an easy way to change LOGGER_TX_SERVICE_UUID & LOGGER_RX_SERVICE_UUID to use the primary NUS for logging?

Hi ,

I wanna keep my existing mobile application which talks to nRF5340 over the BLE NUS service. I am using the default  BT_UUID_NUS_VAL as my primary mode of communication, with a custom byte protocol over it. 

Now I want to add BLE Logging as a backend, and the issue is LOGGER_BACKEND_BLE_ADV_UUID_DATA is the same as BT_UUID_NUS_VAL . 

I am wondering what is the easy way to change the BLE Logging backend ADV_UUID and SERVICE_UUID's, as they overlap with NUS service. 

And can I just change them by one letter to create my own? For example 

#define NUS_SERVICE_UUID \
BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0x6E400001, 0xB5A3, 0xF393, 0xE0A9, 0xE50E24DCCA9E))

#define LOGGER_TX_SERVICE_UUID \
BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0x6E400003, 0xB5A3, 0xF393, 0xE0A9, 0xE50E24DCCA9E))

#define LOGGER_RX_SERVICE_UUID \
BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0x6E400002, 0xB5A3, 0xF393, 0xE0A9, 0xE50E24DCCA9E))



Chnages to 

#define NUS_SERVICE_UUID \
BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0x6E400004, 0xB5A3, 0xF393, 0xE0A9, 0xE50E24DCCA9E))

#define LOGGER_TX_SERVICE_UUID \
BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0x6E400005, 0xB5A3, 0xF393, 0xE0A9, 0xE50E24DCCA9E))

#define LOGGER_RX_SERVICE_UUID \
BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0x6E400006, 0xB5A3, 0xF393, 0xE0A9, 0xE50E24DCCA9E))

 

Would this work? I am assuming I can make a copy  of the log_backend_ble.c & log_backend_ble.h, and use my own? Would that be the recommended way to keep logs seperate from the Application NUS. 

  • Hello,

    I have not seen this LOGGER_TX/RX_SERVICE_UUID before, but I see that it is the same as the NUS service.

    You can try, and see what happens. Is it an issue that they are the same? (something may fail, but I have not tested. It is probably intended to be used with Nordic devices, or else it wouldn't use "our" UUID).

    If you want to separate it completely from the NUS, I would change some other part of the UUID. The byte that you change is the "characteristic-part" of the UUID, meaning it will still be seen as part of the same service, but a new characteristic under that service. But if you change e.g. the 0x6E to 0x6F, it would be seen as a completely new service. (and in that case, you might as well create your own UUID, e.g. using an online UUID generator) But I don't know how you want it to behave.

    Please note that I (and most of my colleagues) will be out of office until the beginning of January. Please expect some delayed response during this period. I am sorry for the inconvenience.

    Best regards,

    Edvin

Related