src/Server/Asyn/MQTT/Message/Base.php
final protected function processReadFixedHeaderWithMsgID($message)
    {
        $packet_length = 4;
        $name = Message::$name[$this->message_type];

        if (!isset($message[$packet_length - 1])) {
            # error
            Debug::Log(Debug::DEBUG, "Message {$name}: error on reading");
            return false;
        }

        $packet = unpack('Ccmd/Clength/nmsgid', $message);

        $packet['cmd'] = Utility::UnpackCommand($packet['cmd']);

        if ($packet['cmd']['message_type'] != $this->getMessageType()) {
            Debug::Log(Debug::DEBUG, "Message {$name}: type mismatch");
            return false;
        } else {
            Debug::Log(Debug::DEBUG, "Message {$name}: success");
            return $packet;
        }
    }
final protected function processReadFixedHeaderWithMsgID($message)
    {
        $packet_length = 4;
        $name = Message::$name[$this->message_type];

        if (!isset($message[$packet_length - 1])) {
            # error
            Debug::Log(Debug::DEBUG, "Message {$name}: error on reading");
            return false;
        }

        $packet = unpack('Ccmd/Clength/nmsgid', $message);

        $packet['cmd'] = Utility::UnpackCommand($packet['cmd']);

        if ($packet['cmd']['message_type'] != $this->getMessageType()) {
            Debug::Log(Debug::DEBUG, "Message {$name}: type mismatch");
            return false;
        } else {
            Debug::Log(Debug::DEBUG, "Message {$name}: success");
            return $packet;
        }
    }
final protected function processReadFixedHeaderWithMsgID ( $ message ) { $ packet_length = 4 ; $ name = Message :: $ name [ $ this -> message_type ] ; if ( ! isset ( $ message [ $ packet_length - 1 ] ) ) { # error Debug :: Log ( Debug :: DEBUG , "Message {$name}: error on reading" ) ; return false ; } $ packet = unpack ( 'Ccmd/Clength/nmsgid' , $ message ) ; $ packet [ 'cmd' ] = Utility :: UnpackCommand ( $ packet [ 'cmd' ] ) ; if ( $ packet [ 'cmd' ] [ 'message_type' ] != $ this -> getMessageType ( ) ) { Debug :: Log ( Debug :: DEBUG , "Message {$name}: type mismatch" ) ; return false ; } else { Debug :: Log ( Debug :: DEBUG , "Message {$name}: success" ) ; return $ packet ; } }
Process packet with Fixed Header + Message Identifier only

@param string $message
@return array|bool
Process packet with Fixed Header + Message Identifier only