Beispiel #1
0
 /**
  * Decode Variable Header
  * Topic, Packet Identifier
  *
  * @param string & $packet_data
  * @param int    & $pos
  * @return bool
  */
 protected function decodeVariableHeader(&$packet_data, &$pos)
 {
     $topic = Utility::UnpackStringWithLength($packet_data, $pos);
     $this->message->setTopic($topic);
     if ($this->getQos() > 0) {
         # Decode Packet Identifier if QoS > 0
         $this->decodePacketIdentifier($packet_data, $pos);
     }
     return true;
 }