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

Write command and Notification in the same channel

Dear Nordic Developers,

I'm trying to write some data to a slave and when the slave gets the write command sends back a notification. My problem is that I send the write command in one radio channel (for example channle 35) but I get the notification on the next radio channel (channel 3). Is it possible to get the notification on the same channel (channel 35)?

Bellow you can see the results from the wireshark.

3990 113.087487000 Master Slave ATT 34 Rcvd Write Command, Handle: 0x000e

3991 113.089248000 Slave Master LE LL 26 Empty PDU

3992 113.141960000 Master Slave LE LL 26 Empty PDU

3993 113.143982000 Slave Master ATT 34 Rcvd Handle Value Notification, Handle: 0x000b wireshark_trac_file.pcapng Lines 3990 and 3991 are using channel 35 and the other 2 lines (3992 and 3993) are using channel 3. Is it possible increase the time between the lines 3991 and 3990? Please have a look to a attached wireshark trace file.

Any advice would be highly appreciated.

Thanks, Gor

Parents
  • Gor,

    I'm actually a bit confused by this question. When you say channel did you mean characteristic? If that's the case then yes, you should be able to issue write commands from the gatt client and issue notifications from the gatts server over the same BLE characteristic, which is parsed out in code easily enough.

    If you meant literal 2.4GHz radio channel, then no, that's not possible. BLE by design uses an adaptive frequency hopping algorithm to help prevent radio collisions with other devices. This behavior cannot be shut down nor suppressed.

    If the question was targeted to the second case, is there any reason why you would want to use the same 2.4GHz channel continuously? There's pretty much no benefit to that as far as I can see.

    Finally, you asked if there's a way to increase the time between lines 3990 and 3991. In this case the answer is no, BLE is a communication scheme where both sides talk to each other at every "connection interval". Those two events listed happened during the same connection event, which means they occurred basically simultaneously (it's used to detect link loss and make sure both sides get to communicate instead of just one side constantly blocking the connection). Think of it like a full duplex connection, if that helps. You can however modify the link's connection interval so that each of these communication "pairs" happen at shorter or longer time periods.

    Nathan

  • As for the comment about thinking of it like connection pairs, yes that's a little misleading when you start talking about multiple packets per connection event, sorry about that. A more accurate thing for me to say would be that each side must speak at least once per connection interval, even it it's to report that it is just still there listening (empty PDU), and all packets sent during a single connection interval are basically simultaneous. Also, the comments on Jan's answer are correct regarding why the response from the slave didn't happen on line 3991. When the softdevice asserts to handle a connection event, the main application you create is completely held off. Therefore you don't have the ability to process the data that came down until after the event is over, so you can only buffer a response in time for the next connection interval.

Reply
  • As for the comment about thinking of it like connection pairs, yes that's a little misleading when you start talking about multiple packets per connection event, sorry about that. A more accurate thing for me to say would be that each side must speak at least once per connection interval, even it it's to report that it is just still there listening (empty PDU), and all packets sent during a single connection interval are basically simultaneous. Also, the comments on Jan's answer are correct regarding why the response from the slave didn't happen on line 3991. When the softdevice asserts to handle a connection event, the main application you create is completely held off. Therefore you don't have the ability to process the data that came down until after the event is over, so you can only buffer a response in time for the next connection interval.

Children
No Data
Related