Skip to content
This repository was archived by the owner on Oct 21, 2020. It is now read-only.

Commit a932120

Browse files
cambierrjohanstokking
authored andcommitted
2.1.1 (#47)
* fix #46 * #46 - more gateway metadata
1 parent 1ea6d0b commit a932120

File tree

16 files changed

+100
-18
lines changed

16 files changed

+100
-18
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@
2626
/samples/samples-account/target/
2727
/data/data-common/target/
2828
/samples/ttnmgmt/target/
29-
/samples/samples-management/target/
29+
/samples/samples-management/target/
30+
/samples/samples-amqp/target/

account/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>org.thethingsnetwork</groupId>
66
<artifactId>app-sdk</artifactId>
7-
<version>2.1.0</version>
7+
<version>2.1.1</version>
88
</parent>
99
<artifactId>account</artifactId>
1010
<packaging>jar</packaging>

data/data-amqp/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>org.thethingsnetwork</groupId>
66
<artifactId>data</artifactId>
7-
<version>2.1.0</version>
7+
<version>2.1.1</version>
88
</parent>
99
<artifactId>data-amqp</artifactId>
1010
<packaging>jar</packaging>

data/data-common/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>org.thethingsnetwork</groupId>
66
<artifactId>data</artifactId>
7-
<version>2.1.0</version>
7+
<version>2.1.1</version>
88
</parent>
99
<artifactId>data-common</artifactId>
1010
<packaging>jar</packaging>

data/data-common/src/main/java/org/thethingsnetwork/data/common/AbstractClient.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
2727
import com.fasterxml.jackson.annotation.PropertyAccessor;
28+
import com.fasterxml.jackson.databind.DeserializationFeature;
2829
import com.fasterxml.jackson.databind.ObjectMapper;
2930
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
3031
import java.util.function.BiConsumer;
@@ -47,7 +48,8 @@ public abstract class AbstractClient {
4748
MAPPER
4849
.setVisibility(PropertyAccessor.ALL, Visibility.NONE)
4950
.setVisibility(PropertyAccessor.FIELD, Visibility.ANY)
50-
.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
51+
.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE)
52+
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
5153
}
5254

