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

Can't receive bytes sent via ByteArray in nRFConnect App

I created a custom BLE service following this tutorial and I am able to connect to the BLE service and write data to it, but ideally, I want to send character bytes as opposed to just decimal values. 

In the nRFConnect app, seemingly ByteArray is a field to enter character bytes but when I enter a character, on_write is invoked and p_evt_write->len remains 0, and so is p_evt_write->data
But when I send in an Unsigned field, I receive the expected data and so does the length.

Also can we not send multiple bytes at once? because otherwise p_evt_write->len would always remain 1 hence no actual use.


Am I using the ByteArray field correctly? 

  • The max_len field indicates the maximum length, so it is up to. You can always write a smaller value, the point is that it cannot be larger than the specified maximum.

    (I see now that my statement "The max_len here dictates the maximum length of the value, neither more or less" can be confusing. The point was that max_len does not do anything other than limiting the maximum length. So, it does not say anything about number of writes before you get an interrupt or similar as you asked about before I answered that).

Related