/*
Copyright (c) 2013, 2014 Paolo Patierno
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
and Eclipse Distribution License v1.0 which accompany this distribution.
The Eclipse Public License is available at
http://www.eclipse.org/legal/epl-v10.html
and the Eclipse Distribution License is available at
http://www.eclipse.org/org/documents/edl-v10.php.
Contributors:
Paolo Patierno - initial API and implementation and/or initial documentation
*/
#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;
}
}
}