docs: def MGMT_ACTIVE_SET(self, sAddr='', xCommissioningSessionId=None, listActiveTimestamp=None, listChannelMask=None, xExtendedPanId=None,
                          sNetworkName=None, sPSKc=None, listSecurityPolicy=None, xChannel=None, sMeshLocalPrefix=None, xMasterKey=None,
                          xPanId=None, xTmfPort=None, xSteeringData=None, xBorderRouterLocator=None, BogusTLV=None, xDelayTimer=None):
          """send MGMT_ACTIVE_SET command
  
          Returns:
              True: successful to send MGMT_ACTIVE_SET
              False: fail to send MGMT_ACTIVE_SET
          """
          print '%s call MGMT_ACTIVE_SET' % self.port
          try:
              cmd = 'dataset mgmtsetcommand active'
  
              if listActiveTimestamp != None:
                  cmd += ' activetimestamp '
                  cmd += str(listActiveTimestamp[0])
  
              if xExtendedPanId != None:
                  cmd += ' extpanid '
                  xpanid = self.__convertLongToString(xExtendedPanId)
  
                  if len(xpanid) < 16:
                      xpanid = xpanid.zfill(16)
  
                  cmd += xpanid
  
              if sNetworkName != None:
                  cmd += ' networkname '
                  cmd += str(sNetworkName)
  
              if xChannel != None:
                  cmd += ' channel '
                  cmd += str(xChannel)
  
              if sMeshLocalPrefix != None:
                  cmd += ' localprefix '
                  cmd += str(sMeshLocalPrefix)
  
              if xMasterKey != None:
                  cmd += ' masterkey '
                  key = self.__convertLongToString(xMasterKey)
  
                  if len(key) < 32:
                      key = key.zfill(32)
  
                  cmd += key
  
              if xPanId != None:
                  cmd += ' panid '
                  cmd += str(xPanId)
  
              if listChannelMask != None:
                  cmd += ' channelmask '
                  cmd += '0x' + self.__convertLongToString(self.__convertChannelMask(listChannelMask))
  
              if sPSKc != None or listSecurityPolicy != None or \
                 xCommissioningSessionId != None or xTmfPort != None or xSteeringData != None or xBorderRouterLocator != None or \
                 BogusTLV != None:
                  cmd += ' binary '
  
              if sPSKc != None:
                  cmd += '0410'
                  stretchedPskc = Thread_PBKDF2.get(sPSKc,ModuleHelper.Default_XpanId,ModuleHelper.Default_NwkName)
                  pskc = hex(stretchedPskc).rstrip('L').lstrip('0x')
  
                  if len(pskc) < 32:
                      pskc = pskc.zfill(32)
  
                  cmd += pskc
  
              if listSecurityPolicy != None:
                  cmd += '0c03'
  
                  rotationTime = 0
                  policyBits = 0
  
                  # previous passing way listSecurityPolicy=[True, True, 3600, False, False, True]
                  if (len(listSecurityPolicy) == 6):
                      rotationTime = listSecurityPolicy[2]
  
                      # the last three reserved bits must be 1
                      policyBits = 0b00000111
  
                      if listSecurityPolicy[0]:
                          policyBits = policyBits | 0b10000000
                      if listSecurityPolicy[1]:
                          policyBits = policyBits | 0b01000000
                      if listSecurityPolicy[3]:
                          policyBits = policyBits | 0b00100000
                      if listSecurityPolicy[4]:
                          policyBits = policyBits | 0b00010000
                      if listSecurityPolicy[5]:
                          policyBits = policyBits | 0b00001000
                  else:
                      # new passing way listSecurityPolicy=[3600, 0b11001111]
                      rotationTime = listSecurityPolicy[0]
                      policyBits = listSecurityPolicy[1]
  
                  policy = str(hex(rotationTime))[2:]
  
                  if len(policy) < 4:
                      policy = policy.zfill(4)
  
                  cmd += policy
  
                  cmd += str(hex(policyBits))[2:]
  
              if xCommissioningSessionId != None:
                  cmd += '0b02'
                  sessionid = str(hex(xCommissioningSessionId))[2:]
  
                  if len(sessionid) < 4:
                      sessionid = sessionid.zfill(4)
  
                  cmd += sessionid
  
              if xBorderRouterLocator != None:
                  cmd += '0902'
                  locator = str(hex(xBorderRouterLocator))[2:]
  
                  if len(locator) < 4:
                      locator = locator.zfill(4)
  
                  cmd += locator
  
              if xSteeringData != None:
                  steeringData = self.__convertLongToString(xSteeringData)
                  cmd += '08' + str(len(steeringData)/2).zfill(2)
                  cmd += steeringData
  
              if BogusTLV != None:
                  cmd += "8202aa55"
  
              print cmd
  
              return self.__sendCommand(cmd)[0] == 'Done'
  
          except Exception, e:
              ModuleHelper.WriteIntoDebugLogger("MGMT_ACTIVE_SET() Error: " + str(e))