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

some BLE releated questions

Hello,

currently I try to implement a GATT server on a nrf51422 with the s310 Softdevice. For testing I use the LightBlue IOS client on an ipad. I can see my GATT server but LightBlue tells me that the peripheral has "No Services". I've implemented one attribute and I can see the attribute and the initial value of the attribute.

I've used sd_ble_gatts_service_add() to add a service and used sd_ble_gatts_characteristic_add() to add an characteristic to that first and only service. What could be the reason for the service to no beeing visible?

I've tried to add a descriptive text to the charateristic by using sd_ble_gatts_descriptor_add() function right after I've used sd_ble_gatts_characteristic_add(). I used BLE_GATT_HANDLE_INVALID as the handle and filled the ble_gatts_attr_t to point to a char array with some text. But I can't find the description in the GATT client and the function doesn't return an error. Any idea what could be wrong here?

The sd_ble_gatts_characteristic_add() function returns 4 handles (ble_gatts_char_handles_t). Under which curcumstances is more than the first (value_handle) filled?

thanks for any help, comments and pointers and kind regards, Torsten

  • I'm not sure what the reason could be, but I recommend you to start of with one of the examples from the SDK that you know is working.

    A GATT server shall contain a GAP service, see Vol 3, Part G, Section 12 in the Bluetooth Core Specification v4.2.

    And a GATT Service, see Vol 3, Part G, Section 7.

    You can see this by commenting out the following three lines from ble_app_hrs:

    //services_init();
    
    //ble_hrs_on_ble_evt(&m_hrs, p_ble_evt);
    //ble_bas_on_ble_evt(&m_bas, p_ble_evt);
    

    Then you should get two services when you do service discovery, Generic Access 0x1800 and Generic Attribute 0x1801.

Related