AFTER SUBSCRIBE AN INDICATE SEVICES THE DATA POINTER IS NULL

There is a BLE server that has a service is indicate and write. I am developing a BLE client. This client subscribes that service and writes 5 byte data. After the writing proccess done, service indicates 5 bytes responce. But after that immediatly idnicates 0 Length data. That means my device unsubscribed the service. After that client disconnect from server and the reason is timeout (0x08). When i try the same proccess on NRF CONNECT MOBILE everything is fine. What is the difference ?  

  • You need to reach out for the ones who created the peripheral (server) and ask what causes the disconnects. If that is another company, it is difficult to say what sort of rules they have set. It can be anything from predefined Bluetooth addresses, to certain specific commands that needs to be sent.

    You can try to capture a sniffer trace from a connection that is working, and compare it to a sniffer trace from a connection that is not working, and compare the two. You can use the nRF Sniffer for Bluetooth LE.

    FurkanCELIK said:
    If i dont subscribe that service and send a 5 bytes data in like 5 seconds the server device disconnects from my device. I subscribe that service, and send the data. My data is correct. I can subscribe the service. But it still disconnects.

    So it disconnects either way?

    What device is your peripheral? Is it running on an nRF5x DK? A custom board? Or is it a 3rd party product?

  • It is a 3rd party product. Infact in my focus, what is the difference between nrfconnect mobile and nrfconnect sdk. Because my steps are the same. I subscribe the service and send the data. 

  • I don't know. Did you ever connect via that same mobile phone before using the 3rd party app? Perhaps that does something special, and then the peripheral has bonded with the phone, so it is in a whitelist. Does it work if you try another phone that has never been connected to that device?

    Does the phone ask you to pair or bond (the first time you connect with it)?

    What if you enter your phone's settings -> Bluetooth, and then "forget/remove device"? Is it listed at all? Can you still connect to it with nRF Connect for mobile without pairing/bonding?

    This is just speculations from the top of my head of ways they could want you to only use their app to connect to the device. If you want a certain answer, you need to reach out to the developers of the product, and ask them what their requirements are.

    BR,

    Edvin

Related