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

Questions related to UUID

I am developing a robot controller(Central, nRF51822).

However, I am having a problem with UUID.

And I am using the ble_central (s130 ble_app_uart) example.

The figure below shows the UUID information of the robot to be controlled.

But I don't know where to set it.

It is understood that the 16-bit uuid(service, tx, rx) is contained in the 13th and 14th bytes of the base uuid.

And when I used to control other robots, I simply changed the numbers in' ble_nus_c.h'. 

However, the robot to be controlled this time is of a different uuid format.

In this case, I am wondering where to change the settings.

  • Hi Shinyc, 

    Yes you need to either modify the NUS_BASE_UUID base and the BLE_UUID_NUS_SERVICE, BLE_UUID_NUS_RX_CHARACTERISTIC to match with your own UUID of the robot. Or declare your own base UUID and then use it in the central code. 

    It should be something like: 

    ROBOT_BASE_UUID  {{0x01,0x67,0x13 ....  ,0x5F, 0x00,0x00, 0x03, 0x89}}

    And the Service UUID will be: 0x13bc and characteristic will be something else (in your screen shot the characteristic and the service have the same UUID which is wrong) 

  • Hi Hung Bui,

    Thank you for the reply.

    You don't seem to understand my question. (Or maybe it's something I didn't understand....)

    The screenshot below(nRF Connect App) and UUID is the information of the robot I want to control.

    -Unknown Servie UUID :             8903136C-5F13-4548-A885-C58779136701

    -Unknown Characteristic UUID : 8903136C-5F13-4548-A885-C58779136702

    -Unknown Characteristic UUID : 8903136C-5F13-4548-A885-C58779136703

    (As you can see, only the first BYTE value is different.)

    -----------------------------------------------------------------------------------------------------------

    And when analyzed with wireshark, the following results were obtained.

    1) The screenshot above is when controlling the LED of the robot. 

    And the following UUID is used.

    -service UUID : 8903136C-5F13-4548-A885-C58779136701

    -UUID :              8903136C-5F13-4548-A885-C58779136703

     

    2) The screenshot above is when controlling the Motor of the robot. 

    And the following UUID is used.

    -service UUID : 8903136C-5F13-4548-A885-C58779136701

    -UUID :              8903136C-5F13-4548-A885-C58779136702

    (If I try to control the motor and use the UUID required for LED control, I cannot control the motor.)

    ----------------------------------------------------------------------------------------------------------------------------------

    I want to control this robot using a controller (Central).

    However, in the ble_central (s130, ble_app_uart) example, I can't figure out what to fix.

    Please tell me this part.

    Thank you very much.

  • Hi Shinyc, 

    Please study the ble_app_uart_c example. You need to get to know how the example uses NUS_BASE_UUID as the base UUID and combine with BLE_UUID_NUS_SERVICE and BLE_UUID_NUS_RX_CHARACTERISTIC and BLE_UUID_NUS_TX_CHARACTERISTIC to match with the UUID that you see in nRF Connect. 

    Please be aware that the service and characteristic of a profile usually share the same UUID base, and only byte 13 and 14 are different. In your case you have byte 01 are different. This meant that you don't have the same UUID base and it's wrong. You should have them share the same UUID base, and only byte 13 and 14 are different for service and characteristics UUID. 

Related