original_docstring: Handle one raw incoming packet.
docstring: Handle one raw incoming packet.
docstring_tokens: Handle one raw incoming packet .
code: def handle_packet(self, packet):
          """Handle one raw incoming packet."""
  
          # during early initialisation we need to ignore all incoming data to establish a known state in the panel
          if self.coordinating_powerlink:
              self.receive_log.append(packet)
              return
  
          log.debug("[handle_packet] Parsing complete valid packet: %s", self.toString(packet))
  
          if len(packet) < 4:  # there must at least be a header, command, checksum and footer
              log.warning("[handle_packet] Received invalid packet structure, not processing it " + self.toString(packet))
          elif packet[1] == 0x02: # ACK
              self.handle_msgtype02(packet[2:-2])  # remove the header and command bytes as the start. remove the footer and the checksum at the end
          elif packet[1] == 0x06: # Timeout
              self.handle_msgtype06(packet[2:-2])
          elif packet[1] == 0x08: # Access Denied
              self.handle_msgtype08(packet[2:-2])
          elif packet[1] == 0x0B: # Stopped
              self.handle_msgtype0B(packet[2:-2])
          elif packet[1] == 0x25: # Download retry
              self.handle_msgtype25(packet[2:-2])
          elif packet[1] == 0x33: # Settings send after a MSGV_START
              self.handle_msgtype33(packet[2:-2])
          elif packet[1] == 0x3c: # Message when start the download
              self.handle_msgtype3C(packet[2:-2])
          elif packet[1] == 0x3f: # Download information
              self.handle_msgtype3F(packet[2:-2])
          elif packet[1] == 0xa0: # Event log
              self.handle_msgtypeA0(packet[2:-2])
          elif packet[1] == 0xa3: # Event log
              self.handle_msgtypeA3(packet[2:-2])
          elif packet[1] == 0xa5: # General Event
              self.handle_msgtypeA5(packet[2:-2])
          elif packet[1] == 0xa6: # General Event
              self.handle_msgtypeA6(packet[2:-2])
          elif packet[1] == 0xa7: # General Event
              self.handle_msgtypeA7(packet[2:-2])
          elif packet[1] == 0xab and not self.ForceStandardMode: # PowerLink Event. Only process AB if not forced standard
              self.handle_msgtypeAB(packet[2:-2])
          elif packet[1] == 0xb0: # PowerMaster Event
              self.handle_msgtypeB0(packet[2:-2])
          else:
              log.info("[handle_packet] Unknown/Unhandled packet type {0}".format(packet[1:2]))
          # clear our buffer again so we can receive a new packet.
          self.ReceiveData = bytearray(b'')
code_tokens: def handle_packet ( self , packet ) : if self . coordinating_powerlink : self . receive_log . append ( packet ) return log . debug ( "[handle_packet] Parsing complete valid packet: %s" , self . toString ( packet ) ) if len ( packet ) < 4 : log . warning ( "[handle_packet] Received invalid packet structure, not processing it " + self . toString ( packet ) ) elif packet [ 1 ] == 0x02 : self . handle_msgtype02 ( packet [ 2 : - 2 ] ) elif packet [ 1 ] == 0x06 : self . handle_msgtype06 ( packet [ 2 : - 2 ] ) elif packet [ 1 ] == 0x08 : self . handle_msgtype08 ( packet [ 2 : - 2 ] ) elif packet [ 1 ] == 0x0B : self . handle_msgtype0B ( packet [ 2 : - 2 ] ) elif packet [ 1 ] == 0x25 : self . handle_msgtype25 ( packet [ 2 : - 2 ] ) elif packet [ 1 ] == 0x33 : self . handle_msgtype33 ( packet [ 2 : - 2 ] ) elif packet [ 1 ] == 0x3c : self . handle_msgtype3C ( packet [ 2 : - 2 ] ) elif packet [ 1 ] == 0x3f : self . handle_msgtype3F ( packet [ 2 : - 2 ] ) elif packet [ 1 ] == 0xa0 : self . handle_msgtypeA0 ( packet [ 2 : - 2 ] ) elif packet [ 1 ] == 0xa3 : self . handle_msgtypeA3 ( packet [ 2 : - 2 ] ) elif packet [ 1 ] == 0xa5 : self . handle_msgtypeA5 ( packet [ 2 : - 2 ] ) elif packet [ 1 ] == 0xa6 : self . handle_msgtypeA6 ( packet [ 2 : - 2 ] ) elif packet [ 1 ] == 0xa7 : self . handle_msgtypeA7 ( packet [ 2 : - 2 ] ) elif packet [ 1 ] == 0xab and not self . ForceStandardMode : self . handle_msgtypeAB ( packet [ 2 : - 2 ] ) elif packet [ 1 ] == 0xb0 : self . handle_msgtypeB0 ( packet [ 2 : - 2 ] ) else : log . info ( "[handle_packet] Unknown/Unhandled packet type {0}" . format ( packet [ 1 : 2 ] ) ) self . ReceiveData = bytearray ( b'' )
short_docstring: Handle one raw incoming packet.
short_docstring_tokens: Handle one raw incoming packet .
comment: """Handle one raw incoming packet."""$SEP$# during early initialisation we need to ignore all incoming data to establish a known state in the panel$SEP$# there must at least be a header, command, checksum and footer$SEP$# ACK$SEP$# remove the header and command bytes as the start. remove the footer and the checksum at the end$SEP$# Timeout$SEP$# Access Denied$SEP$# Stopped$SEP$# Download retry$SEP$# Settings send after a MSGV_START$SEP$# Message when start the download$SEP$# Download information$SEP$# Event log$SEP$# Event log$SEP$# General Event$SEP$# General Event$SEP$# General Event$SEP$# PowerLink Event. Only process AB if not forced standard$SEP$# PowerMaster Event$SEP$# clear our buffer again so we can receive a new packet.