I have been wracking my brain for a week on this.
Using the SIMPLEdht library I can get a 40-bit binary data string, and I want to transmit this raw data using 433MHz transmitter.
Using RadioHead, I can send a fixed length character string. The problem is that the string length changes as we go from double figure to single figure to negative single figure to negative double figure temperatures, So I guessed it would be more practical to transmit the raw data and do any number crunching on the receiver side. To date, I have been padding out the transmission string to a longer string with spaces and removing them at the receiver. It works but I am looking for a simpler and more elegant method.
static char *msg = str_out.c_str(); rf_driver.send((uint8_t *)msg, strlen(msg));
The way I understand the above code, is that each string character, that has been saved at specific memory location, is converted to set of 8 bit unsigned integers with a length of "strlen".
As I mentioned above, I already have 40 bits, i.e. five 8-bit bytes.
Could anyone enlighten me on how to prepare this data string for transmission, without coercing the binary to integers to text string, only to convert back for transmission?