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

    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 :


    but then the asci value for each character of "12345678" is send in the payload.

  • Mod

    @wimd the second option looks correct to me. Did you expect something else than the ascii characters to be sent? If so, what did you expect?

    I think the first option can work if you end the string with a null character (\0)

  • When i limit the lenght with


    I get this as output (ascci values of char) :
    Maybe a bug in library?

    But indeed the solution with the nul character works fine.


Log in to reply

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.