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

How can I use ble_nus_data_send function to sending hexadecimal to phone ?

I'm try to using Nordic 52832 board to send hexadecimal to the phone, but it still receive for ascii.

Using example\ble_peripheral\ble_app_uart code for sending.

Parents
  • Hi.

    The function ble_nus_data_send(ble_nus_t * p_nus, uint8_t * p_data, uint16_t * p_length, uint16_t conn_handle) treats the p_data variable as a byte array, and does therefore not care what it contains, in terms of its value.

    Your issue is probabily that your RX device treats the received p_data array as a ASCII string. You should look at how your RX device prints the received p_data array.

    - Andreas

Reply
  • Hi.

    The function ble_nus_data_send(ble_nus_t * p_nus, uint8_t * p_data, uint16_t * p_length, uint16_t conn_handle) treats the p_data variable as a byte array, and does therefore not care what it contains, in terms of its value.

    Your issue is probabily that your RX device treats the received p_data array as a ASCII string. You should look at how your RX device prints the received p_data array.

    - Andreas

Children
Related