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

How can i send the message data unit?

Hello, I'm south korea student in dongguk univ.

and i want to know how can i send the message on my board(not use the terminal ).

I use the keil uvision4.0, nrf51822, s110.

and i found the function 'ble_nus_send_string(&m_nus,(uint8_t *)string,index+strlen(string));' but it only send uint8_t type only.

And i want to send like uint32_t, and integer type. I think, i can't use ble_nus_send_string()

how can i send that one?

plz help me, thanks.

  • Hi,

    The Nordic UART service (NUS) example demonstrates how to emulate UART over BLE and sending data. ble_nus_send_string() is not limited to sending data of type uint8_t, it takes a uint8_t pointer as argument. This pointer type can be looked at like a char array. You can send any data type you want over NUS by converting it to char arrays.

    If you want to send data of type uint32_t, you can convert it to char array using sprintf, or some similar function. Data can also be sent using other defined or custom BLE services. The best method depends on what data you need to send.

    Best regards,

    Jørgen

Related