public static function construct($direction, $attribute_id)
 {
     $element = new self();
     $element->setDirection($direction);
     $element->setAttributeId($attribute_id);
     return $element;
 }
 /**
  * If there is an error code, we do not need the full AttributeReportingConfigurationRecord
  *
  * @param $status
  * @param $direction
  * @param $attribute_id
  * @return AttributeReportingConfigurationStatusRecord
  */
 public static function constructWithError($status, $direction, $attribute_id)
 {
     $element = new self();
     $element->setStatus($status);
     $element->setDirection($direction);
     $element->setAttributeId($attribute_id);
     return $element;
 }
 public static function constructReceived($attribute_id, $timeout_period)
 {
     $frame = new self();
     $frame->setAttributeId($attribute_id);
     $frame->setDirection(self::DIRECTION_CLIENT_TO_SERVER);
     $frame->setTimeoutPeriod($timeout_period);
     return $frame;
 }
Example #4
0
 /**
  * Helper method to create a ZCL Frame
  *
  * @param IZCLCommandFrame $payload
  * @param int $manufacturer_id Optional Manufacturer ID
  * @param int $direction Direction
  * @param int $disable_default_response Disable default response
  * @param int $transaction_id Optional Transaction ID
  * @return ZCLFrame The Constructed ZCLFrame
  * @throws ZigbeeException If there were problems with composing the ZCL Frame
  */
 public static function construct(IZCLCommandFrame $payload = null, $manufacturer_id = null, $direction = self::DIRECTION_SERVER_TO_CLIENT, $disable_default_response = self::DEFAULT_RESPONSE_ENABLED, $transaction_id = null)
 {
     $frame = new self();
     if ($manufacturer_id !== null) {
         $frame->setManufacturerIdPresent(true);
         $frame->setManufacturerId($manufacturer_id);
     }
     $frame->setDirection($direction);
     $frame->setDisableDefaultResponse($disable_default_response);
     if ($transaction_id !== null) {
         $frame->setTransactionId($transaction_id);
     }
     if ($payload !== null) {
         $frame->setPayloadObject($payload);
     }
     return $frame;
 }