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

Central Multilink: how to add custom characteristic uuid?

Hi,

I'm using Central multilink example to connect with our Custom Peripheral sensors.
I'm using board PCA10040, nRF52832, SDK_14.2.0, s132.

Sensors have a custom service (UUID 128 bit) with 4 custom characteristics (UUID 128 bit) and I know all these UUID of service and characteristics.

From the Central multilink example I used the function "ble_lbs_c_init" where I modified it to set our SERVICE_UUIDBASE of the custom service of the sensor.
In this case, Do I need to add something else regarding the 4 custom characteristics?

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
uint32_t ble_lbs_c_init(ble_lbs_c_t * p_ble_lbs_c, ble_lbs_c_init_t * p_ble_lbs_c_init)
{
uint32_t err_code;
ble_uuid_t lbs_uuid;
ble_uuid128_t lbs_base_uuid = {LBS_UUID_BASE};
VERIFY_PARAM_NOT_NULL(p_ble_lbs_c);
VERIFY_PARAM_NOT_NULL(p_ble_lbs_c_init);
VERIFY_PARAM_NOT_NULL(p_ble_lbs_c_init->evt_handler);
p_ble_lbs_c->peer_lbs_db.button_cccd_handle = BLE_GATT_HANDLE_INVALID;
p_ble_lbs_c->peer_lbs_db.button_handle = BLE_GATT_HANDLE_INVALID;
p_ble_lbs_c->peer_lbs_db.led_handle = BLE_GATT_HANDLE_INVALID;
p_ble_lbs_c->conn_handle = BLE_CONN_HANDLE_INVALID;
p_ble_lbs_c->evt_handler = p_ble_lbs_c_init->evt_handler;
err_code = sd_ble_uuid_vs_add(&lbs_base_uuid, &p_ble_lbs_c->uuid_type);
if (err_code != NRF_SUCCESS)
{
return err_code;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Because I'm able to connect with sensors but when I receive the event BLE_DB_DISCOVERY_COMPLETE (function ble_lbs_on_db_disc_evt), I don't read the uuid of the 4 custom characteristics but I read characteristic.uuid.uuid = 0x00.

Please could someone help me please?

  • Hi Gandalf,

    Custom services and characteristics can be difficult to understand and work with. I think everything you need to solve your question is answered in the Custom Service Tutorial. Let me know if you can't figure it out after reading the tutorial and I will take a closer look.

    Ketil

  • Hi Ketil,

    thank you for your answer, but is this tutorial referred to peripheral side?
    I'm working side "multilink central" and I already have a working sensor to connect with.

    I need to discover the custom sensor profile but I only get characteristic.uuid.uuid = 0x00 when I receive the event BLE_DB_DISCOVERY_COMPLETE.

    The custom sensor profile consist of 1 custom service at128bits and "4 custom characteristics at 128bits". Each characteristic has different uuid at 128bits even from custom service uuid at 128bit.

    Do I need to add something else regarding the 4 custom characteristics at 128 bits inside ble_lbs_c_init or somewhere else?

    Thank you in advance.

    Best regards

  • Hi,

    My bad. I will need to look further into this. Will let you know once I figure it out.

    Ketil

     

  • Hi again,

    Have you added the UUIDs for your characteristics in ble_lbs_on_db_disc_evt? If not the central will look for the UUIDs of the Blinky LED and Button characteristics. 

    Ketil

  • Hi,

    yes I modified ble_lbs_on_db_disc_evt it but the problem is I'm reading characteristic.uuid.uuid = 0x00 and characteristic.uuid.type = 0x00  when I receive the event BLE_DB_DISCOVERY_COMPLETE. This is probably because I didn't set the configuration properly  of the 4 UUIDs at 128bits of characteristics.

    Do I need to use the sd_ble_uuid_vs_add to add the 4 UUIDs at 128bits characteristics? If yes, how should I do it?
    Thank you in advance.

1 2