Closed ffontaine closed 3 years ago
Do you have some comments on this Pull Request? I could move this fix to be Sequans specific but I think that it would be better to apply it for all modems.
I'm sorry, I just haven't had a chance to test it.
OK, thanks for your answer, I asked because you were very quick on merging my first PR. Take your time to be sure that this PR doesn't break anything and thanks for your great work on TinyGSM.
It's probably perfect. I just half-remember that there was something weird about the parseInt function that I haven't gotten a chance to confirm.
parseInt
is already used in other source files so I assume that everything should be ok.
As specified in the ETSI standards (e.g. ETSI TS 127 001),
CREG
andCEREG
responses can contain optional parameters:+CEREG: <n>,<stat>[,<tac>,<ci>[,<AcT>]]
For example, the Monarch GMS01Q returns the following response:
+CEREG: 2,1,"3982","00DF3B03",7
This results in TinyGSM setting state as '7' instead of 1 preventing any connection.
Fix this by picking the next integer after the first ',' which will always works (with or without optional parameters)
Signed-off-by: Fabrice Fontaine fabrice.fontaine@orange.com