public void Dispose() { if (this._isinit) { Console.WriteLine("Fraunhofer.Fit.Iot.Lora.LoraController.Dispose()"); this._isinit = false; if (this._testThreadRunning) { this._testThreadRunning = false; while (this._testThread.IsAlive) { Thread.Sleep(10); } this._testThread = null; } this.loraboard.Dispose(); this.loraboard = null; } }
public LoraController(Dictionary <String, String> settings) { try { this.loraboard = LoraBoard.GetInstance(settings); this.loraboard.Recieved += this.PacketReceived; this.loraboard.Transmitted += this.PacketTransmitted; this.loraboard.Begin(); this.loraboard.StartEventRecieving(); this._isinit = true; if (settings.ContainsKey("debug") && settings["debug"] == "true") { this._testThread = new Thread(this.TestRunner); this._testThreadRunning = true; this._testThread.Start(); } } catch (Exception e) { Helper.WriteError("Error while Loading Fraunhofer.Fit.Iot.Lora.LoraController.LoraController: " + e.Message + "\n\n" + e.StackTrace); throw; } }