@@ -100,7 +100,7 @@ def detect_shell_mode(self):
100100 """Detect if the device is in shell mode or not."""
101101 for _ in range (3 ):
102102 self .write_raw ("at AT+CGSN" )
103- result , output = self .comms .expect_response ("OK" , "ERROR" , "" )
103+ result , output = self .comms .expect_response ("OK" , "ERROR" , "" , suppress_errors = True )
104104 if result and len (re .findall ("[0-9]{15}" , output )) > 0 :
105105 self .set_shell_mode (True )
106106 return
@@ -110,15 +110,15 @@ def enable_error_codes(self):
110110 """Enable error codes in the AT client"""
111111 self .at_command ('AT+CMEE=1' , wait_for_result = True )
112112
113- def at_command (self , at_command , wait_for_result = False ):
113+ def at_command (self , at_command , wait_for_result = False , suppress_errors = False ):
114114 """Write an AT command to the command interface. Optionally wait for OK"""
115115
116116 # AT commands are written directly as-is with the ATCommandInterface:
117117 at_cmd_prefix = 'at ' if self .shell else ''
118118 self .write_raw (f'{ at_cmd_prefix } { at_command } ' )
119119
120120 if wait_for_result :
121- result , _ = self .comms .expect_response ("OK" , "ERROR" )
121+ result , _ = self .comms .expect_response ("OK" , "ERROR" , suppress_errors = suppress_errors )
122122 return result
123123 else :
124124 return True
0 commit comments