Skip to content
This repository was archived by the owner on Oct 21, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@
/samples/samples-account/target/
/data/data-common/target/
/samples/ttnmgmt/target/
/samples/samples-management/target/
/samples/samples-management/target/
/samples/samples-amqp/target/
2 changes: 1 addition & 1 deletion account/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.thethingsnetwork</groupId>
<artifactId>app-sdk</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
</parent>
<artifactId>account</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion data/data-amqp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.thethingsnetwork</groupId>
<artifactId>data</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
</parent>
<artifactId>data-amqp</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion data/data-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.thethingsnetwork</groupId>
<artifactId>data</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
</parent>
<artifactId>data-common</artifactId>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import java.util.function.BiConsumer;
Expand All @@ -47,7 +48,8 @@ public abstract class AbstractClient {
MAPPER
.setVisibility(PropertyAccessor.ALL, Visibility.NONE)
.setVisibility(PropertyAccessor.FIELD, Visibility.ANY)
.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE)
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public String getTime() {
}

/**
* Get the frequency of this packet
* Get the frequency of this packet
*
* @return the frequency, in MHz
*/
Expand Down Expand Up @@ -100,6 +100,7 @@ public String getCodingRate() {

/**
* Get the list of gateways that received this packet
*
* @return a List of Gateway
*/
public List<Gateway> getGateways() {
Expand All @@ -109,31 +110,35 @@ public List<Gateway> getGateways() {
return Collections.unmodifiableList(gateways);
}


public static class Gateway {

private String id;
private String gtwId;
private long timestamp;
private String time;
private int channel;
private double rssi;
private double snr;
private int rfChain;
private double latitude;
private double longitude;
private double altitude;

private Gateway() {

}

/**
* Get the Gateway ID as registered in TheThingsNetwork
*
* @return the gateway id
*/
public String getId() {
return id;
return gtwId;
}

/**
* Get the Gateway internal reception time
*
* @return the gateway internal reception time
*/
public long getTimestamp() {
Expand All @@ -142,6 +147,7 @@ public long getTimestamp() {

/**
* Get the Gateway absolute reception time
*
* @return the gateway absolute reception time
*/
public String getTime() {
Expand All @@ -150,6 +156,7 @@ public String getTime() {

/**
* Get the channel this packet was sent on
*
* @return the channel this packet was sent on
*/
public int getChannel() {
Expand All @@ -158,6 +165,7 @@ public int getChannel() {

/**
* Get the RX rssi of this packet
*
* @return the RX rssi of this packet
*/
public double getRssi() {
Expand All @@ -166,6 +174,7 @@ public double getRssi() {

/**
* Get the RX snr of this packet
*
* @return the RX snr of this packet
*/
public double getSnr() {
Expand All @@ -174,10 +183,38 @@ public double getSnr() {

/**
* Get the RF chain of this packet
*
* @return the RF chain of this packet
*/
public int getRfChain() {
return rfChain;
}

/**
* Get the gateway latitude
*
* @return the gateway latitude
*/
public double getLatitude() {
return latitude;
}

/**
* Get the gateway longitude
*
* @return the gateway longitude
*/
public double getLongitude() {
return longitude;
}

/**
* Get the gateway altitude
*
* @return the gateway altitude
*/
public double getAltitude() {
return altitude;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
*/
public class UplinkMessage implements DataMessage {

private String appId;
private String devId;
private String hardwareSerial;
private boolean isRetry;
private int port;
private int counter;
private String payloadRaw;
Expand Down Expand Up @@ -74,6 +78,7 @@ public byte[] getPayloadRaw() {

/**
* Get the payload fields. Only if you have a decoder function
*
* @return the payload fields as a Map where keys are strings, and values are any json-valid entity
*/
public Map<String, Object> getPayloadFields() {
Expand All @@ -82,10 +87,47 @@ public Map<String, Object> getPayloadFields() {

/**
* Get the metadata of this uplink packet
*
* @return the metadata
*/
public Metadata getMetadata() {
return metadata;
}

/**
* Get the application id
*
* @return the application id
*/
public String getAppId() {
return appId;
}

/**
* Get the device id
*
* @return the device id
*/
public String getDevId() {
return devId;
}

/**
* Get the hardware serial
*
* @return the hardware serial
*/
public String getHardwareSerial() {
return hardwareSerial;
}

/**
* Check if this message is a retry
*
* @return true if the message is a retry
*/
public boolean isRetry() {
return isRetry;
}

}
2 changes: 1 addition & 1 deletion data/data-mqtt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.thethingsnetwork</groupId>
<artifactId>data</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
</parent>
<artifactId>data-mqtt</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion data/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.thethingsnetwork</groupId>
<artifactId>app-sdk</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
</parent>
<artifactId>data</artifactId>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion management/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.thethingsnetwork</groupId>
<artifactId>app-sdk</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
</parent>
<artifactId>management</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.thethingsnetwork</groupId>
<artifactId>app-sdk</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
<packaging>pom</packaging>

<modules>
Expand Down
2 changes: 1 addition & 1 deletion samples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.thethingsnetwork</groupId>
<artifactId>samples</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
<packaging>pom</packaging>

<name>The Things Network SDK Samples</name>
Expand Down
2 changes: 1 addition & 1 deletion samples/samples-account/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.thethingsnetwork</groupId>
<artifactId>samples</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
</parent>
<artifactId>samples-account</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion samples/samples-amqp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.thethingsnetwork</groupId>
<artifactId>samples</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
</parent>
<artifactId>samples-amqp</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion samples/samples-management/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.thethingsnetwork</groupId>
<artifactId>samples</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
</parent>
<artifactId>samples-management</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion samples/samples-mqtt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.thethingsnetwork</groupId>
<artifactId>samples</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
</parent>
<artifactId>samples-mqtt</artifactId>
<packaging>jar</packaging>
Expand Down