5656# FONA Versions
5757FONA_800_L = const (0x01 )
5858FONA_800_H = const (0x6 )
59+ FONA_800_C = const (0x7 )
5960FONA_808_V1 = const (0x2 )
6061FONA_808_V2 = const (0x3 )
6162FONA_3G_A = const (0x4 )
@@ -71,7 +72,7 @@ class FONA:
7172 """CircuitPython FONA module interface.
7273
7374 :param ~busio.UART uart: FONA UART connection.
74- :param ~digitalio.DigitalInOut rdt : FONA RST pin.
75+ :param ~digitalio.DigitalInOut rst : FONA RST pin.
7576 :param ~digitalio.DigitalInOut ri: Optional FONA Ring Interrupt (RI) pin.
7677 :param bool debug: Enable debugging output.
7778 """
@@ -147,14 +148,20 @@ def _init_fona(self) -> bool:
147148 self ._fona_type = FONA_3G_A
148149 elif self ._buf .find (b"SIMCOM_SIM5320E" ) != - 1 :
149150 self ._fona_type = FONA_3G_E
150-
151- if self ._fona_type == FONA_800_L :
152- # determine if SIM800H
151+ elif self ._buf .find (b"SIM800" ) != - 1 :
153152 self ._uart_write (b"AT+GMM\r \n " )
154153 self ._read_line (multiline = True )
155154
156155 if self ._buf .find (b"SIM800H" ) != - 1 :
157156 self ._fona_type = FONA_800_H
157+ elif self ._buf .find (b"SIM800L" ) != - 1 :
158+ self ._fona_type = FONA_800_L
159+ elif self ._buf .find (b"SIM800C" ) != - 1 :
160+ self ._fona_type = FONA_800_C
161+
162+ if self ._debug and self ._fona_type == 0 :
163+ print (f"Unsupported module: { self ._buf } " )
164+
158165 return True
159166
160167 def factory_reset (self ) -> bool :
@@ -366,7 +373,7 @@ def gps(self) -> int:
366373 # Instead just look for a fix and if found assume it's a 3D fix.
367374 self ._get_reply (b"AT+CGNSINF" )
368375
369- if not b"+CGNSINF: " in self ._buf :
376+ if b"+CGNSINF: " not in self ._buf :
370377 return False
371378
372379 status = int (self ._buf [10 :11 ].decode ("utf-8" ))
0 commit comments