How to enable multiple BLE notification and indicate in central side

I am able to subscribe for differen

t notify and indicate function .But i didnt get the data in notify and indicate function. i am add the code and log files

Parents
  • Hi Goudam, 

    Could you try to capture a sniffer trace ? We would need to verify if the characteristic CCCD attribute has been written or not. 
    I would suggest to test with one single characteristic first before moving to multiple ones. 

    Have you made sure the peripheral actually try to send notification ? 

    Have you tried to test with the peripheral_uart and the central_uart ? Did they work for you ? 

  • I did not use sniffer trace. However, in the NRF Connect app, I enabled the CCCD attribute, and it worked. How to Enable the CCCD attribute in Central

    I've already tried with single characteristics, but the problem is that I need to subscribe and write for all of the services in order to get data, so I tried to subscribe to all of them.

    I had already tried health rate measurement and it worked, so I continued in the same manner.

  • Hi Goudam, 

    If the device doesn't have any display or keyboard how did you pair with MITM protection with the phone ? 
    Note that if only level 2 needed (no MITM ) then you can pair with Just work. 

    I'm afraid that we can't really help you on this case as it's more about the behavior of a 3rd party device that we are not familiar with. 

    What I can suggest you is to test using a peripheral (dummy device) that mimic the 3rd party device. So that you verify you can do all the task of connecting, service discovery, enable CCCD and can receive notification (from the dummy device) only after that you can start testing with the 3rd party device. You can then compare the trace between the dummy device and your central, vs the trace between the 3rd party device and your central. 

  • Hi Hung,

    On the vendor side, they mentioned that I should switch the security from L1 to L2 in sequence to subscribe to the battery,alert,position,human temperature measurement service, and then I should switch the security from L2 to L1 in order to write current time and fever threshold service, but switching from L2 to L1 never occurs; it is always in L2.

  • Hi Goudam, 

    The Bluetooth pairing always aim at highest possible pairing method. In this case if you have a display or keyboard it will try to do encryption with L2. 
    But please clarify with me that you have a keyboard of display or static passkey with the sensor. You mentioned you didn't have that. Without keyboard/display/static passkey how did you do L2 ? 

    Usually it shouldn't be an issue when doing a higher security level on a characteristic require lower level of security. Meaning if you are at L2 you can write to a characteristic requires L1. 

  • We don't have a keyboard, monitor, or passkey. However, the vendor stated that the security should be changed from L2 to L1 for write to a characteristics. I tried the method listed below to set security; if security changes successfully, it calls the security changed function, but it does not indicate whether the security change was successful or unsuccessful. How do I set the passkey in L2?

    .

  • Is there another way to change the security level from high to low?

Reply Children
  • If you don't have any keyboard or display on the device there isn't a way to do L2. 
    Please ask the vendor how they do L2 without keyboard or display. 

    Please answer, when you use NRF Connect on the phone and you connect to the sensor, did everything work as expected ? 

  • We are checking with the vendor to see they are using Authentication with no MITM (ESP GATT AUTH REQ NO MITM) in esp, and  so, what level do I need to set to achieve the same level of security in our nordic.

  • Hi Goudam, 


    I think I made a mistake.  I just check the Bluetooth term again

    Level 1 L1 is open no encryption/pairing. 

    Level 2 L2 is encryption (pair) without authentication a.k.a Just work. 


    As far as I know if a characteristic is open, it should be able to write to it even if the link is encrypted (L2). 
    When the link is encrypted I don't think there is a way to switch back to open except for disconnecting. 

    So what you need to do is to write to the characteristic with L1 requirement first, then you pair and then write to the characteristic require L2. 

  • Hi HUNG ,

    Now I'm getting data from the sensor, but there's one problem: disconnecting and reconnecting the vendor device isn't working. When I try to subscribe, I get the error EALREADY.

  • Hi Goudam, 

    If the 2 devices are bonded and you reconnect, you don't have to subscribe to the characteristic again as the CCCD may have been restored. 

    Could you try in the code to call bt_gatt_resubscribe() instead of bt_gatt_subscribe()

    Please try capture a sniffer trace. It will save you and save us a lot of time.