Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • monica/lora-gateway/lora
1 result
Show changes
Commits on Source (2)
...@@ -10,4 +10,6 @@ ...@@ -10,4 +10,6 @@
1.7.0 Add Parsing for new Statusformat and Panic Packet 1.7.0 Add Parsing for new Statusformat and Panic Packet
1.8.0 Add field that indicates when the last gps position was recieved, change all times to UTC 1.8.0 Add field that indicates when the last gps position was recieved, change all times to UTC
1.8.1 Add Hostname to MQTT, so you can see from witch device the data is recieved 1.8.1 Add Hostname to MQTT, so you can see from witch device the data is recieved
1.8.2 Bugfix, create also an event for sending normal loradata when update panic 1.8.2 Bugfix, create also an event for sending normal loradata when update panic
\ No newline at end of file 1.8.3 Refactoring and make using threads on event occours
1.8.4 Fixing a bug related to threaded working with data
\ No newline at end of file
...@@ -10,6 +10,7 @@ namespace Fraunhofer.Fit.Iot.Lora { ...@@ -10,6 +10,7 @@ namespace Fraunhofer.Fit.Iot.Lora {
public class LoraController : IDisposable { public class LoraController : IDisposable {
private LoraConnector loraconnector; private LoraConnector loraconnector;
private readonly Dictionary<String, String> settings; private readonly Dictionary<String, String> settings;
private readonly Object lockReceivePacket = new Object();
public delegate void UpdateDataEvent(Object sender, DataUpdateEvent e); public delegate void UpdateDataEvent(Object sender, DataUpdateEvent e);
public delegate void UpdatePanicEvent(Object sender, PanicUpdateEvent e); public delegate void UpdatePanicEvent(Object sender, PanicUpdateEvent e);
...@@ -84,23 +85,25 @@ namespace Fraunhofer.Fit.Iot.Lora { ...@@ -84,23 +85,25 @@ namespace Fraunhofer.Fit.Iot.Lora {
} }
} }
if(trackerName != "") { if(trackerName != "") {
if(!this.trackers.ContainsKey(trackerName)) { lock(this.lockReceivePacket) {
this.trackers.Add(trackerName, new Tracker()); if(!this.trackers.ContainsKey(trackerName)) {
this.trackers[trackerName].DataUpdate += this.DataUpdates; this.trackers.Add(trackerName, new Tracker());
this.trackers[trackerName].StatusUpdate += this.StatusUpdates; this.trackers[trackerName].DataUpdate += this.DataUpdates;
this.trackers[trackerName].PanicUpdate += this.PanicUpdates; this.trackers[trackerName].StatusUpdate += this.StatusUpdates;
} this.trackers[trackerName].PanicUpdate += this.PanicUpdates;
if(binaryUpdate.Length > 0) { }
this.trackers[trackerName].SetUpdate(e, binaryUpdate); if(binaryUpdate.Length > 0) {
} this.trackers[trackerName].SetUpdate(e, binaryUpdate);
if(binaryPanics.Length > 0) { }
this.trackers[trackerName].SetPanics(e, binaryPanics); if(binaryPanics.Length > 0) {
} this.trackers[trackerName].SetPanics(e, binaryPanics);
if(textStatus != "") { }
this.trackers[trackerName].SetStatus(e, textStatus); if(textStatus != "") {
} this.trackers[trackerName].SetStatus(e, textStatus);
if(textUpdate != "") { }
this.trackers[trackerName].SetUpdate(e, textUpdate); if(textUpdate != "") {
this.trackers[trackerName].SetUpdate(e, textUpdate);
}
} }
} }
}); });
......
using System.Reflection; using System.Reflection;
using System.Resources; using System.Resources;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über die folgenden // Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die einer Assembly zugeordnet sind. // die einer Assembly zugeordnet sind.
[assembly: AssemblyTitle("Lora")] [assembly: AssemblyTitle("Lora")]
[assembly: AssemblyDescription("Library that connects to a radio device and recieves lora traffic")] [assembly: AssemblyDescription("Library that connects to a radio device and recieves lora traffic")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Fraunhofer FIT")] [assembly: AssemblyCompany("Fraunhofer FIT")]
[assembly: AssemblyProduct("Lora")] [assembly: AssemblyProduct("Lora")]
[assembly: AssemblyCopyright("Copyright © 2018 - 31.05.2019")] [assembly: AssemblyCopyright("Copyright © 2018 - 08.07.2019")]
[assembly: AssemblyTrademark("Fraunhofer FIT, BlubbFish")] [assembly: AssemblyTrademark("Fraunhofer FIT, BlubbFish")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("de-DE")] [assembly: NeutralResourcesLanguage("de-DE")]
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly // Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von // für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. // COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
[assembly: ComVisible(false)] [assembly: ComVisible(false)]
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird // Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[assembly: Guid("85a78b05-5843-4e4d-8c56-4bcb12613750")] [assembly: Guid("85a78b05-5843-4e4d-8c56-4bcb12613750")]
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: // Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
// //
// Hauptversion // Hauptversion
// Nebenversion // Nebenversion
// Buildnummer // Buildnummer
// Revision // Revision
// //
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben: // indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.8.3")] [assembly: AssemblyVersion("1.8.4")]
[assembly: AssemblyFileVersion("1.8.3")] [assembly: AssemblyFileVersion("1.8.4")]
/* /*
* 1.1.0 Now awaiing Battery as Double and fix the sending twise issue * 1.1.0 Now awaiing Battery as Double and fix the sending twise issue
* 1.2.0 Restructure and remove old code * 1.2.0 Restructure and remove old code
* 1.3.0 Status event and fileds added and refactoring * 1.3.0 Status event and fileds added and refactoring
* 1.4.0 Implement Height in Lora * 1.4.0 Implement Height in Lora
* 1.4.1 Fixing parsing bug with linebreaks * 1.4.1 Fixing parsing bug with linebreaks
* 1.4.2 Adding test for LoraBinary * 1.4.2 Adding test for LoraBinary
* 1.5.0 Add support for IC880A board * 1.5.0 Add support for IC880A board
* 1.6.0 Fixing binary data transmission * 1.6.0 Fixing binary data transmission
* 1.6.1 Update to local librarys * 1.6.1 Update to local librarys
* 1.7.0 Add Parsing for new Statusformat and Panic Packet * 1.7.0 Add Parsing for new Statusformat and Panic Packet
* 1.8.0 Add field that indicates when the last gps position was recieved, change all times to UTC * 1.8.0 Add field that indicates when the last gps position was recieved, change all times to UTC
* 1.8.1 Add Hostname to MQTT, so you can see from witch device the data is recieved * 1.8.1 Add Hostname to MQTT, so you can see from witch device the data is recieved
* 1.8.2 Bugfix, create also an event for sending normal loradata when update panic * 1.8.2 Bugfix, create also an event for sending normal loradata when update panic
* 1.8.3 Refactoring and make using threads on event occours * 1.8.3 Refactoring and make using threads on event occours
*/ * 1.8.4 Fixing a bug related to threaded working with data
*/
...@@ -3189,7 +3189,16 @@ namespace Fraunhofer.Fit.Iot.Lora.lib { ...@@ -3189,7 +3189,16 @@ namespace Fraunhofer.Fit.Iot.Lora.lib {
this.PinReset.Write(true); this.PinReset.Write(true);
Thread.Sleep(150); Thread.Sleep(150);
this.PinReset.Write(false); this.PinReset.Write(false);
this.PinReset.PinMode = GpioPinDriveMode.Input; this.SingleSPI(0, 128);
this.SingleSPI(0, 0);
Thread.Sleep(32); // provide at least 16 cycles on CLKHS and 16 cycles CLK32M
this.SingleSPI(18, 1);
Thread.Sleep(42); // provide at least 4 cycles on CLKHS and 32 cycles CLK32M and 4 cycles on HOST_SCK
this.SingleSPI(18, 2);
Thread.Sleep(8); // provide at least 4 cycles CLK32M and 4 cycles on HOST_SCK
this.SingleSPI(0, 128);
this.SingleSPI(0, 0);
//this.PinReset.PinMode = GpioPinDriveMode.Input;
} }
private void SetupIO() { private void SetupIO() {
......