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

Commit

Permalink
Merge pull request #680 from TheThingsNetwork/feature/localization
Browse files Browse the repository at this point in the history
Add encrypted and fine timestamp to MQTT metadata
  • Loading branch information
htdvisser authored Oct 10, 2017
2 parents 4ac960c + 0e1a144 commit 0c455d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 2 additions & 0 deletions core/handler/convert_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ func (h *handler) ConvertMetadata(ctx ttnlog.Interface, ttnUp *pb_broker.Dedupli
if antennas := in.GetAntennas(); len(antennas) > 0 {
for _, antenna := range antennas {
gatewayMetadata.Antenna = uint8(antenna.Antenna)
gatewayMetadata.FineTimestamp = uint64(antenna.FineTime)
gatewayMetadata.FineTimestampEncrypted = antenna.EncryptedTime
gatewayMetadata.Channel = antenna.Channel
gatewayMetadata.RSSI = antenna.RSSI
gatewayMetadata.SNR = antenna.SNR
Expand Down
20 changes: 11 additions & 9 deletions core/types/gateway_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ package types

// GatewayMetadata contains metadata for each gateway that received a message
type GatewayMetadata struct {
GtwID string `json:"gtw_id,omitempty"`
GtwTrusted bool `json:"gtw_trusted,omitempty"`
Timestamp uint32 `json:"timestamp,omitempty"`
Time JSONTime `json:"time,omitempty"`
Antenna uint8 `json:"antenna,omitempty"`
Channel uint32 `json:"channel"`
RSSI float32 `json:"rssi"`
SNR float32 `json:"snr"`
RFChain uint32 `json:"rf_chain"`
GtwID string `json:"gtw_id,omitempty"`
GtwTrusted bool `json:"gtw_trusted,omitempty"`
Timestamp uint32 `json:"timestamp,omitempty"`
FineTimestamp uint64 `json:"fine_timestamp,omitempty"`
FineTimestampEncrypted []byte `json:"fine_timestamp_encrypted,omitempty"`
Time JSONTime `json:"time,omitempty"`
Antenna uint8 `json:"antenna,omitempty"`
Channel uint32 `json:"channel"`
RSSI float32 `json:"rssi"`
SNR float32 `json:"snr"`
RFChain uint32 `json:"rf_chain"`
LocationMetadata
}

0 comments on commit 0c455d4

Please sign in to comment.