SeeedJP / WioLTEforArduino

GNU General Public License v2.0
33 stars 19 forks source link

Check the response error code for `+QNTP` AT command, on `SyncTime()` #36

Closed moznion closed 3 years ago

moznion commented 3 years ago

Prior to this commit, the response of AT+QNTP=1 AT command hasn't been checked. This means the SyncTime() function won't return a falsy value even if the command execution was failed (e.g. because of Open PDP context failed). This commit fixes that issue according to the Rev. EC2x&EG9x&EM05_TCP/IP_AT_Commands_Manual_V1.0 document from QUECTEL.

The response payload format is +QNTP: <err>,<time>, and if the err code isn't 0, that has to be an error indication; for more information, please refer to the 4 Summary of Error Codes section.

So this commit makes the logic check the response error code is 0 or not.

matsujirushi commented 3 years ago

Hi @moznion , Improved quality :-) Thanks for the pull request.