Zephyr way of handling large data transfer over BLE


dhguja@gmail.com
 

Hello All,
          I have a question related to the one i asked last week. (https://lists.zephyrproject.org/pipermail/zephyr-users/2017-December/000915.html). But i will rephrase it and be more generic to what i am looking for now because that question was already answered and solution works too.

I have an Android client (BLE central) and zephyr OS based BLE device as peripheral (nRF device) transfer data over a custom profile. I am aware that in BLE we can transfer only 20 bytes at a time. And also there are possibilities to extend the data packet size or increase the ATT_MTU size based on negotiation. But for compatibility purposes, I will avoid using these techniques. I am also not using BLE mesh or nordic softdevice SDK.

In that case, what is the zephyr way of handling large data transfer over BLE.? Do we need to handle segmentation and reassembly in the application layer by our selves only ? or any callback events possible in case buffer is full during multi packet transmission so that we can handle this?.

I am searching if there is any solution similar to the accepted answer in this thread for nordic SDK: https://devzone.nordicsemi.com/question/1741/dealing-large-data-packets-through-ble/)

Any example or leads to this using zephyr is much appreciated. Thanks in advance.

Regards,
Dhananjay GJ


Carles Cufi
 

Hi there,

 

Provided the peer does not initiate a GATT MTU Exchange, which would be handled automatically by the Zephyr BLE stack, you can simply call bt_gatt_notify() in a loop and from a thread while modifying the contents of the attribute in each iteration. When GATT runs out of buffers the the bt_gatt_notify() call will block until more are available, so you do not need to wait for an event like when using the SoftDevice.

 

Regards,

 

Carles

 

From: zephyr-users-bounces@... [mailto:zephyr-users-bounces@...] On Behalf Of dhananjay gj
Sent: 28 December 2017 13:45
To: zephyr-users@...
Subject: [Zephyr-users] Zephyr way of handling large data transfer over BLE

 

Hello All,

          I have a question related to the one i asked last week. (https://lists.zephyrproject.org/pipermail/zephyr-users/2017-December/000915.html). But i will rephrase it and be more generic to what i am looking for now because that question was already answered and solution works too.

I have an Android client (BLE central) and zephyr OS based BLE device as peripheral (nRF device) transfer data over a custom profile. I am aware that in BLE we can transfer only 20 bytes at a time. And also there are possibilities to extend the data packet size or increase the ATT_MTU size based on negotiation. But for compatibility purposes, I will avoid using these techniques. I am also not using BLE mesh or nordic softdevice SDK.

In that case, what is the zephyr way of handling large data transfer over BLE.? Do we need to handle segmentation and reassembly in the application layer by our selves only ? or any callback events possible in case buffer is full during multi packet transmission so that we can handle this?.

 

I am searching if there is any solution similar to the accepted answer in this thread for nordic SDK: https://devzone.nordicsemi.com/question/1741/dealing-large-data-packets-through-ble/)

 

Any example or leads to this using zephyr is much appreciated. Thanks in advance.

 

Regards,

Dhananjay GJ


dhguja@gmail.com
 

Hello Carles,
            Many thanks for the information. Is this information is applicable to GATT indicate, write, read too?

Regards,
Dhananjay GJ

On Thu, Dec 28, 2017 at 2:50 PM, Cufi, Carles <Carles.Cufi@...> wrote:

Hi there,

 

Provided the peer does not initiate a GATT MTU Exchange, which would be handled automatically by the Zephyr BLE stack, you can simply call bt_gatt_notify() in a loop and from a thread while modifying the contents of the attribute in each iteration. When GATT runs out of buffers the the bt_gatt_notify() call will block until more are available, so you do not need to wait for an event like when using the SoftDevice.

 

Regards,

 

Carles

 

From: zephyr-users-bounces@lists.zephyrproject.org [mailto:zephyr-users-bounces@lists.zephyrproject.org] On Behalf Of dhananjay gj
Sent: 28 December 2017 13:45
To: zephyr-users@lists.zephyrproject.org
Subject: [Zephyr-users] Zephyr way of handling large data transfer over BLE

 

Hello All,

          I have a question related to the one i asked last week. (https://lists.zephyrproject.org/pipermail/zephyr-users/2017-December/000915.html). But i will rephrase it and be more generic to what i am looking for now because that question was already answered and solution works too.

I have an Android client (BLE central) and zephyr OS based BLE device as peripheral (nRF device) transfer data over a custom profile. I am aware that in BLE we can transfer only 20 bytes at a time. And also there are possibilities to extend the data packet size or increase the ATT_MTU size based on negotiation. But for compatibility purposes, I will avoid using these techniques. I am also not using BLE mesh or nordic softdevice SDK.

In that case, what is the zephyr way of handling large data transfer over BLE.? Do we need to handle segmentation and reassembly in the application layer by our selves only ? or any callback events possible in case buffer is full during multi packet transmission so that we can handle this?.

 

I am searching if there is any solution similar to the accepted answer in this thread for nordic SDK: https://devzone.nordicsemi.com/question/1741/dealing-large-data-packets-through-ble/)

 

Any example or leads to this using zephyr is much appreciated. Thanks in advance.

 

Regards,

Dhananjay GJ



Carles Cufi
 

Hi there,

 

Yes, should be applicable to all those since they all call bt_att_create_pdu() which will block if there’s no buffers available.

 

Regards,

 

Carles

 

 

From: dhananjay gj [mailto:dhguja@...]
Sent: 28 December 2017 15:06
To: Cufi, Carles <Carles.Cufi@...>; zephyr-users@...
Subject: Re: [Zephyr-users] Zephyr way of handling large data transfer over BLE

 

Hello Carles,

            Many thanks for the information. Is this information is applicable to GATT indicate, write, read too?

Regards,

Dhananjay GJ

 

On Thu, Dec 28, 2017 at 2:50 PM, Cufi, Carles <Carles.Cufi@...> wrote:

Hi there,

 

Provided the peer does not initiate a GATT MTU Exchange, which would be handled automatically by the Zephyr BLE stack, you can simply call bt_gatt_notify() in a loop and from a thread while modifying the contents of the attribute in each iteration. When GATT runs out of buffers the the bt_gatt_notify() call will block until more are available, so you do not need to wait for an event like when using the SoftDevice.

 

Regards,

 

Carles

 

From: zephyr-users-bounces@... [mailto:zephyr-users-bounces@...] On Behalf Of dhananjay gj
Sent: 28 December 2017 13:45
To: zephyr-users@...
Subject: [Zephyr-users] Zephyr way of handling large data transfer over BLE

 

Hello All,

          I have a question related to the one i asked last week. (https://lists.zephyrproject.org/pipermail/zephyr-users/2017-December/000915.html). But i will rephrase it and be more generic to what i am looking for now because that question was already answered and solution works too.

I have an Android client (BLE central) and zephyr OS based BLE device as peripheral (nRF device) transfer data over a custom profile. I am aware that in BLE we can transfer only 20 bytes at a time. And also there are possibilities to extend the data packet size or increase the ATT_MTU size based on negotiation. But for compatibility purposes, I will avoid using these techniques. I am also not using BLE mesh or nordic softdevice SDK.

In that case, what is the zephyr way of handling large data transfer over BLE.? Do we need to handle segmentation and reassembly in the application layer by our selves only ? or any callback events possible in case buffer is full during multi packet transmission so that we can handle this?.

 

I am searching if there is any solution similar to the accepted answer in this thread for nordic SDK: https://devzone.nordicsemi.com/question/1741/dealing-large-data-packets-through-ble/)

 

Any example or leads to this using zephyr is much appreciated. Thanks in advance.

 

Regards,

Dhananjay GJ

 


dhguja@gmail.com
 

Hello Carles,
           Many thanks for the reply. One final question, Is there an example in zephyr samples that handles transmitting large data?
or any profile supported in zephyr that i can use to circumvent this application level segmentation.

The intention of this question is coming from the fact that L2CAP layer handles segmentation to some extent (limited by memory available) and we are using GATT for custom profiles.
Is there is any standard BLE profile supported in zephyr we can directly use for this purpose. My apologies for this rooky question, i am new to BLE.

Thanks for the support.

Regards,
Dhananjay G J

On Thu, Dec 28, 2017 at 3:10 PM, Cufi, Carles <Carles.Cufi@...> wrote:

Hi there,

 

Yes, should be applicable to all those since they all call bt_att_create_pdu() which will block if there’s no buffers available.

 

Regards,

 

Carles

 

 

From: dhananjay gj [mailto:dhguja@...]
Sent: 28 December 2017 15:06
To: Cufi, Carles <Carles.Cufi@...>; zephyr-users@lists.zephyrproject.org
Subject: Re: [Zephyr-users] Zephyr way of handling large data transfer over BLE

 

Hello Carles,

            Many thanks for the information. Is this information is applicable to GATT indicate, write, read too?

Regards,

Dhananjay GJ

 

On Thu, Dec 28, 2017 at 2:50 PM, Cufi, Carles <Carles.Cufi@...> wrote:

Hi there,

 

Provided the peer does not initiate a GATT MTU Exchange, which would be handled automatically by the Zephyr BLE stack, you can simply call bt_gatt_notify() in a loop and from a thread while modifying the contents of the attribute in each iteration. When GATT runs out of buffers the the bt_gatt_notify() call will block until more are available, so you do not need to wait for an event like when using the SoftDevice.

 

Regards,

 

Carles

 

From: zephyr-users-bounces@lists.zephyrproject.org [mailto:zephyr-users-bounces@lists.zephyrproject.org] On Behalf Of dhananjay gj
Sent: 28 December 2017 13:45
To: zephyr-users@lists.zephyrproject.org
Subject: [Zephyr-users] Zephyr way of handling large data transfer over BLE

 

Hello All,

          I have a question related to the one i asked last week. (https://lists.zephyrproject.org/pipermail/zephyr-users/2017-December/000915.html). But i will rephrase it and be more generic to what i am looking for now because that question was already answered and solution works too.

I have an Android client (BLE central) and zephyr OS based BLE device as peripheral (nRF device) transfer data over a custom profile. I am aware that in BLE we can transfer only 20 bytes at a time. And also there are possibilities to extend the data packet size or increase the ATT_MTU size based on negotiation. But for compatibility purposes, I will avoid using these techniques. I am also not using BLE mesh or nordic softdevice SDK.

In that case, what is the zephyr way of handling large data transfer over BLE.? Do we need to handle segmentation and reassembly in the application layer by our selves only ? or any callback events possible in case buffer is full during multi packet transmission so that we can handle this?.

 

I am searching if there is any solution similar to the accepted answer in this thread for nordic SDK: https://devzone.nordicsemi.com/question/1741/dealing-large-data-packets-through-ble/)

 

Any example or leads to this using zephyr is much appreciated. Thanks in advance.

 

Regards,

Dhananjay GJ

 



Vinayak Kariappa
 

Hi Dhananjay,

Take look at this video demonstrating the large data transfer between two nRF52840 PDK boards. The video is old, but not much has changed on the BT API front.

Everything from KConfig to API use is demonstrated here.

On 28 Dec 2017, at 14:38, dhananjay gj <dhguja@...> wrote:

Hello Carles,
           Many thanks for the reply. One final question, Is there an example in zephyr samples that handles transmitting large data?
or any profile supported in zephyr that i can use to circumvent this application level segmentation.

The intention of this question is coming from the fact that L2CAP layer handles segmentation to some extent (limited by memory available) and we are using GATT for custom profiles.
Is there is any standard BLE profile supported in zephyr we can directly use for this purpose. My apologies for this rooky question, i am new to BLE.

Thanks for the support.

Regards,
Dhananjay G J

On Thu, Dec 28, 2017 at 3:10 PM, Cufi, Carles <Carles.Cufi@...> wrote:

Hi there,

 

Yes, should be applicable to all those since they all call bt_att_create_pdu() which will block if there’s no buffers available.

 

Regards,

 

Carles

 

 

From: dhananjay gj [mailto:dhguja@...]
Sent: 28 December 2017 15:06
To: Cufi, Carles <Carles.Cufi@...>; zephyr-users@lists.zephyrproject.org
Subject: Re: [Zephyr-users] Zephyr way of handling large data transfer over BLE

 

Hello Carles,

            Many thanks for the information. Is this information is applicable to GATT indicate, write, read too?

Regards,

Dhananjay GJ

 

On Thu, Dec 28, 2017 at 2:50 PM, Cufi, Carles <Carles.Cufi@...> wrote:

Hi there,

 

Provided the peer does not initiate a GATT MTU Exchange, which would be handled automatically by the Zephyr BLE stack, you can simply call bt_gatt_notify() in a loop and from a thread while modifying the contents of the attribute in each iteration. When GATT runs out of buffers the the bt_gatt_notify() call will block until more are available, so you do not need to wait for an event like when using the SoftDevice.

 

Regards,

 

Carles

 

From: zephyr-users-bounces@lists.zephyrproject.org [mailto:zephyr-users-bounces@lists.zephyrproject.org] On Behalf Of dhananjay gj
Sent: 28 December 2017 13:45
To: zephyr-users@lists.zephyrproject.org
Subject: [Zephyr-users] Zephyr way of handling large data transfer over BLE

 

Hello All,

          I have a question related to the one i asked last week. (https://lists.zephyrproject.org/pipermail/zephyr-users/2017-December/000915.html). But i will rephrase it and be more generic to what i am looking for now because that question was already answered and solution works too.

I have an Android client (BLE central) and zephyr OS based BLE device as peripheral (nRF device) transfer data over a custom profile. I am aware that in BLE we can transfer only 20 bytes at a time. And also there are possibilities to extend the data packet size or increase the ATT_MTU size based on negotiation. But for compatibility purposes, I will avoid using these techniques. I am also not using BLE mesh or nordic softdevice SDK.

In that case, what is the zephyr way of handling large data transfer over BLE.? Do we need to handle segmentation and reassembly in the application layer by our selves only ? or any callback events possible in case buffer is full during multi packet transmission so that we can handle this?.

 

I am searching if there is any solution similar to the accepted answer in this thread for nordic SDK: https://devzone.nordicsemi.com/question/1741/dealing-large-data-packets-through-ble/)

 

Any example or leads to this using zephyr is much appreciated. Thanks in advance.

 

Regards,

Dhananjay GJ

 


_______________________________________________
Zephyr-users mailing list
Zephyr-users@...
https://lists.zephyrproject.org/mailman/listinfo/zephyr-users