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

receive data bigger than 20 bytes on nrf8001

Hi,

I have a few questions on how to receive data (from an iPhone app) as a a peripheral device on nrf8001 (with RedBearLab BLE shield).

Basically I am trying to receive data on an Rx pipe. From my understanding, the api receives data through the 'ACI_EVT_DATA_RECEIVED' event. When data comes from the iPhone in question, it would be stored in 'params.data_received.rx_data.aci_data' array and the array size is stored in 'len' field. From the nRF8001 documentation v 1.2, I see that the maximum data size is 20 bytes. On the other hand from the app developer I was told that (at least in iOS BLE library) when central sends data to peripheral there is no limit on data payload per packet...so I'd like to ask:

  1. is it true that per data received event on nRF8001, only 20 bytes of data can be received?

  2. if 1) is true, if the data to be received is larger than 20 bytes (say 200 bytes), how should I manage receiving with the nRF8001 SDK? iPhone would send data at undetermined intervals to nRF8001, and I would preferably receive the entire data, and upon knowing that I have received the entire data move on to process it. So in other words, if the 'data received event' only takes in 20 bytes of data each time, how can I know that this current data received event is the last of this sequence?

Thank you for taking a look at this post!

Parents
  • Hi,

    I got this problem figured out (with help from a previous post here). Basically on the iOS side, you can call a write function and it does not limit your packet size. Apparently the receive function can take care everything. While this works between iOS devices, it cannot work this way with the nRF8001. You need to set the characteristic to RX_ACK_AUTO and the iOS device has to send you in packets of 20 bytes and waits for acknowledgement to send the next packet.

Reply
  • Hi,

    I got this problem figured out (with help from a previous post here). Basically on the iOS side, you can call a write function and it does not limit your packet size. Apparently the receive function can take care everything. While this works between iOS devices, it cannot work this way with the nRF8001. You need to set the characteristic to RX_ACK_AUTO and the iOS device has to send you in packets of 20 bytes and waits for acknowledgement to send the next packet.

Children
No Data
Related