CellularATCommandResponse in Cellular Interface Library

When sending AT commands to the module, such as “AT+CGSN”, the response is “+CGSN: OK”. Assuming that an unexpected event occurs and the “OK” response is not received when receiving from the module, this command will fail due to timeout. However, at this time, +CGSN: still exists in the linked list of type CellularATCommandResponse. If you continue to send the next command, the response will be added to the end of the linked list. Since the linked list contains responses from previous commands, it increases complexity in parsing for this AT command. Is there any way to clear the pAtResp linked list defined in function _pktioReadThread before sending AT commands?

Hi Qianfeng,

Sorry for late reply. I will look into this problem and reply in this thread.

Hi Qianfeng,

From the example you provided, "+CGSN: " and “OK” appear in the same line.

AT+CGSN
+CGSN: OK

The cellular interface process the response in lines. The success token “OK” can not be parsed correctly which results in cellular interface failed to receive “OK” within timeout and “+CGSN: OK” is kept in the AT response. AT response cleaned up after timeout is not supported in implementation, we will raise a PR to update this and later update in this thread.

The other problem is that the response “+CGSN: OK” can’t be supported by cellular interface. Port needs to indicate “+CGSN: OK” is a success token to this command or fix the input stream to split “+CGSN:” and “OK” into different lines.