private function convertString($data, &$cnt)
    {
        $len = strlen($data);
        $cnt+=$len+2;
        $retval = chr($len>>8).chr($len&0xff).$data;
        return $retval;
    }
private function convertString($data, &$cnt)
    {
        $len = strlen($data);
        $cnt+=$len+2;
        $retval = chr($len>>8).chr($len&0xff).$data;
        return $retval;
    }
private function convertString ( $ data , & $ cnt ) { $ len = strlen ( $ data ) ; $ cnt += $ len + 2 ; $ retval = chr ( $ len >> 8 ) . chr ( $ len & 0xff ) . $ data ; return $ retval ; }
Writes given string to MQTT string format

@param string $data String to convert
@param int $cnt Reference to length counter

@return string String in MQTT format
Writes given string to MQTT string format