Proper escaping of ascii characters to add bytes to echo string
-
Hey,
I'm working on connecting my Duet 3 6HC to an external display (Nextion) which needs three bytes of 0xFF as termination. The display is connected to the serial port of the Duet. The display calls a macro on the duet which might look like this:echo "hetemp.txt="""^heat.heaters[1].current^""""
which results in an output shaped like this:
hetemp.txt="23.88"
or in hex:
68 65 74 65 6D 70 2E 74 78 74 3D 22 32 33 2E 38 38 22
For arbitrary reasons, the Nextion display needs three trailing 0xFF bytes to parse the message.
I'm looking for a way to add these three bytes to the echo statement above so that the output will be:68 65 74 65 6D 70 2E 74 78 74 3D 22 32 33 2E 38 38 22 ff ff ff
I tried some ways - by for example adding three ÿ to the statement - but whatever I do, everything is parsed as ascii code.
Does anyone know how I can properly add these three trailing bytes to the message?