File tree Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Original file line number Diff line number Diff line change 42
42
43
43
"""
44
44
45
- # imports
46
-
47
45
__version__ = "0.0.0-auto.0"
48
46
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_RockBlock.git"
47
+
48
+ class RockBlock :
49
+ '''Driver for RockBLOCK Iridium satellite modem.'''
50
+
51
+ def __init__ (self , uart , baudrate = 19200 ):
52
+ self ._uart = uart
53
+ self ._uart .baudrate = baudrate
54
+
55
+ def _uart_xfer (self , cmd ):
56
+ '''Send AT command and return response.'''
57
+ # response = ATCMD\r\nRESP\r\n\r\nOK\r\n
58
+ # or = ATCMD\r\nERROR\r\n
59
+
60
+ cmd = str .encode ('AT' + cmd )
61
+
62
+ self ._uart .reset_input_buffer ()
63
+ self ._uart .write (cmd + '\r ' )
64
+
65
+ resp = None
66
+ if self ._uart .readline ().strip () == cmd :
67
+ resp = self ._uart .readline ().strip ().decode ()
68
+
69
+ self ._uart .reset_input_buffer ()
70
+ return resp
You can’t perform that action at this time.
0 commit comments