Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NTPServerSync #652

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

gonzabrusco
Copy link

Hello @SRGDamia1 @vshymanskyy thank you for your great work.

This PR fixes two issues with the NTPServerSync function.

  1. Prior to this PR, you could not set negative timezones because the passed value was byte (which translates to uin8_t). Now the value passed it's an Int so you can set any timezone (from -47 to +48).

  2. On old SIM800 the return code of +CNTP was always: +CNTP: <code> but now with newer modules you could also get the network time attached to the response like this: +CNTP: <code>[,<time>] . What I did to keep backward compatibility is to look for the ',' and remove all the leading characters if found. If not, assume the reply was just the <code>.

It is working perfectly on my SIM7000.

Thanks
Gonzalo

@gonzabrusco
Copy link
Author

Just one not to this. With the SIM7000 that worked perfectly. But now I'm using the SIM7070 and this stopped working. The reason is that the SIM7070 code uses another CNTPCID. You have to use 0 insted of 1 for some reason. Maybe we should separate the code of NTPServerSyncImpl for SIM7080 family modules.

@gonzabrusco
Copy link
Author

Ok I did the change I suggested erlier. Now every module on the 70xx family can have it's own NTP function (but if not, they use the template ones). Now both 7000 and 7070 are working as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant