This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem with Notify (Custom and Standard Services)

Hi,

i took the example in AN36 (with the led but deleted the button stuff) and added the Battery Level service. Both are working fine together. On top of that I took the battery service and coustomized it like shown in the files attached. I added this coustomized service twice to my project (first is called temperature and identical second one is called speed). The init of both looks like to following (just with diffrent names):

/**@brief Function for initializing Temperature Service.
 */
static void temperature_init(void)
{
    uint32_t       err_code;
    ble_temperature_init_t temperature_init;

    memset(&temperature_init, 0, sizeof(temperature_init));

    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&temperature_init.temperature_attr_md.cccd_write_perm);
    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&temperature_init.temperature_attr_md.read_perm);
    BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS(&temperature_init.temperature_attr_md.write_perm);

    temperature_init.evt_handler          = NULL;
    temperature_init.support_notification = true;

    err_code = ble_temperature_init(&m_temperature, &temperature_init);
    APP_ERROR_CHECK(err_code);
}

And the services are init like following:

/**@brief Function for initializing services that will be used by the application.
 */
static void services_init(void)
{
		speed_init();
		temperature_init();
		bas_init();
		lbs_init();
}

The UUIDs of both are different ofcourse. So when I use for example the iOS App like LightBlue but notify works only for the temperature service not for speed. Can someone help me with this issue? Does it have something with the copied services to do? Or is there a limitation on services with notification?

(BTW: bas notify also works fine)

ble_temperature.c

ble_temperature.h

Related