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

NRF52 ble_app_uart example Android getting wrong data

Hi,

nrf52 using  from ble-peripheral->  ble_app_uart examle

In that ble_app_uart example receive the data from the android is ok.

But,i want transmit array type of data to Android using ble_nus_data_send. In that android side, we receive wrong data.

Kindly give the solution.

For Example,

uint8_t string1[10]={9,10,12,13,14,15,16,17,18,19};

uint8_t length =10;

err_code = ble_nus_data_send(&m_nus, string1, &length, m_conn_handle);

Output:

In the Android receives - > ^I^J^^L^M^N^O^P^Q^R^S

Parents
  • Hello,

    From your description I suspect that your Android is interpreting the received characters as a different encoding then what they are.
    Could you elaborate on what you intended to have the phone receive? - Did you want the phone to receive the 9th character of the ASCII table(which is TAB), the number 9, or something else?

    Furthermore, what application are you using on your Android for receiving the data, is it a custom application or are you using our nRF Connect application?
    Could you have the phone output the raw value of the bytes/binary representation of what it receives, and see if this does not match the numbers you've sent from your device?

    Best regards,
    Karl

Reply
  • Hello,

    From your description I suspect that your Android is interpreting the received characters as a different encoding then what they are.
    Could you elaborate on what you intended to have the phone receive? - Did you want the phone to receive the 9th character of the ASCII table(which is TAB), the number 9, or something else?

    Furthermore, what application are you using on your Android for receiving the data, is it a custom application or are you using our nRF Connect application?
    Could you have the phone output the raw value of the bytes/binary representation of what it receives, and see if this does not match the numbers you've sent from your device?

    Best regards,
    Karl

Children
Related