Control lenght of payload with S_INFO
-
Hi,
I have :
// define my payload char payload[8] = "12345678"; // define my myssage MyMessage nikoBusMessage(0, V_TEXT); // and sending the message in the program send(nikoBusMessage.setSensor(SIMULATIE_LCD_ADRES).set(payload));But when the message is send, a complete payload of 26 char is send.
How do I control the lenght of the payload that I want to send?I tried :
send(nikoBusMessage.setSensor(SIMULATIE_LCD_ADRES).set(payload,8));but then the asci value for each character of "12345678" is send in the payload.
-
Hi,
I have :
// define my payload char payload[8] = "12345678"; // define my myssage MyMessage nikoBusMessage(0, V_TEXT); // and sending the message in the program send(nikoBusMessage.setSensor(SIMULATIE_LCD_ADRES).set(payload));But when the message is send, a complete payload of 26 char is send.
How do I control the lenght of the payload that I want to send?I tried :
send(nikoBusMessage.setSensor(SIMULATIE_LCD_ADRES).set(payload,8));but then the asci value for each character of "12345678" is send in the payload.
-
When i limit the lenght with
send(nikoBusMessage.setSensor(SIMULATIE_LCD_ADRES).set(payload,8));I get this as output (ascci values of char) :
0;54;1;0;47;3132333435363738
Maybe a bug in library?But indeed the solution with the nul character works fine.
Than
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login