QN908x How to maximize notification throughput?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

QN908x How to maximize notification throughput?

1,171 Views
joseraffucci
Contributor IV

I need to periodically send sensor data to a connected host. The data can be several kilobytes in size.  I have been using the GattServer_SendInstantValueNotification() function to send the data via the notification mechanism.   The only way I can get it to work reliably is to only send a maximum of gAttMaxNotifIndDataSize_d bytes in each frame and wait at least a full connection interval before sending the next frame.

This doesn't seem right as I should be able to cram more frames per connection interval, no?  What's the best way to send, say, 4k worth of data via notifications with a 20ms connection interval and a 247 byte MTU?  I've looked all over but can't find any way to sync up to the connection event or event find a callback to tell me that it's ok to queue up more data.

0 Kudos
Reply
4 Replies

947 Views
joseraffucci
Contributor IV

Quick update --

I finally realized that there were TWO versions of SDK 2.2!  I grabbed mine soon after it was released and it obviously got updated without bumping the minor rev.

The drivers, framework and LE stack and examples were updated and Estephania's answer is indeed correct.  I am able to push frames and rely on the return code from GattServer_SendInstantValueNotification() as expected.

Thanks!

0 Kudos
Reply

947 Views
estephania_mart
NXP TechSupport
NXP TechSupport

Hello, 

COuld you please check the ble_shell example available in the SDK ? I believe that will help you as a base/guide to increase the throughput you are looking for. 

Regards, 
Estephania

0 Kudos
Reply

947 Views
joseraffucci
Contributor IV

I don't think that hte ble_shell example addresses what I'm looking for.  The read/write mechanism is using characteristics in the database.

I want to know how to pack immediate (i.e., not in the database) notifications to maximize throughput.  For starters, it would be nice to know:

  1. What is the maximum allowed size of the array passed to GattServer_SendInstantValueNotification()?
  2. How does GattServer_SendInstantValueNotification break up the data to send with respect to the MTU size?
  3. How do I know when the notification has been sent out and the hardware is ready to send more data?
0 Kudos
Reply

947 Views
estephania_mart
NXP TechSupport
NXP TechSupport

Hello, 

Answering your questions : 

What is the maximum allowed size of the array passed to GattServer_SendInstantValueNotification()?

 The max size it's ATT_MTU-3

How does GattServer_SendInstantValueNotification break up the data to send with respect to the MTU size?

If the attribute it's bigger, the GATT  client must perform a read, for further information please check the spec Vol 3, Part F  3.4.7.1 Handle Value Notification

How do I know when the notification has been sent out and the hardware is ready to send more data?

The API adds to the queue in the controller, if it returns a gBleOverflow_c it means that the queue it's full and you need to wait.

Regards, 

Estephania

0 Kudos
Reply