bluerhinos / phpMQTT

a simple php class to connect/publish/subscribe to a MQTT broker
Other
773 stars 460 forks source link

QOS 2 Supported? #4

Open ronzalo opened 11 years ago

ronzalo commented 11 years ago

Hi,

I tried to publish with qos 2, but does not work.

$conn->publish($request->getParameter('target'), $msg, 2);

Don't know if I'm missing some detail.

Thanks in advance

bluerhinos commented 11 years ago

Sorry but qos is not supported yet, It is on the todo list but as I didn't have the use for it I haven't implemented it yet.

Andy

t108840810 commented 7 years ago

Hello, Support publish qos2 now?

markus-hsk commented 6 years ago

Me2 looking forward for this feature.

AS-Igel commented 4 years ago

I guess the issue lies within this code part of subscribe:

//$qos
$cmd += ($qos << 1);

According to MQTT spec the fixed header of SUBSCRIBE should be 0x82; the QoS doesn't go there. The QoS is just is part of the payload. I guess the two lines cited above could be removed.