class MQTT::Packet::Publish

def qos=(arg)

Set the Quality of Service level (0/1/2)
def qos=(arg)
  @qos = arg.to_i
  raise "Invalid QoS value: #{@qos}" if @qos < 0 || @qos > 2
  @flags[1] = (arg & 0x01 == 0x01)
  @flags[2] = (arg & 0x02 == 0x02)
end