anchor.diff:                      writeln ('Error: 2:');
                       rxState := 3;
                   end;
  -                FCurrentData := CurrentMessage;
                   Synchronize(@HandleData);
                   rxState := 0;
               end;
  
positive.code:       if (MessageType = Ord(MQTT.PUBLISH)) then
          begin
            // Read the Length Bytes
            DataLen := BytesToStrLength(Copy(FCurrentData.Data, 0, 2));
            // Get the Topic
            SetString(Topic, PChar(@FCurrentData.Data[2]), DataLen);
            // Get the Payload
            SetString(Payload, PChar(@FCurrentData.Data[2 + DataLen]), (Length(FCurrentData.Data) - 2 - DataLen));
            if Assigned(OnPublish) then OnPublish(Self, Topic, Payload);
          end
        else
        if (MessageType = Ord(MQTT.SUBACK)) then
          begin
            // Reading the Message ID
            ResponseVH := Copy(FCurrentData.Data, 0, 2);
            DataLen := BytesToStrLength(ResponseVH);
            // Next Read the Granted QoS
            QoS := 0;
            if (Length(FCurrentData.Data) - 2) > 0 then
              begin
                ResponseVH := Copy(FCurrentData.Data, 2, 1);
                QoS := ResponseVH[0];
              end;
            if Assigned(OnSubAck) then OnSubAck(Self, DataLen, QoS);
  
negative.code:   ResponseVH: TBytes;
    ConnectReturn: Integer;
  begin
    if (CurrentMessage.FixedHeader <> 0) then
      begin
        MessageType := CurrentMessage.FixedHeader shr 4;
  
        if (MessageType = Ord(MQTT.CONNACK)) then
          begin
            // Check if we were given a Connect Return Code.
            ConnectReturn := 0;
            // Any return code except 0 is an Error
            if ((Length(CurrentMessage.Data) > 0) and (Length(CurrentMessage.Data) < 4)) then
              begin
                ConnectReturn := CurrentMessage.Data[1];
                Exception.Create('Connect Error Returned by the Broker. Error Code: ' + IntToStr(CurrentMessage.Data[1]));
              end;
            if Assigned(OnConnAck) then OnConnAck(Self, ConnectReturn);
          end
  