Go Down

Topic: Serial.write(): Write uint32_t as 4 bytes (Read 9710 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