Go Down

Topic: Serial.write(): Write uint32_t as 4 bytes (Read 5152 times) previous topic - next topic



I'm currently working on a project, where the Arduino needs to talk back to a Windows Computer running a Windows Universal App (UWP) via Bluetooth.
The problem: The DataReader I use for that needs to know, how many bytes sent, so I need to send the number of chars I want to send before sending them on the Arduino side.
I store this number in a uint32_t and have to transmit it in this format, because the DataReader has a method ReadUint32(), wich is expecting 4 bytes. How can I achieve this?
How can I concatenate this number in a 4 byte format in a String to send the message as one big package instead of two?


Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131