crc = array_shift($crc); $magic = Decoder::unpack(Decoder::BIT_B8, substr($msg, $offset, 1)); $this->magic = array_shift($magic); $offset += 1; $attr = Decoder::unpack(Decoder::BIT_B8, substr($msg, $offset, 1)); $this->attribute = array_shift($attr); $offset += 1; $keyLen = Decoder::unpack(Decoder::BIT_B32, substr($msg, $offset, 4)); $keyLen = array_shift($keyLen); $offset += 4; if ($keyLen > 0 && $keyLen != 0xFFFFFFFF) { $this->key = substr($msg, $offset, $keyLen); $offset += $keyLen; } $messageSize = Decoder::unpack(Decoder::BIT_B32, substr($msg, $offset, 4)); $messageSize = array_shift($messageSize); $offset += 4; if ($messageSize) { $this->value = substr($msg, $offset, $messageSize); } } // }}} // {{{ public function getMessage() /** * get message data * * @access public * @return string (raw) */ public function getMessage() { return $this->value; } // }}} // {{{ public function getMessageKey() /** * get message key * * @access public * @return string (raw) */ public function getMessageKey() { return $this->key; } // }}} // {{{ public function __toString() /** * __toString * * @access public * @return void */ public function __toString() { return $this->value; } // }}} // }}} }