Exemplo n.º 1
0
 /**
  * This method tries to find a class for a given cluster and command_id
  *
  * @param $command_id
  * @param int $frame_type
  * @param int $cluster_id
  * @return string Classname
  * @throws ZigbeeException When no class could be found
  */
 protected function findClassOfPayload($command_id, $frame_type = self::FRAME_TYPE_PROFILE_WIDE, $cluster_id = null)
 {
     if ($frame_type == self::FRAME_TYPE_PROFILE_WIDE) {
         if (isset(General\GeneralCommand::$command[$command_id])) {
             return General\GeneralCommand::$command[$command_id]["class"];
         }
     } elseif ($cluster_id != null) {
         $cluster = ClusterFactory::getClusterClassInstance($cluster_id);
         $cluster_command = $cluster->getClusterSpecificCommand($command_id);
         return $cluster_command;
     }
     throw new ZigbeeException("Payload class for command ID " . $this->displayCommandId() . " not found");
 }
 /**
  * @throws \Munisense\Zigbee\Exception\ZigbeeException
  * @expectedException \Munisense\Zigbee\Exception\ZigbeeException
  */
 public function testgetClusterClassInstance__Invalid()
 {
     ClusterFactory::getClusterClassInstance(0xffff);
 }