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

How to use "ble_nus_string_send correctly" ?

Hello everybody, I try to send nus_string data. I bought different inputs and outputs like this;

INPUT;

while(ble_nus_string_send(&m_nus, (uint8_t *)"aaaaaaaaaaaaaaa", (uint16_t *)17) != NRF_SUCCESS);   // I wrote "a" 17 times

OUTPUT;

"aaaaa" received       // Send 5 times "a"

INPUT;

while(ble_nus_string_send(&m_nus, (uint8_t *)"aaaaaaaaaaaaaaaaa", (uint16_t *)19) != NRF_SUCCESS);     //I wrote "a" 19 times

OUTPUT;

There is no response!

1-Why do I see 5 characters when I enter 17 characters?

2-Why do not I see anything when I enter 19 characters?

3-How do I enter any characters and see all of it?

Thank you :)

Parents
  • Hi,

    For debugging I suggest to make the length parameter be the size of the string, the length of the two strings above seems to be 15 and 17, not 17 and 19?

    Can you use "abcde.." instead so we may see if it's the first or last bytes that is missing?

    Have you checked the baudrate is correct and possible tried to disable hardware flow control?

    I assume there is no assert occuring here on either sides of the link?

    Finally, for testing you may also remove power_manage() to see if that make any difference.

    Hopefully one of these changes will change behaviour and identify the cause. 

  • Normally I did not use "a" character just I write sample string. I've just realized, spacing between characters can be messing up. Can not perceive blank as character?

Reply Children
No Data
Related