Skip to content

Commit

Permalink
Intelisense improvements (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
networkfusion authored and josesimoes committed Jul 15, 2019
1 parent 0d92251 commit a80bd6c
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 9 deletions.
2 changes: 1 addition & 1 deletion M2Mqtt/Exceptions/MqttClientException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class MqttClientException : Exception
/// <summary>
/// Constructor
/// </summary>
/// <param name="code">Error code</param>
/// <param name="errorCode">Error code</param>
public MqttClientException(MqttClientErrorCode errorCode)
{
this.errorCode = errorCode;
Expand Down
5 changes: 5 additions & 0 deletions M2Mqtt/Exceptions/MqttConnectionException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ namespace uPLibrary.Networking.M2Mqtt.Exceptions
/// </summary>
public class MqttConnectionException : Exception
{
/// <summary>
/// Connection to the broker exception
/// </summary>
/// <param name="message">A friendly message of the exception that occured</param>
/// <param name="innerException">Detail on why the exception occured</param>
public MqttConnectionException(string message, Exception innerException)
: base(message, innerException)
{
Expand Down
32 changes: 25 additions & 7 deletions M2Mqtt/MqttSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,37 @@ namespace uPLibrary.Networking.M2Mqtt
/// </summary>
public class MqttSettings
{
// default port for MQTT protocol
/// <summary>
/// Default port for the MQTT protocol
/// </summary>
public const int MQTT_BROKER_DEFAULT_PORT = 1883;
/// <summary>
/// Default SSL port for the MQTT protocol
/// </summary>
public const int MQTT_BROKER_DEFAULT_SSL_PORT = 8883;
// default timeout on receiving from client
/// <summary>
/// Default timeout on receiving from client
/// </summary>
public const int MQTT_DEFAULT_TIMEOUT = 30000;
// max publish, subscribe and unsubscribe retry for QoS Level 1 or 2
/// <summary>
/// Max publish, subscribe and unsubscribe retry for QoS Level 1 or 2
/// </summary>
public const int MQTT_ATTEMPTS_RETRY = 3;
// delay for retry publish, subscribe and unsubscribe for QoS Level 1 or 2
/// <summary>
/// Delay for retry publish, subscribe and unsubscribe for QoS Level 1 or 2
/// </summary>
public const int MQTT_DELAY_RETRY = 10000;
// broker need to receive the first message (CONNECT)
// within a reasonable amount of time after TCP/IP connection
/// <summary>
/// Connection Timeout
/// </summary>
/// <remarks>
/// The broker needs to receive the first message (CONNECT)
/// within a reasonable amount of time after the initial TCP/IP connection
/// </remarks>
public const int MQTT_CONNECT_TIMEOUT = 30000;
// default inflight queue size
/// <summary>
/// The default inflight queue size
/// </summary>
public const int MQTT_MAX_INFLIGHT_QUEUE_SIZE = int.MaxValue;

/// <summary>
Expand Down
11 changes: 10 additions & 1 deletion M2Mqtt/Net/MqttNetworkChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,12 @@ public static AddressFamily GetAddressFamily(this IPAddress ipAddress)
/// </summary>
public static class MqttSslUtility
{
/// <summary>
/// Defines the possible versions of Secure Sockets Layer (SSL).
/// </summary>
/// <remarks>
/// Note: Following the recommendation of the .NET documentation, nanoFramework implementation does not have SSL3 nor Default because those are deprecated and unsecure.
/// </remarks>
#if (!MF_FRAMEWORK_VERSION_V4_2 && !MF_FRAMEWORK_VERSION_V4_3 && !COMPACT_FRAMEWORK)
public static SslProtocols ToSslPlatformEnum(MqttSslProtocols mqttSslProtocol)
{
Expand All @@ -484,7 +490,10 @@ public static SslProtocols ToSslPlatformEnum(MqttSslProtocols mqttSslProtocol)
return SslProtocols.Tls11;
case MqttSslProtocols.TLSv1_2:
return SslProtocols.Tls12;
default:
#if !(NANOFRAMEWORK_1_0)
case MqttSslProtocols.SSLv3:
#endif
default:
throw new ArgumentException("SSL/TLS protocol version not supported");
}
}
Expand Down

0 comments on commit a80bd6c

Please sign in to comment.