Exemplo n.º 1
0
        Program()
        {
            InIReader.SetSearchPath(new List <String>()
            {
                "/etc/ttnbridge", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\ttnbridge"
            });
            if (!InIReader.ConfigExist("settings"))
            {
                Helper.WriteError("No settings.ini found. Abord!");
                return;
            }
            this.settings = InIReader.GetInstance("settings");
            this.logger.SetPath(this.settings.GetValue("logging", "path"));

            this.Connect();
            this.Attach();
            this.WaitForShutdown();
            this.Dispose();
        }
Exemplo n.º 2
0
        static void Main(String[] _1)
        {
            InIReader.SetSearchPath(new List <String>()
            {
                "/etc/loramap", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\loramap"
            });
            if (!InIReader.ConfigExist("settings"))
            {
                Helper.WriteError("settings.ini not found!");
                _ = Console.ReadLine();
                return;
            }
            InIReader ini = InIReader.GetInstance("settings");
            Dictionary <String, String> backenddata = ini.GetSection("mqtt");

            backenddata.Add("topic", "lora/#;camera/#;sfn/#");
            ADataBackend b = (ADataBackend)ABackend.GetInstance(backenddata, ABackend.BackendType.Data);

            _ = new Server(b, ini.GetSection("webserver"));
        }
Exemplo n.º 3
0
        public Program(String[] _)
        {
            InIReader.SetSearchPath(new List <String>()
            {
                "/etc/lorabot", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\lorabot"
            });
            if (!InIReader.ConfigExist("settings"))
            {
                Helper.WriteError("No settings.ini found. Abord!");
                return;
            }
            InIReader settings = InIReader.GetInstance("settings");

            this.logger.SetPath(settings.GetValue("logging", "path"));

            LoraParser parser = new LoraParser(settings.GetValue("general", "key"));

            LoraController lora = new LoraController(settings.GetSection("lora"));

            lora.Received += parser.ReceivedPacket;

            this.ModulLoader("Fraunhofer.Fit.IoT.Bots.LoraBot.Moduls", parser);
            this.ModulInterconnect();
            this.ModulEvents();

            parser.DataUpdate   += this.Lora_Parsed;
            parser.PanicUpdate  += this.Lora_Parsed;
            parser.StatusUpdate += this.Lora_Parsed;
            lora.Transmitted    += this.Lora_Transmitted;

            this.WaitForShutdown();
            Console.WriteLine("after wait");

            this.ModulDispose();
            Console.WriteLine("after dispose");

            lora.Dispose();
            Console.WriteLine("after loradisp");
        }