/**
  * @param string $frame
  */
 function setFrame($frame)
 {
     $zone_status = new ZoneStatus();
     $zone_status->setValue(Buffer::unpackInt16u($frame));
     $this->setZoneStatus($zone_status);
     $this->setExtendedStatus(Buffer::unpackInt8u($frame));
 }
 public function setFrame($frame)
 {
     $this->setNwkAddrOfInterest(Buffer::unpackInt16u($frame));
     // User Descriptor Length, unused, but may not remain in buffer
     Buffer::unpackInt8u($frame);
     $this->setUserDescriptor(new UserDescriptor($frame));
 }
示例#3
0
 /**
  * Set all parameters of this object by parsing a frame
  *
  * @param string $frame Byte string of the APS frame
  * @return void
  * @throws ZigbeeException
  */
 public function setFrame($frame)
 {
     $this->setFrameControl(Buffer::unpackInt8u($frame));
     if ($this->isGroupAddressPresent()) {
         $this->setGroupAddress(Buffer::unpackInt16u($frame));
     }
     if ($this->isDestinationEndpointPresent()) {
         $this->setDestinationEndpoint(Buffer::unpackInt8u($frame));
     }
     if ($this->isClusterIdPresent()) {
         $this->setClusterId(Buffer::unpackInt16u($frame));
     }
     if ($this->isProfileIdPresent()) {
         $this->setProfileId(Buffer::unpackInt16u($frame));
     }
     if ($this->isSourceEndpointPresent()) {
         $this->setSourceEndpoint(Buffer::unpackInt8u($frame));
     }
     $this->setApsCounter(Buffer::unpackInt8u($frame));
     if ($this->isExtHeaderPresent()) {
         $this->setExtHeader(Buffer::unpackInt8u($frame));
     }
     if ($this->isFragBlockNumberPresent()) {
         $this->setFragBlockNumber(Buffer::unpackInt8u($frame));
     }
     if ($this->isFragAckBitfieldPresent()) {
         $this->setFragAckBitfield(Buffer::unpackInt8u($frame));
     }
     if ($this->isPayloadPresent()) {
         $this->setPayload($frame);
     } elseif (strlen($frame) > 0) {
         throw new ZigbeeException("Unparsed data (" . strlen($frame) . " bytes) at end of frame");
     }
 }
 public function setFrame($frame)
 {
     $this->setStatus(Buffer::unpackInt8u($frame));
     $this->setNwkAddrOfInterest(Buffer::unpackInt16u($frame));
     if ($this->getStatus() == Status::SUCCESS) {
         $this->setNodeDescriptor(new NodeDescriptor($frame));
     }
 }
 public function setFrame($frame)
 {
     while (strlen($frame)) {
         $attribute_identifier = new AttributeIdentifier();
         $attribute_identifier->setAttributeId(Buffer::unpackInt16u($frame));
         $this->attribute_identifiers[] = $attribute_identifier;
     }
 }
 public function consumeFrame(&$frame)
 {
     $this->setAttributeId(Buffer::unpackInt16u($frame));
     $this->setStatus(Buffer::unpackInt8u($frame));
     if ($this->getStatus() == ZCLStatus::SUCCESS) {
         $this->setDatatypeId(Buffer::unpackInt8u($frame));
         $this->setValue(Buffer::unpackDatatype($frame, $this->getDatatypeId()));
     }
 }
 public function setFrame($frame)
 {
     $this->setStatus(Buffer::unpackInt8u($frame));
     $this->setNwkAddrOfInterest(Buffer::unpackInt16u($frame));
     // Simple Descriptor Length, unused, but may not remain in buffer
     Buffer::unpackInt8u($frame);
     if ($this->getStatus() == Status::SUCCESS) {
         $this->setSimpleDescriptor(new SimpleDescriptor($frame));
     }
 }
 public function consumeFrame(&$frame)
 {
     $this->setDestinationAddress(Buffer::unpackInt16u($frame));
     $byte1 = Buffer::unpackInt8u($frame);
     $this->setStatus(($byte1 & 7) >> 0);
     $this->setMemoryConstrained(($byte1 & 8) >> 3);
     $this->setManyToOne(($byte1 & 16) >> 4);
     $this->setRouteRecordRequired(($byte1 & 32) >> 5);
     $this->setNextHopAddress(Buffer::unpackInt16u($frame));
 }
