Creating two notification characteristics between nrf52840 and Android

Hello, 

I am trying to create two notification characteristics between the nRF52840 and Android app. Though I am able to enable notifications for both the characteristics, I am able to see the value just in one characteristics. 

Could you please help me? 

BT_GATT_SERVICE_DEFINE(stsensor_svc,
BT_GATT_PRIMARY_SERVICE(&st_service_uuid),
BT_GATT_CHARACTERISTIC(&config_notif_uuid.uuid, BT_GATT_CHRC_NOTIFY | BT_GATT_CHRC_WRITE | BT_GATT_CHRC_READ ,
               BT_GATT_PERM_READ, recv, NULL, NULL),
BT_GATT_CCC(mpu_ccc_cfg_changed, BT_GATT_PERM_NONE | BT_GATT_PERM_READ | BT_GATT_PERM_WRITE),
BT_GATT_CHARACTERISTIC(&sensor_char_uuid.uuid, BT_GATT_CHRC_NOTIFY ,
               BT_GATT_PERM_READ, NULL, NULL, &dataTest),
BT_GATT_CCC(mpu_ccc_cfg_changed, BT_GATT_PERM_NONE | BT_GATT_PERM_READ | BT_GATT_PERM_WRITE),
//BT_GATT_CCC(mpu_ccc_cfg_changed, BT_GATT_PERM_READ | BT_GATT_PERM_WRITE),
);
Parents
  • Hi Sanju,

    I looked at your code and there is nothing obviously wrong in the definition of the service.

    I tried to place your service definition into the peripheral ESP sample, make some adjustment to use the existing UUID and callback instead. It works.

    You probably want to check how bt_gatt_notify() is called in your application.

    Hieu

Reply
  • Hi Sanju,

    I looked at your code and there is nothing obviously wrong in the definition of the service.

    I tried to place your service definition into the peripheral ESP sample, make some adjustment to use the existing UUID and callback instead. It works.

    You probably want to check how bt_gatt_notify() is called in your application.

    Hieu

Children
No Data
Related