public function setFrame($frame) { /** * If there are no write attribute status records in the constructed command, indicating that all attributes were * written successfully, a single write attribute status record shall be included in the * command, with the status field set to SUCCESS and the attribute identifier field * omitted. */ if (strlen($frame) == 1) { $status = Buffer::unpackInt8u($frame); if ($status != ZCLStatus::SUCCESS) { throw new ZigbeeException("If a " . __CLASS__ . " only has one byte, it should be the SUCCESS status"); } return; } else { while (strlen($frame)) { $write_attribute_status_record = new WriteAttributeStatusRecord(); $write_attribute_status_record->consumeFrame($frame); $this->write_attribute_status_records[] = $write_attribute_status_record; } } }