original_docstring:  MsgType=AB - Panel Powerlink Messages 
docstring: MsgType=AB - Panel Powerlink Messages
docstring_tokens: MsgType = AB - Panel Powerlink Messages
code: def handle_msgtypeAB(self, data): # PowerLink Message
          """ MsgType=AB - Panel Powerlink Messages """
          log.info("[handle_msgtypeAB]  data {0}".format(self.toString(data)))
          self.pmSendAck(True)
  
          # Restart the timer
          self.reset_watchdog_timeout()
  
          subType = self.ReceiveData[2]
          if subType == 3: # keepalive message
              # Example 0D AB 03 00 1E 00 31 2E 31 35 00 00 43 2A 0A
              log.info("[handle_msgtypeAB] ***************************** Got PowerLink Keep-Alive ****************************")
              # set downloading to False, if we are getting keep alive messages from the panel then we are not downloading
              # It is possible to receive this between enrolling (when the panel accepts the enroll successfully) and the EPROM download
              #     I suggest we simply ignore it
              if not self.pmPowerlinkMode:
                  if self.DownloadMode:
                      log.info("[handle_msgtypeAB]         Got alive message while not in Powerlink mode but we're in Download mode")
                  else:
                      log.info("[handle_msgtypeAB]         Got alive message while not in Powerlink mode and not in Download mode")
                  #self.SendCommand("MSG_RESTORE") # also gives status
              else:
                  self.DumpSensorsToDisplay()
          elif subType == 5: # -- phone message
              action = self.ReceiveData[4]
              if action == 1:
                  log.debug("[handle_msgtypeAB] PowerLink Phone: Calling User")
                  #pmMessage("Calling user " + pmUserCalling + " (" + pmPhoneNr_t[pmUserCalling] +  ").", 2)
                  #pmUserCalling = pmUserCalling + 1
                  #if (pmUserCalling > pmPhoneNr_t) then
                  #    pmUserCalling = 1
              elif action == 2:
                  log.debug("[handle_msgtypeAB] PowerLink Phone: User Acknowledged")
                  #pmMessage("User " .. pmUserCalling .. " acknowledged by phone.", 2)
                  #pmUserCalling = 1
              else:
                  log.debug("[handle_msgtypeAB] PowerLink Phone: Unknown Action {0}".format(hex(self.ReceiveData[3]).upper()))
          elif subType == 10 and self.ReceiveData[4] == 0:
              log.debug("[handle_msgtypeAB] PowerLink telling us what the code is for downloads, currently commented out as I'm not certain of this")
              #DownloadCode[0] = self.ReceiveData[5]
              #DownloadCode[1] = self.ReceiveData[6]
          elif subType == 10 and self.ReceiveData[4] == 1 and not self.doneAutoEnroll:
              if not self.ForceStandardMode:
                  log.info("[handle_msgtypeAB] PowerLink most likely wants to auto-enroll, only doing auto enroll once")
                  self.DownloadMode = False
                  self.SendMsg_ENROLL()
          elif subType == 10 and self.ReceiveData[4] == 1:
              self.DownloadMode = False
              self.doneAutoEnroll = False
              asyncio.ensure_future(self.coordinate_powerlink_startup(4), loop = self.loop)
code_tokens: def handle_msgtypeAB ( self , data ) : log . info ( "[handle_msgtypeAB]  data {0}" . format ( self . toString ( data ) ) ) self . pmSendAck ( True ) self . reset_watchdog_timeout ( ) subType = self . ReceiveData [ 2 ] if subType == 3 : log . info ( "[handle_msgtypeAB] ***************************** Got PowerLink Keep-Alive ****************************" ) if not self . pmPowerlinkMode : if self . DownloadMode : log . info ( "[handle_msgtypeAB]         Got alive message while not in Powerlink mode but we're in Download mode" ) else : log . info ( "[handle_msgtypeAB]         Got alive message while not in Powerlink mode and not in Download mode" ) else : self . DumpSensorsToDisplay ( ) elif subType == 5 : action = self . ReceiveData [ 4 ] if action == 1 : log . debug ( "[handle_msgtypeAB] PowerLink Phone: Calling User" ) elif action == 2 : log . debug ( "[handle_msgtypeAB] PowerLink Phone: User Acknowledged" ) else : log . debug ( "[handle_msgtypeAB] PowerLink Phone: Unknown Action {0}" . format ( hex ( self . ReceiveData [ 3 ] ) . upper ( ) ) ) elif subType == 10 and self . ReceiveData [ 4 ] == 0 : log . debug ( "[handle_msgtypeAB] PowerLink telling us what the code is for downloads, currently commented out as I'm not certain of this" ) elif subType == 10 and self . ReceiveData [ 4 ] == 1 and not self . doneAutoEnroll : if not self . ForceStandardMode : log . info ( "[handle_msgtypeAB] PowerLink most likely wants to auto-enroll, only doing auto enroll once" ) self . DownloadMode = False self . SendMsg_ENROLL ( ) elif subType == 10 and self . ReceiveData [ 4 ] == 1 : self . DownloadMode = False self . doneAutoEnroll = False asyncio . ensure_future ( self . coordinate_powerlink_startup ( 4 ) , loop = self . loop )
short_docstring: MsgType=AB - Panel Powerlink Messages
short_docstring_tokens: MsgType = AB - Panel Powerlink Messages
comment: # PowerLink Message$SEP$""" MsgType=AB - Panel Powerlink Messages """$SEP$# Restart the timer$SEP$# keepalive message$SEP$# Example 0D AB 03 00 1E 00 31 2E 31 35 00 00 43 2A 0A$SEP$# set downloading to False, if we are getting keep alive messages from the panel then we are not downloading$SEP$# It is possible to receive this between enrolling (when the panel accepts the enroll successfully) and the EPROM download$SEP$#     I suggest we simply ignore it$SEP$#self.SendCommand("MSG_RESTORE") # also gives status$SEP$# -- phone message$SEP$#pmMessage("Calling user " + pmUserCalling + " (" + pmPhoneNr_t[pmUserCalling] +  ").", 2)$SEP$#pmUserCalling = pmUserCalling + 1$SEP$#if (pmUserCalling > pmPhoneNr_t) then$SEP$#    pmUserCalling = 1$SEP$#pmMessage("User " .. pmUserCalling .. " acknowledged by phone.", 2)$SEP$#pmUserCalling = 1$SEP$#DownloadCode[0] = self.ReceiveData[5]$SEP$#DownloadCode[1] = self.ReceiveData[6]