public function setFrame($frame) { $this->setStatus(Buffer::unpackInt8u($frame)); if ($this->getStatus() == Status::SUCCESS) { $this->setRoutingTableEntries(Buffer::unpackInt8u($frame)); $this->setStartIndex(Buffer::unpackInt8u($frame)); $routing_table_list_count = Buffer::unpackInt8u($frame); for ($i = 0; $i < $routing_table_list_count; $i++) { $routing_descriptor = new RoutingDescriptor(); $routing_descriptor->consumeFrame($frame); $this->addRoutingDescriptor($routing_descriptor); } } }
public function testInclusionByStaticConstructor() { $base_frame = MgmtRtgRspCommand::constructSuccess(80, 10, [RoutingDescriptor::construct(0x1234, RoutingDescriptor::VALIDATION_UNDERWAY, 1, 0, 1, 0xabcd), RoutingDescriptor::construct(0x2347, RoutingDescriptor::ACTIVE, 1, 1, 0, 0xabcd)]); $transaction_id = 20; $parent = ZDPFrame::construct($base_frame, $transaction_id); $this->assertInstanceOf("Munisense\\Zigbee\\ZDP\\Network\\MgmtRtgRspCommand", $parent->getPayloadObject()); $this->assertEquals($base_frame->displayFrame(), $parent->displayPayload()); }