Skip to content

Commit 5ca76a9

Browse files
authored
[Mobile Config] new gateway service grpc endpoint: info_stream_v3 (#451)
* Introduce new gateway grpc endpoint:info_stream_v3 * Add gateway_info_stream_res_v3 * Deprecate enum device_type * Add gateway_metadata_v3 * Split gateway_metadata_v3 into location_info and deployment_info
1 parent 2ebbdb1 commit 5ca76a9

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

src/service/mobile_config.proto

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,49 @@ message gateway_info_v2 {
8383
uint64 updated_at = 5;
8484
}
8585

86+
// Warning: Be careful, values in v2 differ from v1
87+
enum device_type_v2 {
88+
device_type_v2_indoor = 0;
89+
device_type_v2_outdoor = 1;
90+
device_type_v2_data_only = 2;
91+
}
92+
93+
message location_info {
94+
// The res12 h3 index asserted address of the gateway as a string
95+
string location = 1;
96+
// The Unix epoch timestamp (in seconds) when the location was last changed
97+
uint64 location_changed_at = 2;
98+
}
99+
100+
message deployment_info {
101+
// The antenna ID of the gateway
102+
uint32 antenna = 1;
103+
// The height of the hotspot above ground level, in whole meters
104+
uint32 elevation = 2;
105+
// The azimuth (direction) of the antenna, in degrees (whole number)
106+
uint32 azimuth = 3;
107+
}
108+
109+
message gateway_metadata_v3 {
110+
location_info location_info = 1;
111+
deployment_info deployment_info = 2;
112+
}
113+
114+
message gateway_info_v3 {
115+
// The public key binary address and on-chain identity of the gateway
116+
bytes address = 1;
117+
// The gateway metadata
118+
gateway_metadata_v3 metadata = 2;
119+
// the asserted device type of the gateway
120+
device_type_v2 device_type = 3;
121+
// The Unix epoch timestamp (in seconds) when the gateway was first added to
122+
// the database
123+
uint64 created_at = 4;
124+
// The Unix epoch timestamp (in seconds) when the gateway parameters were last
125+
// updated. NOTE: This field is also updated when the location changes.
126+
uint64 updated_at = 5;
127+
}
128+
86129
message gateway_info_req_v1 {
87130
// The public key address of the gateway to look up
88131
bytes address = 1;
@@ -131,6 +174,27 @@ message gateway_info_stream_req_v1 {
131174
repeated device_type device_types = 4;
132175
}
133176

177+
message gateway_info_stream_req_v3 {
178+
// max number of gateway info records in each message of the response stream
179+
uint32 batch_size = 1;
180+
// pubkey binary of the signing keypair
181+
bytes signer = 2;
182+
bytes signature = 3;
183+
// Device types that will be returned in the response
184+
// Returns all devices if empty
185+
repeated device_type_v2 device_types = 4;
186+
// The Unix epoch timestamp (in seconds).
187+
// Filters the response based on the last time gateway parameter(s) was
188+
// updated. Use 0 to fetch all gateways.
189+
// NOTE: It is recommended to use the highest `updated_at` field from
190+
// returned radios in the next subsequent requests.
191+
uint64 min_updated_at = 5;
192+
// The Unix epoch timestamp (in seconds).
193+
// Filters the response based on the last time gateway changed its location.
194+
// Use 0 to fetch all gateways.
195+
uint64 min_location_changed_at = 6;
196+
}
197+
134198
message gateway_info_stream_req_v2 {
135199
// max number of gateway info records in each message of the response stream
136200
uint32 batch_size = 1;
@@ -168,6 +232,16 @@ message gateway_info_stream_res_v2 {
168232
bytes signature = 4;
169233
}
170234

235+
message gateway_info_stream_res_v3 {
236+
// a list of gateway info numbering up to the request batch size
237+
repeated gateway_info_v3 gateways = 1;
238+
// unix epoch timestamp in seconds
239+
uint64 timestamp = 2;
240+
// pubkey binary of the signing keypair
241+
bytes signer = 3;
242+
bytes signature = 4;
243+
}
244+
171245
message entity_verify_req_v1 {
172246
// binary identifier of the entity
173247
bytes entity_id = 1;
@@ -227,6 +301,7 @@ enum network_key_role {
227301
}
228302

229303
enum device_type {
304+
option deprecated = true;
230305
cbrs = 0;
231306
wifi_indoor = 1;
232307
wifi_outdoor = 2;
@@ -379,6 +454,11 @@ service gateway {
379454
// Get info for a batch of gateways specified by public key (V2)
380455
rpc info_batch_v2(gateway_info_batch_req_v1)
381456
returns (stream gateway_info_stream_res_v2);
457+
458+
// V3
459+
// Get a stream of gateway info (V3)
460+
rpc info_stream_v3(gateway_info_stream_req_v3)
461+
returns (stream gateway_info_stream_res_v3);
382462
}
383463

384464
service entity {

0 commit comments

Comments
 (0)