Skip to content

Commit

Permalink
update protos
Browse files Browse the repository at this point in the history
  • Loading branch information
ARizzo35 committed Aug 17, 2024
1 parent 7fb3fbd commit 98d4c76
Show file tree
Hide file tree
Showing 21 changed files with 2,281 additions and 142 deletions.
7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ exclude = [
]

[dependencies]
tonic = "0.10.2"
prost = "0.12.3"
tonic = "0.12.1"
prost = "0.13.1"
prost-types = "0.13.1"

[build-dependencies]
tonic-build = "0.10.2"
tonic-build = "0.12.1"

[dev-dependencies]
async-stream = "0.3.5"
Expand Down
11 changes: 9 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,22 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.protoc_arg("--experimental_allow_proto3_optional")
.compile(
&[
"proto/google/protobuf/timestamp.proto",
"proto/google/protobuf/wrappers.proto",
"proto/spacex/api/common/status/status.proto",
"proto/spacex/api/device/command.proto",
"proto/spacex/api/device/common.proto",
"proto/spacex/api/device/device.proto",
"proto/spacex/api/device/dish.proto",
"proto/spacex/api/device/service.proto",
"proto/spacex/api/device/dish_config.proto",
"proto/spacex/api/device/rssi_scan.proto",
"proto/spacex/api/device/services/unlock/service.proto",
"proto/spacex/api/device/transceiver.proto",
"proto/spacex/api/device/wifi_config.proto",
"proto/spacex/api/device/wifi.proto",
"proto/spacex/api/device/wifi_config.proto",
"proto/spacex/api/device/wifi_util.proto",
"proto/spacex/api/satellites/network/ut_disablement_codes.proto",
"proto/spacex/api/telemetron/public/common/time.proto",
],
&["proto/"],
)?;
Expand Down
Binary file modified codegen/static/device.protoset
Binary file not shown.
11 changes: 11 additions & 0 deletions proto/google/protobuf/timestamp.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
syntax = "proto3";

package google.protobuf;

option go_package = "google.golang.org/protobuf/types/known/timestamppb";

message Timestamp {
optional int64 seconds = 1 [json_name="seconds"];
optional int32 nanos = 2 [json_name="nanos"];
}

42 changes: 42 additions & 0 deletions proto/google/protobuf/wrappers.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
syntax = "proto3";

package google.protobuf;

option go_package = "google.golang.org/protobuf/types/known/wrapperspb";

message DoubleValue {
optional double value = 1 [json_name="value"];
}

message FloatValue {
optional float value = 1 [json_name="value"];
}

message Int64Value {
optional int64 value = 1 [json_name="value"];
}

message UInt64Value {
optional uint64 value = 1 [json_name="value"];
}

message Int32Value {
optional int32 value = 1 [json_name="value"];
}

message UInt32Value {
optional uint32 value = 1 [json_name="value"];
}

message BoolValue {
optional bool value = 1 [json_name="value"];
}

message StringValue {
optional string value = 1 [json_name="value"];
}

message BytesValue {
optional bytes value = 1 [json_name="value"];
}

1 change: 1 addition & 0 deletions proto/spacex/api/common/status/status.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ message Status {
optional int32 code = 1 [json_name="code"];
optional string message = 2 [json_name="message"];
}

23 changes: 22 additions & 1 deletion proto/spacex/api/device/command.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,36 @@ option go_package = "spacex.com/api/device";
message PublicKey {
optional string key = 1 [json_name="key"];
repeated .SpaceX.API.Device.Capability capabilities = 2 [json_name="capabilities"];
optional .SpaceX.API.Device.User user = 3 [json_name="user"];
}

enum Capability {
READ = 0;
READ_INTERNAL = 13;
READ_PRIVATE = 7;
LOCAL = 14;
WRITE = 1;
WRITE_PERSISTENT = 11;
DEBUG = 2;
ADMIN = 3;
SETUP = 4;
SET_SKU = 5;
REFRESH = 6;
READ_PRIVATE = 7;
FUSE = 8;
RESET = 9;
TEST = 10;
SSH = 12;
GUEST = 15;
}

enum User {
NO_USER = 0;
GOD = 1;
LAN = 2;
CLOUD = 3;
FACTORY = 4;
ROUTER = 5;
GUEST_LAN = 6;
SENSITIVE_COMMANDING = 7;
}

114 changes: 100 additions & 14 deletions proto/spacex/api/device/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,19 @@ option go_package = "spacex.com/api/device";
message DeviceInfo {
optional string id = 1 [json_name="id"];
optional string hardware_version = 2 [json_name="hardwareVersion"];
optional int32 board_rev = 14 [json_name="boardRev"];
optional string software_version = 3 [json_name="softwareVersion"];
optional string manufactured_version = 11 [json_name="manufacturedVersion"];
optional int64 generation_number = 12 [json_name="generationNumber"];
optional string country_code = 4 [json_name="countryCode"];
optional int32 utc_offset_s = 5 [json_name="utcOffsetS"];
optional bool software_partitions_equal = 6 [json_name="softwarePartitionsEqual"];
optional bool is_dev = 7 [json_name="isDev"];
optional int32 bootcount = 8 [json_name="bootcount"];
optional int32 anti_rollback_version = 9 [json_name="antiRollbackVersion"];
optional bool is_hitl = 10 [json_name="isHitl"];
optional .SpaceX.API.Device.BootInfo boot = 1001 [json_name="boot"];
optional bool dish_cohoused = 13 [json_name="dishCohoused"];
}

