@@ -174,10 +174,9 @@ def _wait_for_ready(self):
174
174
if self ._debug >= 3 :
175
175
print ()
176
176
177
-
177
+ # pylint: disable=too-many-branches
178
178
def _send_command (self , cmd , params = None , * , param_len_16 = False ):
179
179
"""Send over a command with a list of parameters"""
180
-
181
180
if not params :
182
181
params = ()
183
182
@@ -207,8 +206,8 @@ def _send_command(self, cmd, params=None, *, param_len_16=False):
207
206
ptr += 1
208
207
self ._sendbuf [ptr ] = len (param ) & 0xFF
209
208
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
212
211
ptr += len (param )
213
212
self ._sendbuf [ptr ] = _END_CMD
214
213
@@ -223,6 +222,7 @@ def _send_command(self, cmd, params=None, *, param_len_16=False):
223
222
spi .write (self ._sendbuf , start = 0 , end = packet_len ) # pylint: disable=no-member
224
223
if self ._debug >= 3 :
225
224
print ("Wrote: " , [hex (b ) for b in self ._sendbuf [0 :packet_len ]])
225
+ # pylint: disable=too-many-branches
226
226
227
227
def _read_byte (self , spi ):
228
228
"""Read one byte from SPI"""
@@ -498,10 +498,14 @@ def socket_open(self, socket_num, dest, port, conn_mode=TCP_MODE):
498
498
dest = bytes (dest , 'utf-8' )
499
499
resp = self ._send_command_get_response (_START_CLIENT_TCP_CMD ,
500
500
(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 ,)))
502
504
else : # ip address, use 4 arg vesion
503
505
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 ,)))
505
509
if resp [0 ][0 ] != 1 :
506
510
raise RuntimeError ("Could not connect to remote server" )
507
511
@@ -551,8 +555,10 @@ def socket_read(self, socket_num, size):
551
555
(size , self .socket_status (socket_num )))
552
556
self ._socknum_ll [0 ][0 ] = socket_num
553
557
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 )
556
562
return bytes (resp [0 ])
557
563
558
564
def socket_connect (self , socket_num , dest , port , conn_mode = TCP_MODE ):
0 commit comments