Hello everyone. I am facing the following problem:
In MQTT, i'm suscribe to a topic and i'm constantly receiving a frame consisting in three bytes like so: (SoF) ( byte1) (byte2).
Where (SoF) represents the start of the frame ( it's just a char) and (byte1),(byte2) the most significant and less significant bits of a uint16.
My question is, how can I "sense" when a frame is comming and then concatenate the byte1 and the byte2 in a single unsigned int variable?
In C it's quite easy to do it, but since this is my first time programming in .js I have no clue of where to start.
Any help is more than wellcome.