/*
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
*/
using System;
namespace uPLibrary.Networking.M2Mqtt.Exceptions
{
///
/// MQTT client exception
///
public class MqttClientException : Exception
{
///
/// Constructor
///
/// Error code
public MqttClientException(MqttClientErrorCode errorCode)
{
this.errorCode = errorCode;
}
// error code
private MqttClientErrorCode errorCode;
///
/// Error code
///
public MqttClientErrorCode ErrorCode
{
get { return this.errorCode; }
set { this.errorCode = value; }
}
}
///
/// MQTT client erroro code
///
public enum MqttClientErrorCode
{
///
/// Will error (topic, message or QoS level)
///
WillWrong = 1,
///
/// Keep alive period too large
///
KeepAliveWrong,
///
/// Topic contains wildcards
///
TopicWildcard,
///
/// Topic length wrong
///
TopicLength,
///
/// QoS level not allowed
///
QosNotAllowed,
///
/// Topics list empty for subscribe
///
TopicsEmpty,
///
/// Qos levels list empty for subscribe
///
QosLevelsEmpty,
///
/// Topics / Qos Levels not match in subscribe
///
TopicsQosLevelsNotMatch,
///
/// Wrong message from broker
///
WrongBrokerMessage,
///
/// Wrong Message Id
///
WrongMessageId,
///
/// Inflight queue is full
///
InflightQueueFull,
// [v3.1.1]
///
/// Invalid flag bits received
///
InvalidFlagBits,
// [v3.1.1]
///
/// Invalid connect flags received
///
InvalidConnectFlags,
// [v3.1.1]
///
/// Invalid client id
///
InvalidClientId,
// [v3.1.1]
///
/// Invalid protocol name
///
InvalidProtocolName
}
}