@@ -249,7 +249,7 @@ def send_identify_non_configured_remote_slave(self):
249249 message [0 ] = CS_IDENTIFY_NON_CONFIGURED_REMOTE_SLAVE
250250 self .__send_command (message )
251251
252- # FIXME: Make async implementation
252+ # FIXME: Make async implementation "afast_scan"
253253 @ensure_not_async # NOTE: Safeguard for accidental async use
254254 def fast_scan (self ):
255255 """This command sends a series of fastscan message
@@ -267,7 +267,8 @@ def fast_scan(self):
267267 lss_next = 0
268268
269269 if self .__send_fast_scan_message (lss_id [0 ], lss_bit_check , lss_sub , lss_next ):
270- time .sleep (0.01 ) # NOTE: Blocking call
270+ # NOTE: Blocking call
271+ time .sleep (0.01 )
271272 while lss_sub < 4 :
272273 lss_bit_check = 32
273274 while lss_bit_check > 0 :
@@ -276,13 +277,15 @@ def fast_scan(self):
276277 if not self .__send_fast_scan_message (lss_id [lss_sub ], lss_bit_check , lss_sub , lss_next ):
277278 lss_id [lss_sub ] |= 1 << lss_bit_check
278279
279- time .sleep (0.01 ) # NOTE: Blocking call
280+ # NOTE: Blocking call
281+ time .sleep (0.01 )
280282
281283 lss_next = (lss_sub + 1 ) & 3
282284 if not self .__send_fast_scan_message (lss_id [lss_sub ], lss_bit_check , lss_sub , lss_next ):
283285 return False , None
284286
285- time .sleep (0.01 ) # NOTE: Blocking call
287+ # NOTE: Blocking call
288+ time .sleep (0.01 )
286289
287290 # Now the next 32 bits will be scanned
288291 lss_sub += 1
@@ -306,7 +309,7 @@ def __send_fast_scan_message(self, id_number, bit_checker, lss_sub, lss_next):
306309
307310 return False
308311
309- # FIXME: Make async implementation
312+ # FIXME: Make async implementation "__asend_lss_address"
310313 @ensure_not_async # NOTE: Safeguard for accidental async use
311314 def __send_lss_address (self , req_cs , number ):
312315 message = bytearray (8 )
@@ -316,7 +319,8 @@ def __send_lss_address(self, req_cs, number):
316319 response = self .__send_command (message )
317320 # some device needs these delays between messages
318321 # because it can't handle messages arriving with no delay
319- time .sleep (0.2 ) # NOTE: Blocking call
322+ # NOTE: Blocking call
323+ time .sleep (0.2 )
320324
321325 return response
322326
@@ -371,7 +375,7 @@ def __send_configure(self, req_cs, value1=0, value2=0):
371375 error_msg = "LSS Error: %d" % error_code
372376 raise LssError (error_msg )
373377
374- # FIXME: Make async implementation
378+ # FIXME: Make async implementation "__asend_command"
375379 @ensure_not_async # NOTE: Safeguard for accidental async use
376380 def __send_command (self , message ):
377381 """Send a LSS operation code to the network
@@ -392,7 +396,8 @@ def __send_command(self, message):
392396 response = None
393397 if not self .responses .empty ():
394398 logger .info ("There were unexpected messages in the queue" )
395- self .responses = queue .Queue () # FIXME: Recreating the queue
399+ # FIXME: Recreating the queue
400+ self .responses = queue .Queue ()
396401
397402 self .network .send_message (self .LSS_TX_COBID , message )
398403
@@ -402,7 +407,8 @@ def __send_command(self, message):
402407 # Wait for the slave to respond
403408 # TODO check if the response is LSS response message
404409 try :
405- response = self .responses .get ( # NOTE: Blocking call
410+ # NOTE: Blocking call
411+ response = self .responses .get (
406412 block = True , timeout = self .RESPONSE_TIMEOUT )
407413 except queue .Empty :
408414 raise LssError ("No LSS response received" )
@@ -412,7 +418,8 @@ def __send_command(self, message):
412418 @ensure_not_async # NOTE: Safeguard for accidental async use
413419 def on_message_received (self , can_id , data , timestamp ):
414420 # NOTE: Callback. Called from another thread
415- self .responses .put (bytes (data )) # NOTE: Blocking call
421+ # NOTE: Blocking call
422+ self .responses .put (bytes (data ))
416423
417424 async def aon_message_received (self , can_id , data , timestamp ):
418425 await self .aresponses .put (bytes (data ))
0 commit comments