Closed weingxing closed 1 year ago
In my experience sometimes (with all libraries) messages don't arrive complete at the first read, you need to store what you receive in a buffer and then read again the times necessary to complete the message. There are two ways to know if a message is complete; if you see the number of characters you need to receive, you validate for that, or you check if there is an end of the message in the received buffer. For your particular case, the end of the message should be a new line (\n) character.
Good luck.
@darthrookie Thanks, I have tried it and it works well.
Hi, i want to use this lib to reveive and handle message by a hardware(SIM900A), but i just receive part of the message, and i use minicom to test the hardware, it works fine. just like the picture: there is my code:
and this code can run correctly in windows with CH340, but in linux (ARM, the hardware is bananapi m2 zero, the os is ubuntu16.04, SIM900A connect to bananapi by UART pins), it is wrong.