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

Data updating upto 241 bytes

Hello,

I have developed an application that transmits a string as a notification to the phone app whenever there is a corresponding command received from the phone app.

I actually want to send a string of size around 3KB. Now whenever I try to do that using a for loop to send chunks of 20 bytes of data at a time, the maximum number of bytes that I am able to see as notifications is 241 bytes. 

So how do I send the rest of data to the phone app?

Is this something to do with the connection interval?

If so how to solve this and send further data?

Any relevant links or details would be appreciated.

Thanks & Regards 

Sudeep R J

Parents
  • Hi there Sudeep

    Where are you calling sd_ble_gatts_hvx from? Your main application or from an interrupt? If you're calling it from an interrupt, what interrupt is this? If you're calling it from a SoftDevice interrupt you'll block the TX_COMPLETE event, as the application won't leave the SoftDevice interrupt.

    Best regards,

    Simon

  • Hi Simonr,

    I am calling sd_ble_gatts_hvx from ble_nus_data_send which in turn is called in the interrupt handlers. When the command is written from phone app then RX_DATA event occurs and there I am calling ble_nus_data_send to send a "Hello World" notification as a response to a correct command.

    Next, when the Hello world is sent then TX_COMPLETE event occurs and there I am calling ble_nus_data_send to send around 241 bytes of data.

    The problem has arised here itself. If i dont include check for NRF_ERROR_RESOURCES event then upto 241 bytes notifications are sent correctly, but when I check for NRF_ERROR_RESOURCES then I am not getting any notifications. Actually I want to send around 3KB of data but without checking NRF_ERROR_RESOURCES i was able to send only 241 bytes and with checking of NRF_ERROR_RESOURCES  i am not getting any notifications.

    Thanks & Regards

    Sudeep R J

Reply
  • Hi Simonr,

    I am calling sd_ble_gatts_hvx from ble_nus_data_send which in turn is called in the interrupt handlers. When the command is written from phone app then RX_DATA event occurs and there I am calling ble_nus_data_send to send a "Hello World" notification as a response to a correct command.

    Next, when the Hello world is sent then TX_COMPLETE event occurs and there I am calling ble_nus_data_send to send around 241 bytes of data.

    The problem has arised here itself. If i dont include check for NRF_ERROR_RESOURCES event then upto 241 bytes notifications are sent correctly, but when I check for NRF_ERROR_RESOURCES then I am not getting any notifications. Actually I want to send around 3KB of data but without checking NRF_ERROR_RESOURCES i was able to send only 241 bytes and with checking of NRF_ERROR_RESOURCES  i am not getting any notifications.

    Thanks & Regards

    Sudeep R J

Children
  • You should be able to see something in the debug log, or while debugging. Like what happens in the application when you're checking for NRF_ERROR_RESOURCES. Does it stop altogether at these checks, or is it stuck in a loop, or what?

    If you'd like I can set this case to private mode (only yourself and Nordic engineers will then be able to see this case) so that you can share the full project and that way I can try to debug it from our side.

    Best regards,

    Simon

  • Hi Simonr,

    Thanks for asking, but I need to talk to my manager regarding sharing the project and I alone cannot take a call on that. I dont think he will agree to this because the companies projects are very confidential to it.

    I'll check with him what to be done in this regard.

    Thanks & Regards

    Sudeep R J

Related