Skip to content

Commit

Permalink
feat(settings): serializable settings for MQTT broker configuration
Browse files Browse the repository at this point in the history
Added a class to store MQTT broker settings.
  • Loading branch information
gpvigano committed Sep 14, 2018
1 parent cc4e432 commit 2ce51ed
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/issue-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ about: Generic template for issues
### Environment
>Please specify:
> * version of AsImpL (Github master commit hash or at least date/hour when you downloaded it)
> * version of M2MqttUnity (Github master commit hash or at least date/hour when you downloaded it)
> * version of Unity3D (e.g. Unity 5.4.4f1)
### Steps to reproduce
Expand Down
27 changes: 27 additions & 0 deletions Assets/M2MqttUnity/Scripts/BrokerSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.Xml.Serialization;
using UnityEngine;

namespace M2MqttUnity
{
/// <summary>
/// Serializable settings for MQTT broker configuration.
/// </summary>
[Serializable]
[XmlType(TypeName = "broker-settings")]
public class BrokerSettings
{
[Tooltip("Address of the host running the broker")]
public string host = "localhost";

[Tooltip("Port used to access the broker")]
public int port = 1883;

[Tooltip("Encrypted access to the broker")]
public bool encrypted = false;

[Tooltip("Optional alternate addresses, used if the previous host is not accessible")]
public string[] alternateAddress;
}
}

12 changes: 12 additions & 0 deletions Assets/M2MqttUnity/Scripts/BrokerSettings.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2ce51ed

Please sign in to comment.