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)); }
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)); }
protected abstract ParsedData Parse(ParserData parserData);
public ParsedData Parse(byte[] data) { ParserData parserData = new ParserData(data); return(Parse(parserData)); }