Skip to content

Commit

Permalink
update to 2bc83694-2dec-48c8-9061-88b86cdd5d89.uterm.release
Browse files Browse the repository at this point in the history
- add new requests & responses: `RestartControl`, `Fuse`, `DishGetObstructionMap`, `TransceiverGetTelemetry`,
- add `temp` field to `WifiNetworkInterface`
- add `api_version` field to `Response`
- add `unstow` field to `DishStowRequest`
- add `initial_satellite_id`, `initial_gateway_id` & `on_backup_beam` fields to `DishGetContextResponse`
- add `apply_setup_complete`, `mac_wan` , `apply_mac_wan` , `mac_lan` , `apply_mac_lan` , `mac_lan_2ghz` , `apply_mac_lan_2ghz` , `mac_lan_5ghz` , `apply_mac_lan_5ghz` & `device_id` fields to `WifiConfig`
- add `seconds_since_last_15s_outage`, `seconds_since_last_60s_outage` & `seconds_since_last_300s_outage` fields to `PingMetrics`
  • Loading branch information
ewilken committed Jul 19, 2021
1 parent e5cc541 commit 6687dcb
Show file tree
Hide file tree
Showing 9 changed files with 120 additions and 78 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starlink"
version = "0.2.0"
version = "0.3.0"
authors = ["Elias Wilken <[email protected]>"]
edition = "2018"
description = "Rust client implementation to the gRPC endpoint exposed by the SpaceX Starlink user terminal"
Expand Down
Binary file modified codegen/static/device.protoset
Binary file not shown.
110 changes: 34 additions & 76 deletions examples/try_out_all_requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ use starlink::proto::space_x::api::device::{
AuthenticateRequest,
DishEmcRequest,
DishGetContextRequest,
DishGetObstructionMapRequest,
DishStowRequest,
EnableFlowRequest,
FactoryResetRequest,
FuseRequest,
GetDeviceInfoRequest,
GetHeapDumpRequest,
GetHistoryRequest,
Expand All @@ -19,11 +21,13 @@ use starlink::proto::space_x::api::device::{
PingHostRequest,
RebootRequest,
Request,
RestartControlRequest,
SetSkuRequest,
SetTrustedKeysRequest,
SignedData,
SpeedTestRequest,
TransceiverGetStatusRequest,
TransceiverGetTelemetryRequest,
TransceiverIfLoopbackTestRequest,
UpdateRequest,
WifiGetClientsRequest,
Expand All @@ -36,10 +40,12 @@ use starlink::proto::space_x::api::device::{

// AuthenticateRequest -
// DishEmcRequest -
// DishGetContextRequest - working
// DishGetContextRequest - previously working, now permission denied
// DishGetObstructionMapRequest - working
// DishStowRequest -
// EnableFlowRequest -
// FactoryResetRequest -
// FuseRequest - unimplemented
// GetDeviceInfoRequest - working
// GetHeapDumpRequest - unimplemented
// GetHistoryRequest - working
Expand All @@ -51,12 +57,13 @@ use starlink::proto::space_x::api::device::{
// GetStatusRequest - working
// PingHostRequest - unimplemented
// RebootRequest - working
// Request -
// RestartControlRequest - unimplemented
// SetSkuRequest -
// SetTrustedKeysRequest -
// SignedData -
// SpeedTestRequest - unimplemented
// TransceiverGetStatusRequest - unimplemented
// TransceiverGetTelemetryRequest - unimplemented
// TransceiverIfLoopbackTestRequest -
// UpdateRequest - unimplemented
// WifiGetClientsRequest - unimplemented
Expand All @@ -74,47 +81,21 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
// id: None,
// epoch_id: None,
// target_id: None,
// request: Some(request::Request::GetDeviceInfo(GetDeviceInfoRequest {})),
// request: Some(request::Request::DishGetObstructionMap(DishGetObstructionMapRequest {})),
// });

// let response = client.handle(request).await?;

// dbg!(response);

// GetDeviceInfoResponse {
// device_info: Some(
// DeviceInfo {
// id: Some(
// "<my-ID>",
// ),
// hardware_version: Some(
// "rev1_pre_production",
// ),
// software_version: Some(
// "1f86ec34-34ea-4e7a-9758-3842e72422fb.release",
// ),
// country_code: Some(
// "DE",
// ),
// utc_offset_s: Some(
// 1,
// ),
// },
// ),
// }

// let request = tonic::Request::new(Request {
// id: None,
// epoch_id: None,
// target_id: None,
// request: Some(request::Request::DishGetContext(DishGetContextRequest {})),
// request: Some(request::Request::GetDeviceInfo(GetDeviceInfoRequest {})),
// });

// let response = client.handle(request).await?;

// dbg!(response);

// DishGetContextResponse {
// GetDeviceInfoResponse {
// device_info: Some(
// DeviceInfo {
// id: Some(
Expand All @@ -134,40 +115,16 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
// ),
// },
// ),
// device_state: Some(
// DeviceState {
// uptime_s: Some(
// 25298,
// ),
// },
// ),
// obstruction_fraction: Some(
// 0.001093006,
// ),
// obstruction_valid_s: Some(
// 20723.25,
// ),
// cell_id: Some(
// 314900,
// ),
// pop_rack_id: Some(
// 18,
// ),
// seconds_to_slot_end: Some(
// 12.513584,
// ),
// }

// let request = tonic::Request::new(Request {
// id: None,
// epoch_id: None,
// target_id: None,
// request: Some(request::Request::GetStatus(GetStatusRequest {})),
// });

// let response = client.handle(request).await?;

// dbg!(response);
let request = tonic::Request::new(Request {
id: None,
epoch_id: None,
target_id: None,
request: Some(request::Request::GetStatus(GetStatusRequest {})),
});
let response = client.handle(request).await?;
dbg!(response);

// DishGetStatusResponse {
// device_info: Some(
Expand All @@ -179,7 +136,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
// "rev1_pre_production",
// ),
// software_version: Some(
// "1f86ec34-34ea-4e7a-9758-3842e72422fb.release",
// "2bc83694-2dec-48c8-9061-88b86cdd5d89.uterm.release",
// ),
// country_code: Some(
// "DE",
Expand All @@ -192,7 +149,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
// device_state: Some(
// DeviceState {
// uptime_s: Some(
// 26115,
// 765906,
// ),
// },
// ),
Expand All @@ -210,30 +167,30 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
// },
// ),
// snr: Some(
// 6.0,
// 9.0,
// ),
// seconds_to_first_nonempty_slot: None,
// pop_ping_drop_rate: None,
// downlink_throughput_bps: Some(
// 8584784.0,
// 176773.14,
// ),
// uplink_throughput_bps: Some(
// 311510.97,
// 102408.125,
// ),
// pop_ping_latency_ms: Some(
// 38.857143,
// 37.52381,
// ),
// obstruction_stats: Some(
// DishObstructionStats {
// currently_obstructed: None,
// fraction_obstructed: Some(
// 0.0010516815,
// 0.00081779656,
// ),
// last_24h_obstructed_s: Some(
// 72.0,
// 15.0,
// ),
// valid_s: Some(
// 21260.67,
// 765202.0,
// ),
// wedge_fraction_obstructed: [
// 1.0,
Expand All @@ -244,28 +201,29 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
// 0.0,
// 0.0,
// 0.0,
// 0.0,
// 0.006051556,
// 0.0,
// 0.0,
// 0.0,
// ],
// wedge_abs_fraction_obstructed: [
// 0.0010516815,
// 0.0,
// 0.000026709631,
// 0.0,
// 0.0,
// 0.0,
// 0.0,
// 0.0,
// 0.0,
// 0.0,
// 0.00033165555,
// 0.0,
// 0.0,
// 0.0,
// ],
// },
// ),
// }
// stow_requested: None,
// },

Ok(())
}
1 change: 1 addition & 0 deletions proto/spacex/api/device/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ message WifiNetworkInterface {
optional .SpaceX.API.Device.WifiNetworkInterface.ThermalStatus thermal_status = 1 [json_name="thermalStatus"];
message ThermalStatus {
optional uint32 level = 1 [json_name="level"];
optional uint32 temp = 2 [json_name="temp"];
}
}

Expand Down
21 changes: 21 additions & 0 deletions proto/spacex/api/device/device.proto
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,15 @@ message Request {
.SpaceX.API.Device.UpdateRequest update = 1014 [json_name="update"];
.SpaceX.API.Device.GetLocationRequest get_location = 1017 [json_name="getLocation"];
.SpaceX.API.Device.GetHeapDumpRequest get_heap_dump = 1019 [json_name="getHeapDump"];
.SpaceX.API.Device.RestartControlRequest restart_control = 1020 [json_name="restartControl"];
.SpaceX.API.Device.FuseRequest fuse = 1021 [json_name="fuse"];
.SpaceX.API.Device.DishStowRequest dish_stow = 2002 [json_name="dishStow"];
.SpaceX.API.Device.DishGetContextRequest dish_get_context = 2003 [json_name="dishGetContext"];
.SpaceX.API.Device.DishGetObstructionMapRequest dish_get_obstruction_map = 2008 [json_name="dishGetObstructionMap"];
.SpaceX.API.Device.DishEmcRequest dish_emc = 2007 [json_name="dishEmc"];
.SpaceX.API.Device.TransceiverIFLoopbackTestRequest transceiver_if_loopback_test = 4001 [json_name="transceiverIfLoopbackTest"];
.SpaceX.API.Device.TransceiverGetStatusRequest transceiver_get_status = 4003 [json_name="transceiverGetStatus"];
.SpaceX.API.Device.TransceiverGetTelemetryRequest transceiver_get_telemetry = 4004 [json_name="transceiverGetTelemetry"];
.SpaceX.API.Device.WifiGetClientsRequest wifi_get_clients = 3002 [json_name="wifiGetClients"];
.SpaceX.API.Device.WifiGetDiagnosticsRequest wifi_get_diagnostics = 3008 [json_name="wifiGetDiagnostics"];
.SpaceX.API.Device.WifiGetPingMetricsRequest wifi_get_ping_metrics = 3007 [json_name="wifiGetPingMetrics"];
Expand All @@ -65,6 +69,7 @@ message Request {
message Response {
optional uint64 id = 1 [json_name="id"];
optional .SpaceX.API.Status.Status status = 2 [json_name="status"];
optional uint64 api_version = 3 [json_name="apiVersion"];
oneof response {
.SpaceX.API.Device.GetNextIdResponse get_next_id = 1006 [json_name="getNextId"];
.SpaceX.API.Device.EnableFlowResponse enable_flow = 1018 [json_name="enableFlow"];
Expand All @@ -81,14 +86,18 @@ message Response {
.SpaceX.API.Device.UpdateResponse update = 1014 [json_name="update"];
.SpaceX.API.Device.GetLocationResponse get_location = 1017 [json_name="getLocation"];
.SpaceX.API.Device.GetHeapDumpResponse get_heap_dump = 1019 [json_name="getHeapDump"];
.SpaceX.API.Device.RestartControlResponse restart_control = 1020 [json_name="restartControl"];
.SpaceX.API.Device.FuseResponse fuse = 1021 [json_name="fuse"];
.SpaceX.API.Device.DishAuthenticateResponse dish_authenticate = 2005 [json_name="dishAuthenticate"];
.SpaceX.API.Device.DishGetContextResponse dish_get_context = 2003 [json_name="dishGetContext"];
.SpaceX.API.Device.DishGetHistoryResponse dish_get_history = 2006 [json_name="dishGetHistory"];
.SpaceX.API.Device.DishGetStatusResponse dish_get_status = 2004 [json_name="dishGetStatus"];
.SpaceX.API.Device.DishGetObstructionMapResponse dish_get_obstruction_map = 2008 [json_name="dishGetObstructionMap"];
.SpaceX.API.Device.DishStowResponse dish_stow = 2002 [json_name="dishStow"];
.SpaceX.API.Device.DishEmcResponse dish_emc = 2007 [json_name="dishEmc"];
.SpaceX.API.Device.TransceiverIFLoopbackTestResponse transceiver_if_loopback_test = 4001 [json_name="transceiverIfLoopbackTest"];
.SpaceX.API.Device.TransceiverGetStatusResponse transceiver_get_status = 4003 [json_name="transceiverGetStatus"];
.SpaceX.API.Device.TransceiverGetTelemetryResponse transceiver_get_telemetry = 4004 [json_name="transceiverGetTelemetry"];
.SpaceX.API.Device.WifiAuthenticateResponse wifi_authenticate = 3005 [json_name="wifiAuthenticate"];
.SpaceX.API.Device.WifiGetClientsResponse wifi_get_clients = 3002 [json_name="wifiGetClients"];
.SpaceX.API.Device.WifiGetDiagnosticsResponse wifi_get_diagnostics = 3008 [json_name="wifiGetDiagnostics"];
Expand Down Expand Up @@ -122,6 +131,12 @@ message FactoryResetRequest {
message FactoryResetResponse {
}

message FuseRequest {
}

message FuseResponse {
}

message GetHistoryRequest {
}

Expand Down Expand Up @@ -210,6 +225,12 @@ message UpdateRequest {
message UpdateResponse {
}

message RestartControlRequest {
}

message RestartControlResponse {
}

message GetNetworkInterfacesRequest {
}

Expand Down
14 changes: 14 additions & 0 deletions proto/spacex/api/device/dish.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ option go_package = "spacex.com/api/device";
import "spacex/api/device/common.proto";

message DishStowRequest {
optional bool unstow = 1 [json_name="unstow"];
}

message DishStowResponse {
Expand All @@ -22,6 +23,9 @@ message DishGetContextResponse {
optional float obstruction_valid_s = 3 [json_name="obstructionValidS"];
optional uint32 cell_id = 4 [json_name="cellId"];
optional uint32 pop_rack_id = 5 [json_name="popRackId"];
optional uint32 initial_satellite_id = 8 [json_name="initialSatelliteId"];
optional uint32 initial_gateway_id = 9 [json_name="initialGatewayId"];
optional bool on_backup_beam = 10 [json_name="onBackupBeam"];
optional float seconds_to_slot_end = 6 [json_name="secondsToSlotEnd"];
}

Expand All @@ -48,6 +52,16 @@ message DishGetStatusResponse {
optional float uplink_throughput_bps = 1008 [json_name="uplinkThroughputBps"];
optional float pop_ping_latency_ms = 1009 [json_name="popPingLatencyMs"];
optional .SpaceX.API.Device.DishObstructionStats obstruction_stats = 1004 [json_name="obstructionStats"];
optional bool stow_requested = 1010 [json_name="stowRequested"];
}

message DishGetObstructionMapRequest {
}

message DishGetObstructionMapResponse {
optional uint32 num_rows = 1 [json_name="numRows"];
optional uint32 num_cols = 2 [json_name="numCols"];
repeated float snr = 3 [json_name="snr"];
}

message DishAlerts {
Expand Down
Loading

0 comments on commit 6687dcb

Please sign in to comment.