...
Notify will actually use the exact string constructor in the 2nd second method if you pass it a pointer as in the first method, so these two methods are identical. To get your data from ACOMMS_RECEIVED_DATA on the receiving side:
Code Block |
---|
// perhaps we copied the string in onNewMail string msg_string = msg.GetString(); // the .data() method gives us a pointer to the string's data in contiguous memory memcpy(&data_received.packet_id, msg_string.data(), msg_string.size()); |