Skip to content
This repository was archived by the owner on Dec 14, 2021. It is now read-only.

Commit 0c455d4

Browse files
authored
Merge pull request #680 from TheThingsNetwork/feature/localization
Add encrypted and fine timestamp to MQTT metadata
2 parents 4ac960c + 0e1a144 commit 0c455d4

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

core/handler/convert_metadata.go

+2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ func (h *handler) ConvertMetadata(ctx ttnlog.Interface, ttnUp *pb_broker.Dedupli
5959
if antennas := in.GetAntennas(); len(antennas) > 0 {
6060
for _, antenna := range antennas {
6161
gatewayMetadata.Antenna = uint8(antenna.Antenna)
62+
gatewayMetadata.FineTimestamp = uint64(antenna.FineTime)
63+
gatewayMetadata.FineTimestampEncrypted = antenna.EncryptedTime
6264
gatewayMetadata.Channel = antenna.Channel
6365
gatewayMetadata.RSSI = antenna.RSSI
6466
gatewayMetadata.SNR = antenna.SNR

core/types/gateway_metadata.go

+11-9
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ package types
55

66
// GatewayMetadata contains metadata for each gateway that received a message
77
type GatewayMetadata struct {
8-
GtwID string `json:"gtw_id,omitempty"`
9-
GtwTrusted bool `json:"gtw_trusted,omitempty"`
10-
Timestamp uint32 `json:"timestamp,omitempty"`
11-
Time JSONTime `json:"time,omitempty"`
12-
Antenna uint8 `json:"antenna,omitempty"`
13-
Channel uint32 `json:"channel"`
14-
RSSI float32 `json:"rssi"`
15-
SNR float32 `json:"snr"`
16-
RFChain uint32 `json:"rf_chain"`
8+
GtwID string `json:"gtw_id,omitempty"`
9+
GtwTrusted bool `json:"gtw_trusted,omitempty"`
10+
Timestamp uint32 `json:"timestamp,omitempty"`
11+
FineTimestamp uint64 `json:"fine_timestamp,omitempty"`
12+
FineTimestampEncrypted []byte `json:"fine_timestamp_encrypted,omitempty"`
13+
Time JSONTime `json:"time,omitempty"`
14+
Antenna uint8 `json:"antenna,omitempty"`
15+
Channel uint32 `json:"channel"`
16+
RSSI float32 `json:"rssi"`
17+
SNR float32 `json:"snr"`
18+
RFChain uint32 `json:"rf_chain"`
1719
LocationMetadata
1820
}

0 commit comments

Comments
 (0)