Exemple #1
0
        protected override ParsedData Parse(ParserData parserData)
        {
            string   devEUI   = parserData.GetDevEUI();
            DateTime dateTime = parserData.GetTime();

            decimal distance = parserData.GetPayloadValue("distance").AsDecimal();

            var keyValues = new List <ParsedData.KeyValue>()
            {
                new ParsedData.KeyValue("RSSI", parserData.GetRSSI()),
                new ParsedData.KeyValue("distance", distance),
            };

            return(new ParsedData(devEUI, dateTime, keyValues));
        }
Exemple #2
0
        protected override ParsedData Parse(ParserData parserData)
        {
            string   devEUI   = parserData.GetDevEUI();
            DateTime dateTime = parserData.GetTime();

            var keyValues = new List <ParsedData.KeyValue>()
            {
                new ParsedData.KeyValue("BatV", parserData.GetPayloadValue("BatV").AsDecimal()),
                new ParsedData.KeyValue("Air.Temperature", parserData.GetPayloadValue("TempC_SHT").AsDecimal()),
                new ParsedData.KeyValue("Air.Humidity", parserData.GetPayloadValue("Hum_SHT").AsDecimal()),
                new ParsedData.KeyValue("Soil.Temperature", parserData.GetPayloadValue("TempC_DS").AsDecimal()),
                new ParsedData.KeyValue("RSSI", parserData.GetRSSI()),
            };

            return(new ParsedData(devEUI, dateTime, keyValues));
        }