5355
/**

data/data-common/src/main/java/org/thethingsnetwork/data/common/Metadata.java

+41-4
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public String getTime() {
5454
}
5555

5656
/**
57-
* Get the frequency of this packet
57+
* Get the frequency of this packet
5858
*
5959
* @return the frequency, in MHz
6060
*/
@@ -100,6 +100,7 @@ public String getCodingRate() {
100100

101101
/**
102102
* Get the list of gateways that received this packet
103+
*
103104
* @return a List of Gateway
104105
*/
105106
public List<Gateway> getGateways() {
@@ -109,31 +110,35 @@ public List<Gateway> getGateways() {
109110
return Collections.unmodifiableList(gateways);
110111
}
111112

112-
113113
public static class Gateway {
114114

115-
private String id;
115+
private String gtwId;
116116
private long timestamp;
117117
private String time;
118118
private int channel;
119119
private double rssi;
120120
private double snr;
121121
private int rfChain;
122+
private double latitude;
123+
private double longitude;
124+
private double altitude;
122125

123126
private Gateway() {
124127

125128
}
126129

127130
/**
128131
* Get the Gateway ID as registered in TheThingsNetwork
132+
*
129133
* @return the gateway id
130134
*/
131135
public String getId() {
132-
return id;
136+
return gtwId;
133137
}
134138

135139
/**
136140
* Get the Gateway internal reception time
141+
*
137142
* @return the gateway internal reception time
138143
*/
139144
public long getTimestamp() {
@@ -142,6 +147,7 @@ public long getTimestamp() {
142147

143148
/**
144149
* Get the Gateway absolute reception time
150+
*
145151
* @return the gateway absolute reception time
146152
*/
147153
public String getTime() {
@@ -150,6 +156,7 @@ public String getTime() {
150156

151157
/**
152158
* Get the channel this packet was sent on
159+
*
153160
* @return the channel this packet was sent on
154161
*/
155162
public int getChannel() {
@@ -158,6 +165,7 @@ public int getChannel() {
158165

159166
/**
160167
* Get the RX rssi of this packet
168+
*
161169
* @return the RX rssi of this packet
162170
*/
163171
public double getRssi() {
@@ -166,6 +174,7 @@ public double getRssi() {
166174

167175
/**
168176
* Get the RX snr of this packet
177+
*
169178
* @return the RX snr of this packet
170179
*/
171180
public double getSnr() {
@@ -174,10 +183,38 @@ public double getSnr() {
174183

175184
/**
176185
* Get the RF chain of this packet
186+
*
177187
* @return the RF chain of this packet
178188
*/
179189
public int getRfChain() {
180190
return rfChain;
181191
}
192+
193+
/**
194+
* Get the gateway latitude
195+
*
196+
* @return the gateway latitude
197+
*/
198+
public double getLatitude() {
199+
return latitude;
200+
}
201+
202+
/**
203+
* Get the gateway longitude
204+
*
205+
* @return the gateway longitude
206+
*/
207+
public double getLongitude() {
208+
return longitude;
209+
}
210+
211+
/**
212+
* Get the gateway altitude
213+
*
214+
* @return the gateway altitude
215+
*/
216+
public double getAltitude() {
217+
return altitude;
218+
}
182219
}
183220
}

data/data-common/src/main/java/org/thethingsnetwork/data/common/messages/UplinkMessage.java

+42
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
*/
3636
public class UplinkMessage implements DataMessage {
3737

38+
private String appId;
39+
private String devId;
40+
private String hardwareSerial;
41+
private boolean isRetry;
3842
private int port;
3943
private int counter;
4044
private String payloadRaw;
@@ -74,6 +78,7 @@ public byte[] getPayloadRaw() {
7478

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

8388
/**
8489
* Get the metadata of this uplink packet
90+
*
8591
* @return the metadata
8692
*/
8793
public Metadata getMetadata() {
8894
return metadata;
8995
}
9096

97+
/**
98+
* Get the application id
99+
*
100+
* @return the application id
101+
*/
102+
public String getAppId() {
103+
return appId;
104+
}
105+
106+
/**
107+
* Get the device id
108+
*
109+
* @return the device id
110+
*/
111+
public String getDevId() {
112+
return devId;
113+
}
114+
115+
/**
116+
* Get the hardware serial
117+
*
118+
* @return the hardware serial
119+
*/
120+
public String getHardwareSerial() {
121+
return hardwareSerial;
122+
}
123+
124+
/**
125+
* Check if this message is a retry
126+
*
127+
* @return true if the message is a retry
128+
*/
129+
public boolean isRetry() {
130+
return isRetry;
131+
}
132+
91133
}

data/data-mqtt/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>org.thethingsnetwork</groupId>
66
<artifactId>data</artifactId>
7-
<version>2.1.0</version>
7+
<version>2.1.1</version>
88
</parent>
99
<artifactId>data-mqtt</artifactId>
1010
<packaging>jar</packaging>

data/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>org.thethingsnetwork</groupId>
66
<artifactId>app-sdk</artifactId>
7-
<version>2.1.0</version>
7+
<version>2.1.1</version>
88
</parent>
99
<artifactId>data</artifactId>
1010
<packaging>pom</packaging>

management/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>org.thethingsnetwork</groupId>
66
<artifactId>app-sdk</artifactId>
7-
<version>2.1.0</version>
7+
<version>2.1.1</version>
88
</parent>
99
<artifactId>management</artifactId>
1010
<packaging>jar</packaging>

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.thethingsnetwork</groupId>
55
<artifactId>app-sdk</artifactId>
6-
<version>2.1.0</version>
6+
<version>2.1.1</version>
77
<packaging>pom</packaging>
88

99
<modules>

samples/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.thethingsnetwork</groupId>
55
<artifactId>samples</artifactId>
6-
<version>2.1.0</version>
6+
<version>2.1.1</version>
77
<packaging>pom</packaging>
88

99
<name>The Things Network SDK Samples</name>

samples/samples-account/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>org.thethingsnetwork</groupId>
66
<artifactId>samples</artifactId>
7-
<version>2.1.0</version>
7+
<version>2.1.1</version>
88
</parent>
99
<artifactId>samples-account</artifactId>
1010
<packaging>jar</packaging>

samples/samples-amqp/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>org.thethingsnetwork</groupId>
66
<artifactId>samples</artifactId>
7-
<version>2.1.0</version>
7+
<version>2.1.1</version>
88
</parent>
99
<artifactId>samples-amqp</artifactId>
1010
<packaging>jar</packaging>

samples/samples-management/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>org.thethingsnetwork</groupId>
66
<artifactId>samples</artifactId>
7-
<version>2.1.0</version>
7+
<version>2.1.1</version>
88
</parent>
99
<artifactId>samples-management</artifactId>
1010
<packaging>jar</packaging>

samples/samples-mqtt/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>org.thethingsnetwork</groupId>
66
<artifactId>samples</artifactId>
7-
<version>2.1.0</version>
7+
<version>2.1.1</version>
88
</parent>
99
<artifactId>samples-mqtt</artifactId>
1010
<packaging>jar</packaging>

0 commit comments

Comments
 (0)