示例#9
0
 public function setFrame($frame)
 {
     $this->setFrameControl(Buffer::unpackInt8u($frame));
     if ($this->getManufacturerIdPresent()) {
         $this->setManufacturerId(Buffer::unpackInt16u($frame));
     }
     $this->setTransactionId(Buffer::unpackInt8u($frame));
     $this->setCommandId(Buffer::unpackInt8u($frame));
     $this->setPayload($frame);
 }
 public function setFrame($frame)
 {
     $this->setStatus(Buffer::unpackInt8u($frame));
     $this->setNwkAddrOfInterest(Buffer::unpackInt16u($frame));
     if ($this->getStatus() == Status::SUCCESS) {
         $active_ep_count = Buffer::unpackInt8u($frame);
         for ($i = 0; $i < $active_ep_count; $i++) {
             $this->addActiveEP(Buffer::unpackInt8u($frame));
         }
     }
 }
 public function setFrame($frame)
 {
     $this->setStatus(Buffer::unpackInt8u($frame));
     $this->setNwkAddrOfInterest(Buffer::unpackInt16u($frame));
     $this->setEndpoint(Buffer::unpackInt8u($frame));
     $this->setAppInputClusterCount(Buffer::unpackInt8u($frame));
     $this->setAppOutputClusterCount(Buffer::unpackInt8u($frame));
     $this->setStartIndex(Buffer::unpackInt8u($frame));
     while (strlen($frame) > 0) {
         $this->addAppClusterListElement(Buffer::unpackInt16u($frame));
     }
 }
 public function consumeFrame(&$frame)
 {
     $this->setDirection(Buffer::unpackInt8u($frame));
     $this->setAttributeId(Buffer::unpackInt16u($frame));
     if ($this->getDirection() === self::DIRECTION_SERVER_TO_CLIENT) {
         $this->setDatatypeId(Buffer::unpackInt8u($frame));
         $this->setMinimumReportingInterval(Buffer::unpackInt16u($frame));
         $this->setMaximumReportingInterval(Buffer::unpackInt16u($frame));
         $this->setReportableChange(Buffer::unpackDatatype($frame, $this->getDatatypeId()));
     } else {
         $this->setTimeoutPeriod(Buffer::unpackInt16u($frame));
     }
 }
 public function consumeFrame(&$frame)
 {
     $this->setExtendedPanId(Buffer::unpackEui64($frame));
     $this->setExtendedAddress(Buffer::unpackEui64($frame));
     $this->setNetworkAddress(Buffer::unpackInt16u($frame));
     $byte1 = Buffer::unpackInt8u($frame);
     $this->setDeviceType(($byte1 & 3) >> 0);
     $this->setRxOnWhenIdle(($byte1 & 12) >> 2);
     $this->setRelationship(($byte1 & 112) >> 5);
     $byte2 = Buffer::unpackInt8u($frame);
     $this->setPermitJoining($byte2 & 3);
     $this->setDepth(Buffer::unpackInt8u($frame));
     $this->setLqi(Buffer::unpackInt8u($frame));
 }
 public function setFrame($frame)
 {
     $this->setStatus(Buffer::unpackInt8u($frame));
     $this->setIeeeAddressRemoteDev(Buffer::unpackEui64($frame));
     $this->setNwkAddrRemoteDev(Buffer::unpackInt16u($frame));
     if (strlen($frame) > 0) {
         $this->setRequestType(self::REQUEST_TYPE_EXTENDED);
         $num_assoc_dev = Buffer::unpackInt8u($frame);
         // If there are any devices listed
         if ($num_assoc_dev > 0) {
             $this->setStartIndex(Buffer::unpackInt8u($frame));
             for ($i = 0; $i < $num_assoc_dev; $i++) {
                 $this->addAssociatedDevice(Buffer::unpackInt16u($frame));
             }
         }
     }
 }
 /**
  * @param string $frame
  */
 function setFrame($frame)
 {
     $this->setEndpoint(Buffer::unpackInt8u($frame));
     $this->setApplicationProfileIdentifier(Buffer::unpackInt16u($frame));
     $this->setApplicationDeviceIdentifier(Buffer::unpackInt16u($frame));
     // Device Version is in the first 4 bits
     $byte1 = Buffer::unpackInt8u($frame);
     $this->setApplicationDeviceVersion(($byte1 & 0b1111) >> 0);
     $input_cluster_count = Buffer::unpackInt8u($frame);
     for ($i = 0; $i < $input_cluster_count; $i++) {
         $this->addApplicationInputCluster(Buffer::unpackInt16u($frame));
     }
     $output_cluster_count = Buffer::unpackInt8u($frame);
     for ($i = 0; $i < $output_cluster_count; $i++) {
         $this->addApplicationOutputCluster(Buffer::unpackInt16u($frame));
     }
 }
 public function setFrame($frame)
 {
     $this->setNwkAddress(Buffer::unpackInt16u($frame));
     $this->setRequestType(Buffer::unpackInt8u($frame));
     $this->setStartIndex(Buffer::unpackInt8u($frame));
 }
 function setFrame($frame)
 {
     $this->setStartAttributeIdentifier(Buffer::unpackInt16u($frame));
     $this->setMaximumAttributeIdentifiers(Buffer::unpackInt8u($frame));
 }
 public function setFrame($frame)
 {
     $this->setNwkAddressOfInterest(Buffer::unpackInt16u($frame));
     $this->setEndpoint(Buffer::unpackInt8u($frame));
     $this->setStartIndex(Buffer::unpackInt8u($frame));
 }
