-
Notifications
You must be signed in to change notification settings - Fork 60
Description
I think I have found an situation where there is ambiguity in waitResponse(). This method is used to parse the AT response from the modem. It defaults to parse for r1=LORA_OK ("+OK") or r2=LORA_ERROR ("+ERR"). There appears to be provision to add additional checks (r3, r4, r5).
The following line is typical of the parsing method used:
Line 855 in 2fa519d
if (r1 && data.endsWith(r1)) { |
A problem arises because the modem can return seven types of error message as shown here:
Because the parsing method uses the .endswith() string method, and the string is checked with every new character, any error message will match the first "+ERR" and therefore, you cannot add additional error codes when you call waitResponse().
I think this needs to be fixed. It seems to me that the string comparison should be done only after the entire response is received from the modem?