bug in split_55() ?
peepshow-21 opened this issue · 2 comments
peepshow-21 commented
def split_55(b)
var ret = []
var s = size(b)
var i = s-1 # start from last
while i > 0
if b[i] == 0x55 && b[i+1] == 0xAA
ret.push(b[i..s-1]) # push last msg to list
b = b[(0..i-1)] # write the rest back to b
end
i -= 1
end
ret.push(b)
return ret
end
should be like this i think;
ret.push(b[(i+2)..s-1]) # push last msg to list
I think it needs that or the split message will still have the split chars in the messsage
blakadder commented
you think or you're certain? what kind of testing makes you think that?
peepshow-21 commented
I don't use that file, I have my own based on that. I noticed it there
because it sent 2 messages. The stock screen can send multiple messages and
your script splits them with 0x55aa, which is correct. but when you split
you are leaving the separator in the message. so I'm 90% sure it will be
wrong. instead of being "{ blah blah json..}" it will be "0x55aa{ blah blah
json }". I made that change to mine to fix mine, so I think it would be
needed in yours. but I'm not using stock anymore so not really able to
test. Just giving you the heads up in case you wanted to check.
…On Sun, 30 Jan 2022 at 20:33, blakadder ***@***.***> wrote:
you think or you're certain? what kind of testing makes you think that?
—
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKBSYTCDBPFXO3NDT2THMQLUYWOC7ANCNFSM5NEN6RIQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>