¿ªÔÆÌåÓý

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

Re: Samsung RS232 Direct Volume commands


 

Given Jonathons python script, you could use the following to always out the correct string when inputting a volume of 0 - 100:

CHANGE VOLUME
{
?? ?INTEGER i;
?? ?INTEGER SumOfBytes;
?? ?INTEGER Checksum;
?? ?STRING Command$[6];
?? ?
?? ?MAKESTRING(Command$, "\x08\x22\x01\x00\x00%s", CHR(VOLUME));
?? ?SumOfBytes = 0;
?? ?
?? ?FOR(i = 1 TO 6)
?? ?{
?? ???? SumOfBytes = SumOfBytes + BYTE(Command$, i);
?? ?}
?? ?
??? Checksum = (0xFF - SumOfBytes + 1) % 0xFF;
?? ?
??? STRING_OUT$ = Command$ + CHR(Checksum);
}

?

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