Add HeliumUplinkMessage class

master
Bertrik Sikken 2021-09-15 00:15:44 +02:00
rodzic 59202b25a1
commit 7199758e63
1 zmienionych plików z 59 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,59 @@
package nl.sikken.bertrik.hab.lorawan;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
@JsonIgnoreProperties(ignoreUnknown = true)
public final class HeliumUplinkMessage {
@JsonProperty("app_eui")
String appEui = "";
@JsonProperty("dev_eui")
String devEui = "";
// device address with bytes in reverse order
@JsonProperty("devaddr")
String devAddr = "";
@JsonProperty("fcnt")
int fcnt;
@JsonProperty("port")
int port;
@JsonProperty("name")
String name = "";
@JsonProperty("payload")
byte[] payload = new byte[0];
// milliseconds
@JsonProperty("reported_at")
long reportedAt;
@JsonProperty("hotspots")
List<HotSpot> hotSpots = new ArrayList<>();
@JsonIgnoreProperties(ignoreUnknown = true)
static final class HotSpot {
@JsonProperty("name")
String name = "";
@JsonProperty("lat")
double latitude;
@JsonProperty("long")
double longitude;
@JsonProperty("rssi")
double rssi;
@JsonProperty("snr")
double snr;
}
}