@@ -174,10 +174,9 @@ def _wait_for_ready(self):
174174 if self ._debug >= 3 :
175175 print ()
176176
177-
177+ # pylint: disable=too-many-branches
178178 def _send_command (self , cmd , params = None , * , param_len_16 = False ):
179179 """Send over a command with a list of parameters"""
180-
181180 if not params :
182181 params = ()
183182
@@ -207,8 +206,8 @@ def _send_command(self, cmd, params=None, *, param_len_16=False):
207206 ptr += 1
208207 self ._sendbuf [ptr ] = len (param ) & 0xFF
209208 ptr += 1
210- for i , p in enumerate (param ):
211- self ._sendbuf [ptr + i ] = p
209+ for j , par in enumerate (param ):
210+ self ._sendbuf [ptr + j ] = par
212211 ptr += len (param )
213212 self ._sendbuf [ptr ] = _END_CMD
214213
@@ -223,6 +222,7 @@ def _send_command(self, cmd, params=None, *, param_len_16=False):
223222 spi .write (self ._sendbuf , start = 0 , end = packet_len ) # pylint: disable=no-member
224223 if self ._debug >= 3 :
225224 print ("Wrote: " , [hex (b ) for b in self ._sendbuf [0 :packet_len ]])
225+ # pylint: disable=too-many-branches
226226
227227 def _read_byte (self , spi ):
228228 """Read one byte from SPI"""
@@ -498,10 +498,14 @@ def socket_open(self, socket_num, dest, port, conn_mode=TCP_MODE):
498498 dest = bytes (dest , 'utf-8' )
499499 resp = self ._send_command_get_response (_START_CLIENT_TCP_CMD ,
500500 (dest , b'\x00 \x00 \x00 \x00 ' ,
501- port_param , self ._socknum_ll [0 ], (conn_mode ,)))
501+ port_param ,
502+ self ._socknum_ll [0 ],
503+ (conn_mode ,)))
502504 else : # ip address, use 4 arg vesion
503505 resp = self ._send_command_get_response (_START_CLIENT_TCP_CMD ,
504- (dest , port_param , self ._socknum_ll [0 ], (conn_mode ,)))
506+ (dest , port_param ,
507+ self ._socknum_ll [0 ],
508+ (conn_mode ,)))
505509 if resp [0 ][0 ] != 1 :
506510 raise RuntimeError ("Could not connect to remote server" )
507511
@@ -551,8 +555,10 @@ def socket_read(self, socket_num, size):
551555 (size , self .socket_status (socket_num )))
552556 self ._socknum_ll [0 ][0 ] = socket_num
553557 resp = self ._send_command_get_response (_GET_DATABUF_TCP_CMD ,
554- (self ._socknum_ll [0 ], (size & 0xFF , (size >> 8 ) & 0xFF )),
555- sent_param_len_16 = True , recv_param_len_16 = True )
558+ (self ._socknum_ll [0 ],
559+ (size & 0xFF , (size >> 8 ) & 0xFF )),
560+ sent_param_len_16 = True ,
561+ recv_param_len_16 = True )
556562 return bytes (resp [0 ])
557563
558564 def socket_connect (self , socket_num , dest , port , conn_mode = TCP_MODE ):
0 commit comments