parameters: (self)
docstring: asyncio task that consumes the output from the radio
docstring_summary: asyncio task that consumes the output from the radio
docstring_tokens: asyncio task that consumes the output from the radio
function: async def __adsb_task(self):
          """
          asyncio task that consumes the output from the radio
          """
          print_stderr = False
  
          if self.opts['debug'] is not None and self.opts['debug']:
              print_stderr = True
  
          try:
              while not self.kismet.kill_ioloop:
                  msg = await self.message_queue.get()
  
                  if not msg:
                      break
  
                  output = {}
  
                  msgtype = self.adsb_msg_get_type(msg)
                  msgbits = self.adsb_len_by_type(msgtype)
                  msgcrc = self.adsb_msg_get_crc(msg, msgbits)
                  msgcrc2 = self.adsb_crc(msg, msgbits)
  
                  output['adsb_msg_type'] = msgtype
                  output['adsb_raw_msg'] = msg.hex()
                  output['crc_valid'] = False
  
                  if msgcrc != msgcrc2:
                      if msgtype == 11 or msgtype == 17:
                          msg2 = self.adsb_msg_fix_single_bit(msg, msgbits)
       
                          if msg2 != None:
                              msg = msg2
                              output['crc_valid'] = True
                              output['crc_recovered'] = 1
                  else:
                      output['crc_valid'] = True
  
                  # Process valid messages
                  if output['crc_valid']:
                      output['adsb_msg'] = msg.hex()
  
                      msgicao = self.adsb_msg_get_icao(msg).hex()
  
                      output['icao'] = msgicao
  
                      if msgtype == 17:
                          msgme, msgsubme = self.adsb_msg_get_me_subme(msg)
  
                          if msgme >= 1 and msgme <= 4:
                              msgflight = self.adsb_msg_get_flight(msg)
                              output['callsign'] = msgflight
  
                          elif msgme >= 9 and msgme <= 18:
                              msgalt = self.adsb_msg_get_ac12_altitude(msg)
                              output['altitude'] = msgalt
  
                              msgpair, msglat, msglon = self.adsb_msg_get_airborne_position(msg)
                              output['coordpair_even'] = msgpair
                              output['raw_lat'] = msglat
                              output['raw_lon'] = msglon
  
                          elif msgme == 19 and (msgsubme >= 1 and msgsubme <= 4):
                              if msgsubme == 1 or msgsubme == 2:
                                  msgvelocity = self.adsb_msg_get_airborne_velocity(msg)
                                  msgheading = self.adsb_msg_get_airborne_heading(msg)
  
                                  output['speed'] = msgvelocity
                                  output['heading'] = msgheading
                              elif msgsubme == 3 or msgsubme == 4:
                                  msgheadvalid, msgheading = self.adsb_msg_get_airborne_heading(msg)
                                  if msgheadvalid:
                                      out['heading'] = heading
              
                      elif msgtype == 0 or msgtype == 4 or msgtype == 16 or msgtype == 20:
                          msgalt = self.adsb_msg_get_ac13_altitude(msg)
                          output['altitude'] = msgalt
  
                  if print_stderr:
                      print(output, file=sys.stderr)
  
                  l = json.dumps(output)
  
                  if not self.handle_json(l):
                      raise RuntimeError('could not process response from rtladsb')
          except Exception as e:
              traceback.print_exc(file=sys.stderr)
              print("An error occurred reading from the proxy websocket")
              self.kismet.send_datasource_error_report(message = "Error handling ADSB: {}".format(e))
          finally:
              self.kill_proxy()
              self.kismet.spindown()
              return
function_tokens: async def __adsb_task ( self ) : print_stderr = False if self . opts [ 'debug' ] is not None and self . opts [ 'debug' ] : print_stderr = True try : while not self . kismet . kill_ioloop : msg = await self . message_queue . get ( ) if not msg : break output = { } msgtype = self . adsb_msg_get_type ( msg ) msgbits = self . adsb_len_by_type ( msgtype ) msgcrc = self . adsb_msg_get_crc ( msg , msgbits ) msgcrc2 = self . adsb_crc ( msg , msgbits ) output [ 'adsb_msg_type' ] = msgtype output [ 'adsb_raw_msg' ] = msg . hex ( ) output [ 'crc_valid' ] = False if msgcrc != msgcrc2 : if msgtype == 11 or msgtype == 17 : msg2 = self . adsb_msg_fix_single_bit ( msg , msgbits ) if msg2 != None : msg = msg2 output [ 'crc_valid' ] = True output [ 'crc_recovered' ] = 1 else : output [ 'crc_valid' ] = True # Process valid messages if output [ 'crc_valid' ] : output [ 'adsb_msg' ] = msg . hex ( ) msgicao = self . adsb_msg_get_icao ( msg ) . hex ( ) output [ 'icao' ] = msgicao if msgtype == 17 : msgme , msgsubme = self . adsb_msg_get_me_subme ( msg ) if msgme >= 1 and msgme <= 4 : msgflight = self . adsb_msg_get_flight ( msg ) output [ 'callsign' ] = msgflight elif msgme >= 9 and msgme <= 18 : msgalt = self . adsb_msg_get_ac12_altitude ( msg ) output [ 'altitude' ] = msgalt msgpair , msglat , msglon = self . adsb_msg_get_airborne_position ( msg ) output [ 'coordpair_even' ] = msgpair output [ 'raw_lat' ] = msglat output [ 'raw_lon' ] = msglon elif msgme == 19 and ( msgsubme >= 1 and msgsubme <= 4 ) : if msgsubme == 1 or msgsubme == 2 : msgvelocity = self . adsb_msg_get_airborne_velocity ( msg ) msgheading = self . adsb_msg_get_airborne_heading ( msg ) output [ 'speed' ] = msgvelocity output [ 'heading' ] = msgheading elif msgsubme == 3 or msgsubme == 4 : msgheadvalid , msgheading = self . adsb_msg_get_airborne_heading ( msg ) if msgheadvalid : out [ 'heading' ] = heading elif msgtype == 0 or msgtype == 4 or msgtype == 16 or msgtype == 20 : msgalt = self . adsb_msg_get_ac13_altitude ( msg ) output [ 'altitude' ] = msgalt if print_stderr : print ( output , file = sys . stderr ) l = json . dumps ( output ) if not self . handle_json ( l ) : raise RuntimeError ( 'could not process response from rtladsb' ) except Exception as e : traceback . print_exc ( file = sys . stderr ) print ( "An error occurred reading from the proxy websocket" ) self . kismet . send_datasource_error_report ( message = "Error handling ADSB: {}" . format ( e ) ) finally : self . kill_proxy ( ) self . kismet . spindown ( ) return