Exemple #1
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"));
        }
Exemple #2
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");
        }
Exemple #3
0
 private void Connect(InIReader settings)
 {
     this.mqtt  = (ADataBackend)ABackend.GetInstance(settings.GetSection("mqtt"), ABackend.BackendType.Data);
     this.scral = new ScralPusher(settings.GetSection("scral"));
 }