示例#19
0
 public static function validateChecksum($frame)
 {
     $checksum_frame = self::generateChecksum($frame);
     Buffer::unpackInt8u($frame);
     $checksum_field = Buffer::unpackInt16u($frame);
     if ($checksum_field === $checksum_frame) {
         return true;
     }
     return false;
 }
 public function setFrame($frame)
 {
     $this->setStatus(Buffer::unpackInt8u($frame));
     $this->setNwkAddrOfInterest(Buffer::unpackInt16u($frame));
 }
示例#21
0
 /**
  * @param string $frame
  */
 function setFrame($frame)
 {
     $byte1 = Buffer::unpackInt8u($frame);
     $this->setLogicalType(($byte1 & 7) >> 0);
     $this->setComplexDescriptorAvailable(($byte1 & 8) >> 3);
     $this->setUserDescriptorAvailable(($byte1 & 16) >> 4);
     $byte2 = Buffer::unpackInt8u($frame);
     $this->setApsFlags(($byte2 & 7) >> 0);
     $this->setFrequencyBand(($byte2 & 248) >> 3);
     $byte_mac = Buffer::unpackInt8u($frame);
     $this->setMacCapabilityAlternatePanCoordinator(($byte_mac & 1) >> 0);
     $this->setMacCapabilityDeviceType(($byte_mac & 2) >> 1);
     $this->setMacCapabilityPowerSource(($byte_mac & 4) >> 2);
     $this->setMacCapabilityReceiverOnWhenIdle(($byte_mac & 8) >> 3);
     $this->setMacCapabilitySecurityCapability(($byte_mac & 64) >> 6);
     $this->setMacCapabilityAllocateAddress(($byte_mac & 128) >> 7);
     $this->setManufacturerCode(Buffer::unpackInt16u($frame));
     $this->setMaximumBufferSize(Buffer::unpackInt8u($frame));
     $this->setMaximumIncomingTransferSize(Buffer::unpackInt16u($frame));
     $this->setServerMask(Buffer::unpackInt16u($frame));
     $this->setMaximumOutgoingTransferSize(Buffer::unpackInt16u($frame));
     $byte_descriptor = Buffer::unpackInt8u($frame);
     $this->setExtendedActiveEndpointListAvailable(($byte_descriptor & 1) >> 0);
     $this->setExtendedSimpleDescriptorListAvailable(($byte_descriptor & 2) >> 1);
 }
 public function consumeFrame(&$frame)
 {
     $this->setAttributeId(Buffer::unpackInt16u($frame));
     $this->setDatatypeId(Buffer::unpackInt8u($frame));
 }
 public function setFrame($frame)
 {
     $this->setAttributeId(Buffer::unpackInt16u($frame));
 }