/* M2Mqtt - MQTT Client Library for .Net Copyright (c) 2014, Paolo Patierno, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. */ #if (!MF_FRAMEWORK_VERSION_V4_2 && !MF_FRAMEWORK_VERSION_V4_3) using System; #else using Microsoft.SPOT; #endif namespace uPLibrary.Networking.M2Mqtt.Messages { /// /// Event Args class for PUBLISH message received from broker /// public class MqttMsgPublishEventArgs : EventArgs { #region Properties... /// /// Message topic /// public string Topic { get { return this.topic; } internal set { this.topic = value; } } /// /// Message data /// public byte[] Message { get { return this.message; } internal set { this.message = value; } } /// /// Duplicate message flag /// public bool DupFlag { get { return this.dupFlag; } set { this.dupFlag = value; } } /// /// Quality of Service level /// public byte QosLevel { get { return this.qosLevel; } internal set { this.qosLevel = value; } } /// /// Retain message flag /// public bool Retain { get { return this.retain; } internal set { this.retain = value; } } #endregion // message topic private string topic; // message data private byte[] message; // duplicate delivery private bool dupFlag; // quality of service level private byte qosLevel; // retain flag private bool retain; /// /// Constructor /// /// Message topic /// Message data /// Duplicate delivery flag /// Quality of Service level /// Retain flag public MqttMsgPublishEventArgs(string topic, byte[] message, bool dupFlag, byte qosLevel, bool retain) { this.topic = topic; this.message = message; this.dupFlag = dupFlag; this.qosLevel = qosLevel; this.retain = retain; } } }