message DeviceState {
Expand All @@ -29,6 +39,25 @@ message GetNextIdResponse {
optional uint64 epoch_id = 2 [json_name="epochId"];
}

message BootInfo {
repeated .SpaceX.API.Device.BootInfo.CountByReasonEntry count_by_reason = 1 [json_name="countByReason"];
repeated .SpaceX.API.Device.BootInfo.CountByReasonDeltaEntry count_by_reason_delta = 4 [json_name="countByReasonDelta"];
optional .SpaceX.API.Device.BootReason last_reason = 2 [json_name="lastReason"];
optional int32 last_count = 3 [json_name="lastCount"];
optional bool crash_boot = 5 [json_name="crashBoot"];
optional int32 crash_boot_count = 6 [json_name="crashBootCount"];
message CountByReasonEntry {
optional int32 key = 1 [json_name="key"];
optional int32 value = 2 [json_name="value"];
}

message CountByReasonDeltaEntry {
optional int32 key = 1 [json_name="key"];
optional int32 value = 2 [json_name="value"];
}

}

message PingTarget {
optional string service = 1 [json_name="service"];
optional string location = 2 [json_name="location"];
Expand Down Expand Up @@ -58,21 +87,28 @@ message ChallengeResponse {

message NetworkInterface {
optional string name = 1 [json_name="name"];
optional bool up = 4 [json_name="up"];
optional string mac_address = 5 [json_name="macAddress"];
repeated string ipv4_addresses = 6 [json_name="ipv4Addresses"];
repeated string ipv6_addresses = 7 [json_name="ipv6Addresses"];
optional .SpaceX.API.Device.NetworkInterface.RxStats rx_stats = 2 [json_name="rxStats"];
optional .SpaceX.API.Device.NetworkInterface.TxStats tx_stats = 3 [json_name="txStats"];
oneof interface {
.SpaceX.API.Device.EthernetNetworkInterface ethernet = 1000 [json_name="ethernet"];
.SpaceX.API.Device.WifiNetworkInterface wifi = 1001 [json_name="wifi"];
.SpaceX.API.Device.BridgeNetworkInterface bridge = 1002 [json_name="bridge"];
}
message RxStats {
optional uint64 bytes = 1 [json_name="bytes"];
optional uint64 packets = 2 [json_name="packets"];
optional uint64 frame_errors = 3 [json_name="frameErrors"];
}
message TxStats {
optional uint64 bytes = 1 [json_name="bytes"];
optional uint64 packets = 2 [json_name="packets"];
}
message RxStats {
optional uint64 bytes = 1 [json_name="bytes"];
optional uint64 packets = 2 [json_name="packets"];
optional uint64 frame_errors = 3 [json_name="frameErrors"];
}

message TxStats {
optional uint64 bytes = 1 [json_name="bytes"];
optional uint64 packets = 2 [json_name="packets"];
}

}

message EthernetNetworkInterface {
Expand All @@ -88,11 +124,24 @@ message EthernetNetworkInterface {
}

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"];
}
optional .SpaceX.API.Device.WifiNetworkInterface.InvalidPacketCounts invalid_packet_counts = 2 [json_name="invalidPacketCounts"];
optional uint32 channel = 3 [json_name="channel"];
optional uint32 missed_beacons = 8 [json_name="missedBeacons"];
optional double link_quality = 4 [json_name="linkQuality"];
optional double signal_level = 5 [json_name="signalLevel"];
optional double noise_level = 6 [json_name="noiseLevel"];
message InvalidPacketCounts {
optional uint32 rx_invalid_nwid = 1 [json_name="rxInvalidNwid"];
optional uint32 rx_invalid_crypt = 2 [json_name="rxInvalidCrypt"];
optional uint32 rx_invalid_frag = 3 [json_name="rxInvalidFrag"];
optional uint32 tx_excessive_retries = 4 [json_name="txExcessiveRetries"];
optional uint32 invalid_misc = 5 [json_name="invalidMisc"];
}

}

message BridgeNetworkInterface {
repeated string member_names = 1 [json_name="memberNames"];
}

message LLAPosition {
Expand All @@ -106,3 +155,40 @@ message ECEFPosition {
optional double y = 2 [json_name="y"];
optional double z = 3 [json_name="z"];
}

message InitiateRemoteSshRequest {
}

message InitiateRemoteSshResponse {
optional uint32 port = 1 [json_name="port"];
optional string address = 2 [json_name="address"];
optional bytes stsafe = 3 [json_name="stsafe"];
}

message SoftwareUpdateRequest {
optional uint64 stream_id = 1 [json_name="streamId"];
optional bytes data = 2 [json_name="data"];
optional bool open = 3 [json_name="open"];
optional bool close = 4 [json_name="close"];
}

message SoftwareUpdateResponse {
}

enum BootReason {
BOOT_REASON_UNKNOWN = 0;
FORGOTTEN = 1;
POWER_CYCLE = 2;
COMMAND = 3;
SOFTWARE_UPDATE = 4;
CONFIG_UPDATE = 5;
UPTIME_FDIR = 6;
REPEATER_FDIR = 7;
AVIATION_ETH_WAN_FDIR = 8;
KERNEL_PANIC = 9;
INTENTIONAL_KERNEL_PANIC = 14;
MCU_BRINGUP_FAILED_FDIR = 11;
AVIATION_OUTAGE_FDIR = 12;
SOFTWARE_WATCHDOG = 13;
}

Loading

0 comments on commit 98d4c76

Please sign in to comment.