You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this force unwrap crashes if QoS on a publish message is 2, to fix this crash:
public enum MQTTQoS: UInt8 {
case atMostOnce = 0x0
- case atLeastOnce = 0x01+ case atLeastOnce = 0x02- case exactlyOnce = 0x02+ case exactlyOnce = 0x04
}
When creating:
this force unwrap crashes if QoS on a publish message is 2, to fix this crash:
Why this crash ? as MQTTQoS is declared as a UInt8, and http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718038 state that QoS bits are:
so having
0b0101 00100
on the header flags byte, then ANDing with 0x06 gives0b0000 0100
(=> 4 decimal)QoS value 1 (
0b0101 00010
& 0x06 => 2 decimal) was working, but using exactlyOnce value.Should I send a PR for this ?
The text was updated successfully, but these errors were encountered: