/* 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. */ using System; namespace uPLibrary.Networking.M2Mqtt.Exceptions { /// /// MQTT client exception /// public class MqttClientException : ApplicationException { /// /// 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 topic length error /// WillTopicWrong = 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 } }