forked from TheThingsNetwork/lorawan-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmetadata.proto
More file actions
105 lines (97 loc) · 4.86 KB
/
metadata.proto
File metadata and controls
105 lines (97 loc) · 4.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// Copyright © 2019 The Things Network Foundation, The Things Industries B.V.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
import "github.com/envoyproxy/protoc-gen-validate/validate/validate.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
import "lorawan-stack/api/enums.proto";
import "lorawan-stack/api/identifiers.proto";
package ttn.lorawan.v3;
option go_package = "go.thethings.network/lorawan-stack/pkg/ttnpb";
// Contains metadata for a received message. Each antenna that receives
// a message corresponds to one RxMetadata.
message RxMetadata {
option (gogoproto.populate) = false;
GatewayIdentifiers gateway_ids = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false, (validate.rules).message.required = true];
uint32 antenna_index = 2;
google.protobuf.Timestamp time = 3 [(gogoproto.stdtime) = true];
// Gateway concentrator timestamp when the Rx finished (microseconds).
uint32 timestamp = 4;
// Gateway's internal fine timestamp when the Rx finished (nanoseconds).
uint64 fine_timestamp = 5;
// Encrypted gateway's internal fine timestamp when the Rx finished (nanoseconds).
bytes encrypted_fine_timestamp = 6;
string encrypted_fine_timestamp_key_id = 7 [(gogoproto.customname) = "EncryptedFineTimestampKeyID"];
// Received signal strength indicator (dBm).
// This value equals `channel_rssi`.
float rssi = 8 [(gogoproto.customname) = "RSSI"];
// Received signal strength indicator of the signal (dBm).
google.protobuf.FloatValue signal_rssi = 16 [(gogoproto.customname) = "SignalRSSI"];
// Received signal strength indicator of the channel (dBm).
float channel_rssi = 9 [(gogoproto.customname) = "ChannelRSSI"];
// Standard deviation of the RSSI during preamble.
float rssi_standard_deviation = 10 [(gogoproto.customname) = "RSSIStandardDeviation"];
// Signal-to-noise ratio (dB).
float snr = 11 [(gogoproto.customname) = "SNR"];
// Frequency offset (Hz).
int64 frequency_offset = 12;
// Antenna location; injected by the Gateway Server.
Location location = 13;
// Gateway downlink path constraint; injected by the Gateway Server.
DownlinkPathConstraint downlink_path_constraint = 14 [(validate.rules).enum.defined_only = true];
// Uplink token to be included in the Tx request in class A downlink; injected by gateway, Gateway Server or fNS.
bytes uplink_token = 15;
// Index of the gateway channel that received the message.
uint32 channel_index = 17 [(validate.rules).uint32 = {lte: 255}];
// Advanced metadata fields
// - can be used for advanced information or experimental features that are not yet formally defined in the API
// - field names are written in snake_case
google.protobuf.Struct advanced = 99;
}
message Location {
// The North–South position (degrees; -90 to +90), where 0 is the equator, North pole is positive, South pole is negative.
double latitude = 1 [(validate.rules).double = {gte: -90, lte: 90}];
// The East-West position (degrees; -180 to +180), where 0 is the Prime Meridian (Greenwich), East is positive , West is negative.
double longitude = 2 [(validate.rules).double = {gte: -180, lte: 180}];
// The altitude (meters), where 0 is the mean sea level.
int32 altitude = 3;
// The accuracy of the location (meters).
int32 accuracy = 4;
// Source of the location information.
LocationSource source = 5 [(validate.rules).enum.defined_only = true];
}
enum LocationSource {
option (gogoproto.goproto_enum_prefix) = false;
// The source of the location is not known or not set.
SOURCE_UNKNOWN = 0;
// The location is determined by GPS.
SOURCE_GPS = 1;
// The location is set in and updated from a registry.
SOURCE_REGISTRY = 3;
// The location is estimated with IP geolocation.
SOURCE_IP_GEOLOCATION = 4;
// The location is estimated with WiFi RSSI geolocation.
SOURCE_WIFI_RSSI_GEOLOCATION = 5;
// The location is estimated with BT/BLE RSSI geolocation.
SOURCE_BT_RSSI_GEOLOCATION = 6;
// The location is estimated with LoRa RSSI geolocation.
SOURCE_LORA_RSSI_GEOLOCATION = 7;
// The location is estimated with LoRa TDOA geolocation.
SOURCE_LORA_TDOA_GEOLOCATION = 8;
// The location is estimated by a combination of geolocation sources.
SOURCE_COMBINED_GEOLOCATION = 9;
// More estimation methods can be added.
}