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

Error while configuring cccd metadata, in ble-characteristics-a-beginners-tutorial

I'm using nRF52840 with SDK15.0.0

Following this tutorial : https://devzone.nordicsemi.com/tutorials/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial

AT STEP 2.H my module is Advertising i can connect and then see the service and its characteristics write and read with nRF connect app.

Then at  next  step :STEP 3.A, i add : 

		BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cccd_md.read_perm);
		BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cccd_md.write_perm);
		cccd_md.vloc                = BLE_GATTS_VLOC_STACK;
		char_md.p_cccd_md           = &cccd_md;
		char_md.char_props.notify   = 1;

Here is problem : there is err_code 0x07 in return from sd_ble_gatts_characteristic_add, and no more advertising.

if i comment APP_ERROR_CHECK where err_code = 0x07, i can see my module advertising but i don't see the service and its characteritics

I tryed to use solutions file, but i get same problem...

Parents Reply
  • Changing the values of the #defines is a Really Bad Idea !!

    Open mouth

    Because, when you do that, the name of the #define becomes a lie!

    If you want to be able to quickly change the setting throughout your code, then do something like

    #define MY_BLE_GATTS_VLOCK  BLE_GATTS_VLOC_STACK

    and only use the MY_BLE_GATTS_VLOC in you code.

    This is standard software engineering good practice - nothing specifically to do with Nordic.

Children
Related