def checkForSerialEvents(read_time, rx_data, parser_state, **kwargs):
 print2err('checkForSerialEvents called: ', (read_time, rx_data, parser_state, kwargs))
 parser_state['last_time'] = read_time
 serial_events = []
 if (rx_data == 'TEST'):
  serial_events.append({'data': rx_data})
 return serial_events

def checkForSerialEvents ( read_time , rx_data , parser_state , ** kwargs ) : print2err ( 'checkForSerialEvents called: ' , ( read_time , rx_data , parser_state , kwargs ) ) parser_state [ 'last_time' ] = read_time serial_events = [ ] if ( rx_data == 'TEST' ) : serial_events . append ( { 'data' : rx_data } ) return serial_events
must have the following signature: evt_list = somecustomparsername where: read_time: the time when the serial device read() returned with the new rx_data .