¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Simpl+ MAKESTRING sends characters of the bytes and not the bytes


 

Guys, I have this weird problem with Simpl+. I have posted the same to the FB group also so sorry if you see it again.
?
I want to send a string to a device through UDP. The string consists of 10 bytes.
The first 4 bytes are always the same like "\x02\x50\x32\xB7".
The last 2 bytes are always the same like "\x04\x0D".
The 4 bytes in the middle (byte5, byte6 and byte7,byte8) are calculated each time and added to the string and essentially they represent a 32bit long integer.
So I am creating a string like this:
MAKESTRING(command,"\x02\x50\x32\xB7%08lX\x04\x0D",createBytes());
The problem is that the long integer is not received as 4 bytes. It is received as characters resulting in different bytes, as you understand.
For example
if the calculated long integer is 0xFFAABBCC, I am getting \x46\x46\x41\x41\x42\x42\x43\x43, instead of \xFF\xAA\xBB\xCC.
What can I do to fix this? Is there another way to create the string?(btw, concatenation did the same).
I want to send bytes, and not the ASCII values of the characters of the bytes. Any help would be greatly appreciated.

Join [email protected] to automatically receive all group messages.