Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
e5eb4c8740 | |||
9a94ff97d2 | |||
51bfd52095 |
37
Changelog.md
37
Changelog.md
@ -0,0 +1,37 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
## 1.4.0 - 2022-01-09 - Cleanup
|
||||||
|
### New Features
|
||||||
|
* On first startup, not try to disconnect first
|
||||||
|
### Bugfixes
|
||||||
|
* Fixing nullpointer exception
|
||||||
|
### Changes
|
||||||
|
* Cleanup project and fixes version numbers
|
||||||
|
|
||||||
|
## 1.3.0 - 2021-01-09 - Default netcore
|
||||||
|
### New Features
|
||||||
|
* Create toString, so in logfiles the used Server is visible
|
||||||
|
* add changelog.md
|
||||||
|
### Bugfixes
|
||||||
|
### Changes
|
||||||
|
* Netcore is now the default projekt
|
||||||
|
|
||||||
|
## 1.2.0 - 2019-11-28 - Add netcore
|
||||||
|
### New Features
|
||||||
|
* add Licence, readme.md and contribute.md
|
||||||
|
* add netcore version
|
||||||
|
### Bugfixes
|
||||||
|
### Changes
|
||||||
|
* Using newer C# language version
|
||||||
|
|
||||||
|
## 1.1.0 - 2019-05-27 - Rewrite Module to reconnect itselfs, so you dont need to watch over the the state of the connection
|
||||||
|
### New Features
|
||||||
|
* Keep the connection alive and reconnect internally
|
||||||
|
### Bugfixes
|
||||||
|
### Changes
|
||||||
|
|
||||||
|
## 1.0.0.0 - 2019-02-14 - Init
|
||||||
|
### New Features
|
||||||
|
* Init release
|
||||||
|
### Bugfixes
|
||||||
|
### Changes
|
@ -6,14 +6,20 @@
|
|||||||
<AssemblyName>ConnectorDataMqtt</AssemblyName>
|
<AssemblyName>ConnectorDataMqtt</AssemblyName>
|
||||||
<Company>BlubbFish</Company>
|
<Company>BlubbFish</Company>
|
||||||
<Authors>BlubbFish</Authors>
|
<Authors>BlubbFish</Authors>
|
||||||
<Version>1.1.0</Version>
|
<Version>1.4.0</Version>
|
||||||
<Copyright>Copyright © BlubbFish 2017 - 27.05.2019</Copyright>
|
<Copyright>Copyright © BlubbFish 2017 - 09.01.2022</Copyright>
|
||||||
<Description>ADataBackend Connector that connects to mqtt using M2Mqtt</Description>
|
<Description>ADataBackend Connector that connects to mqtt using M2Mqtt</Description>
|
||||||
<PackageLicenseFile>LICENSE</PackageLicenseFile>
|
<PackageLicenseFile>LICENSE</PackageLicenseFile>
|
||||||
<PackageProjectUrl>http://git.blubbfish.net/vs_utils/ConnectorDataMqtt</PackageProjectUrl>
|
<PackageProjectUrl>http://git.blubbfish.net/vs_utils/ConnectorDataMqtt</PackageProjectUrl>
|
||||||
<RepositoryUrl>http://git.blubbfish.net/vs_utils/ConnectorDataMqtt.git</RepositoryUrl>
|
<RepositoryUrl>http://git.blubbfish.net/vs_utils/ConnectorDataMqtt.git</RepositoryUrl>
|
||||||
<RepositoryType>git</RepositoryType>
|
<RepositoryType>git</RepositoryType>
|
||||||
<PackageReleaseNotes>1.1.0 Rewrite Module to reconnect itselfs, so you dont need to watch over the the state of the connection</PackageReleaseNotes>
|
<PackageReleaseNotes>
|
||||||
|
1.4.0 Cleanup
|
||||||
|
1.3.0 Default netcore
|
||||||
|
1.2.0 Add netcore
|
||||||
|
1.1.0 Rewrite Module to reconnect itselfs, so you dont need to watch over the the state of the connection
|
||||||
|
1.0.0.0 Init
|
||||||
|
</PackageReleaseNotes>
|
||||||
<NeutralLanguage>de-DE</NeutralLanguage>
|
<NeutralLanguage>de-DE</NeutralLanguage>
|
||||||
<PackageId>Mqtt.Data.Connector.IoT.Utils.BlubbFish</PackageId>
|
<PackageId>Mqtt.Data.Connector.IoT.Utils.BlubbFish</PackageId>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@ -25,9 +31,9 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="../CHANGELOG.md" />
|
<Content Include="../CHANGELOG.md" />
|
||||||
<Content Include="../CONTRIBUTING.md" />
|
<Content Include="../CONTRIBUTING.md" />
|
||||||
<Content Include="../LICENSE" />
|
<Content Include="../LICENSE" />
|
||||||
<Content Include="../README.md" />
|
<Content Include="../README.md" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -12,6 +12,7 @@ namespace BlubbFish.Utils.IoT.Connector.Data {
|
|||||||
private MqttClient client;
|
private MqttClient client;
|
||||||
private Thread connectionWatcher;
|
private Thread connectionWatcher;
|
||||||
private Boolean connectionWatcherRunning;
|
private Boolean connectionWatcherRunning;
|
||||||
|
private Boolean firstStart = true;
|
||||||
|
|
||||||
public Mqtt(Dictionary<String, String> settings) : base(settings) {
|
public Mqtt(Dictionary<String, String> settings) : base(settings) {
|
||||||
Console.WriteLine("BlubbFish.Utils.IoT.Connector.Data.Mqtt(" + this.ToString()+")");
|
Console.WriteLine("BlubbFish.Utils.IoT.Connector.Data.Mqtt(" + this.ToString()+")");
|
||||||
@ -62,10 +63,14 @@ namespace BlubbFish.Utils.IoT.Connector.Data {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void Reconnect() {
|
private void Reconnect() {
|
||||||
if(this.IsConnected) {
|
if(!this.firstStart) {
|
||||||
this.Disconnect(true);
|
if(this.IsConnected) {
|
||||||
|
this.Disconnect(true);
|
||||||
|
} else {
|
||||||
|
this.Disconnect(false);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.Disconnect(false);
|
this.firstStart = false;
|
||||||
}
|
}
|
||||||
this.Connect();
|
this.Connect();
|
||||||
}
|
}
|
||||||
@ -123,14 +128,14 @@ namespace BlubbFish.Utils.IoT.Connector.Data {
|
|||||||
#region IDisposable Support
|
#region IDisposable Support
|
||||||
private Boolean disposedValue = false;
|
private Boolean disposedValue = false;
|
||||||
|
|
||||||
public override Boolean IsConnected => this.client != null ? this.client.IsConnected : false;
|
public override Boolean IsConnected => this.client != null && this.client.IsConnected;
|
||||||
|
|
||||||
protected virtual void Dispose(Boolean disposing) {
|
protected virtual void Dispose(Boolean disposing) {
|
||||||
if(!this.disposedValue) {
|
if(!this.disposedValue) {
|
||||||
if(disposing) {
|
if(disposing) {
|
||||||
try {
|
try {
|
||||||
this.connectionWatcherRunning = false;
|
this.connectionWatcherRunning = false;
|
||||||
while(this.connectionWatcher.IsAlive) {
|
while(this.connectionWatcher != null && this.connectionWatcher.IsAlive) {
|
||||||
Thread.Sleep(10);
|
Thread.Sleep(10);
|
||||||
}
|
}
|
||||||
this.connectionWatcher = null;
|
this.connectionWatcher = null;
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
# BlubbFish.Utils.IoT.Connector.Data.Mqtt (ConnectorDataMqtt)
|
# BlubbFish.Utils.IoT.Connector.Data.Mqtt (ConnectorDataMqtt)
|
||||||
Library that connects to Mqtt using M2Mqtt
|
Library that connects to Mqtt using M2Mqtt
|
||||||
|
|
||||||
|
Maybe you find this Repo on Github. This is a mirror from [here](https://git.blubbfish.net/vs_utils/ConnectorDataMqtt).
|
||||||
|
|
||||||
## Linking to
|
## Linking to
|
||||||
### Internal
|
### Internal
|
||||||
* BlubbFish.Utils.IoT ([Utils-IoT](http://git.blubbfish.net/vs_utils/Utils-IoT))
|
* BlubbFish.Utils.IoT ([Utils-IoT](http://git.blubbfish.net/vs_utils/Utils-IoT))
|
||||||
|
|
||||||
### External
|
### External
|
||||||
* M2Mqtt
|
* M2Mqtt ([Used Fork](https://github.com/blubbfish/mqtt), [Original](https://github.com/eclipse/paho.mqtt.m2mqtt))
|
Loading…
Reference in New Issue
Block a user