i do not have this '\n' in the frame module.
the length is not always the same. between 5 and 7 chars.
The last char is always a sum of the values sent...
I could :
evaluate continiously the frame to know when it is end (the sum)
or
evaluate the second char received to determine the length of the frame (the command),
or
anticipate the length (5,6,7) of the response by the command sent.
'Status', send back 5 chars
'duration of the current audio', send back 7 chars.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
i give you an example of a frame
if i've read and kept the good part in the gps module, it use an object and fill the "line" until it's more than 80chars or until \n char.
i do not have this '\n' in the frame module.
the length is not always the same. between 5 and 7 chars.
The last char is always a sum of the values sent...
I could :
evaluate continiously the frame to know when it is end (the sum)
or
evaluate the second char received to determine the length of the frame (the command),
or
anticipate the length (5,6,7) of the response by the command sent.
'Status', send back 5 chars
'duration of the current audio', send back 7 chars.
thanks
i'll try.