@@ -420,6 +420,22 @@ def _data_received_config(self, data: str, timestamp: float) -> None:
420420 return
421421 self ._add_data_to_receive_buffer (data )
422422
423+ # @override
424+ # default implementation...
425+ def _data_received (self , data : str , timestamp : float ):
426+ # disable 'Too many return statements' warning - pylint: disable=R0911
427+ self .get_logger ().debug ("data received %s" , data .replace (
428+ "\r " , "<CR>" ).replace ("\n " , "<LF>" ))
429+ data = data [:- 1 ]
430+ if data [0 ] == 'H' and data [2 ] == 'T' : # HBT
431+ return
432+ if len (data ) >= 10 and data [- 6 :- 3 ] == 'IVF' :
433+ self ._parse_inventory (data )
434+ if self ._custom_command :
435+ self ._add_data_to_receive_buffer (data )
436+ return
437+ self ._add_data_to_receive_buffer (data )
438+
423439 async def _prepare_reader_communication (self ) -> None :
424440 """Override for prepare the reader for the communication"""
425441 # disable Too many branches warning - pylint: disable=R0912
@@ -486,8 +502,8 @@ async def _send_recv_command(self, command: str, *parameters) -> str:
486502 try :
487503 return await self ._recv ()
488504 except TimeoutError as err :
489- raise TimeoutError ("no reader response for command " + command + " " +
490- " " .join (str (x ) for x in parameters )) from err
505+ raise RfidReaderException ("no reader response for command " + command + " " +
506+ " " .join (str (x ) for x in parameters )) from err
491507 finally :
492508 self ._communication_lock .release ()
493509
0 commit comments