Joke Collection Website - Public benefit messages - Structure of GSM module receiving short messages in text mode

Structure of GSM module receiving short messages in text mode

From \ r \ nLast byte (0x0D, 0x0A) to the end of the next message. However, it should be noted that one \r\n of the data received from GSM module comes before +CMGR, so before using strstr or memstr, be sure to point the pointer to the back. In addition, regarding the length, you can also take 5 before open 1 to ensure that the data will not be missed.