Skip to content

Commit

Permalink
swtich to orb.mcu package prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
TheButlah committed Oct 17, 2024
1 parent 25ee722 commit d799435
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 65 deletions.
1 change: 1 addition & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ fn main() {

// rebuild if any of this changes
println!("cargo:rerun-if-env-changed=PROTOC");
println!("cargo:rerun-if-env-changed=build.rs");
println!("cargo:rerun-if-env-changed=PROTOC_INCLUDE");
println!("cargo:rerun-if-changed={}", messages_dir.display());
println!("cargo:rerun-if-changed={}", priv_dir.display());
Expand Down
6 changes: 3 additions & 3 deletions messages/common.options
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
orb.FirmwareUpdateData.image_block max_size: 39
orb.Log.log max_length: 50
orb.MemfaultEvent.chunk max_size: 50
orb.mcu.FirmwareUpdateData.image_block max_size: 39
orb.mcu.Log.log max_length: 50
orb.mcu.MemfaultEvent.chunk max_size: 50
2 changes: 1 addition & 1 deletion messages/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

// Types that are shared by all microcontrollers.
// To avoid cyclic dependencies, we must avoid importing anything else.
package orb;
package orb.mcu;

// This reply message is sent to acknowledge successful processing of a
// JetsonToMcu message
Expand Down
24 changes: 12 additions & 12 deletions messages/main.options
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
orb.main.GNSSData.nmea max_length: 82
orb.main.GNSSDataPartial.nmea_part max_length: 50
orb.main.UserCenterLEDsSequence.rgb_uncompressed max_size: 192
orb.main.UserCenterLEDsSequence.argb32_uncompressed max_size: 256
orb.main.UserRingLEDsSequence.rgb_uncompressed max_size: 672
orb.main.UserRingLEDsSequence.argb32_uncompressed max_size: 396
orb.main.DistributorLEDsSequence.rgb_uncompressed max_size: 15
orb.main.DistributorLEDsSequence.argb32_uncompressed max_size: 20
orb.main.ConeLEDsSequence.rgb_uncompressed max_size: 192
orb.main.ConeLEDsSequence.argb32_uncompressed max_size: 256
orb.main.IREyeCameraFocusSweepLensValues max_size: 600
orb.main.BatteryInfoHwFw.mcu_id max_size: 12
orb.mcu.main.GNSSData.nmea max_length: 82
orb.mcu.main.GNSSDataPartial.nmea_part max_length: 50
orb.mcu.main.UserCenterLEDsSequence.rgb_uncompressed max_size: 192
orb.mcu.main.UserCenterLEDsSequence.argb32_uncompressed max_size: 256
orb.mcu.main.UserRingLEDsSequence.rgb_uncompressed max_size: 672
orb.mcu.main.UserRingLEDsSequence.argb32_uncompressed max_size: 396
orb.mcu.main.DistributorLEDsSequence.rgb_uncompressed max_size: 15
orb.mcu.main.DistributorLEDsSequence.argb32_uncompressed max_size: 20
orb.mcu.main.ConeLEDsSequence.rgb_uncompressed max_size: 192
orb.mcu.main.ConeLEDsSequence.argb32_uncompressed max_size: 256
orb.mcu.main.IREyeCameraFocusSweepLensValues max_size: 600
orb.mcu.main.BatteryInfoHwFw.mcu_id max_size: 12
40 changes: 20 additions & 20 deletions messages/main.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax = "proto3";

package orb.main;
package orb.mcu.main;

import "common.proto";

Expand All @@ -15,8 +15,8 @@ message JetsonToMcu
oneof payload
{
ShutdownWithDelay shutdown = 2;
orb.RebootWithDelay reboot = 3;
orb.Temperature temperature = 4;
orb.mcu.RebootWithDelay reboot = 3;
orb.mcu.Temperature temperature = 4;
MirrorAngle mirror_angle = 5;
PerformMirrorHoming do_homing = 6;
InfraredLEDs infrared_leds = 7;
Expand All @@ -26,7 +26,7 @@ message JetsonToMcu
UserLEDsBrightness user_leds_brightness = 11;
DistributorLEDsPattern distributor_leds_pattern = 12;
DistributorLEDsBrightness distributor_leds_brightness = 13;
orb.FirmwareUpdateData dfu_block = 14;
orb.mcu.FirmwareUpdateData dfu_block = 14;
StartTriggeringIrEyeCamera start_triggering_ir_eye_camera = 16;
StopTriggeringIrEyeCamera stop_triggering_ir_eye_camera = 17;
StartTriggeringIrFaceCamera start_triggering_ir_face_camera = 18;
Expand All @@ -38,15 +38,15 @@ message JetsonToMcu
Fps fps = 25;
LiquidLens liquid_lens = 26;
VoltageRequest voltage_request = 27;
orb.FirmwareImageCheck fw_image_check = 28;
orb.FirmwareActivateSecondary fw_image_secondary_activate = 29;
orb.Heartbeat heartbeat = 30;
orb.mcu.FirmwareImageCheck fw_image_check = 28;
orb.mcu.FirmwareActivateSecondary fw_image_secondary_activate = 29;
orb.mcu.Heartbeat heartbeat = 30;
MirrorAngleRelative mirror_angle_relative = 32;
orb.ValueGet value_get = 33;
orb.mcu.ValueGet value_get = 33;
UserRingLEDsSequence ring_leds_sequence = 34;
UserCenterLEDsSequence center_leds_sequence = 35;
DistributorLEDsSequence distributor_leds_sequence = 36;
orb.FirmwareConfirmPrimary fw_image_primary_confirm = 37;
orb.mcu.FirmwareConfirmPrimary fw_image_primary_confirm = 37;
IREyeCameraFocusSweepValuesPolynomial
ir_eye_camera_focus_sweep_values_polynomial = 38;
IREyeCameraFocusSweepLensValues ir_eye_camera_focus_sweep_lens_values =
Expand All @@ -58,43 +58,43 @@ message JetsonToMcu
ConeLEDsSequence cone_leds_sequence = 43;
ConeLEDsPattern cone_leds_pattern = 44;
WhiteLEDsBrightness white_leds_brightness = 45;
orb.SyncDiagData sync_diag_data = 46;
orb.DiagTest diag_test = 47;
orb.mcu.SyncDiagData sync_diag_data = 46;
orb.mcu.DiagTest diag_test = 47;
}
}

message McuToJetson
{
oneof payload
{
orb.Ack ack = 1;
orb.mcu.Ack ack = 1;
PowerButton power_button = 2;
BatteryVoltage battery_voltage = 3;
BatteryCapacity battery_capacity = 4;
GNSSData gnss = 5;
orb.Versions versions = 6;
orb.Temperature temperature = 7;
orb.mcu.Versions versions = 6;
orb.mcu.Temperature temperature = 7;
FanStatus fan_status = 8;
IMUData imu_data = 9;
Voltage voltage = 10;
orb.Log log = 11;
orb.mcu.Log log = 11;
MotorRange motor_range = 12;
orb.FatalError fatal_error = 13;
orb.mcu.FatalError fatal_error = 13;
BatteryIsCharging battery_is_charging = 14;
BatteryDiagnosticCommon battery_diag_common = 15;
ToF_1D tof_1d = 16;
GNSSDataPartial gnss_partial = 17;
AmbientLight front_als = 18;
orb.Hardware hardware = 19;
orb.HardwareDiagnostic hardware_diag = 20;
orb.mcu.Hardware hardware = 19;
orb.mcu.HardwareDiagnostic hardware_diag = 20;
BatteryResetReason battery_reset_reason = 21;
BatteryDiagnosticSafety battery_diag_safety = 22;
BatteryDiagnosticPermanentFail battery_diag_permanent_fail = 23;
BatteryInfoHwFw battery_info_hw_fw = 24;
BatteryInfoMaxValues battery_info_max_values = 25;
BatteryInfoSocAndStatistics battery_info_soc_and_statistics = 26;
ConePresent cone_present = 27;
orb.MemfaultEvent memfault_event = 28;
orb.mcu.MemfaultEvent memfault_event = 28;
BatteryStateOfHealth battery_state_of_health = 29;
ShutdownScheduled shutdown = 30;
}
Expand Down Expand Up @@ -720,7 +720,7 @@ message BatteryInfoHwFw
BATTERY_HW_VERSION_UNDETECTED = 255;
}
HardwareVersion hw_version = 2;
orb.FirmwareVersion fw_version = 3;
orb.mcu.FirmwareVersion fw_version = 3;
}

message BatteryInfoMaxValues
Expand Down
2 changes: 1 addition & 1 deletion messages/orb.proto
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
syntax = "proto3";

// This file is the root of the entire package hierarchy.
package orb;
package orb.mcu;

import "main.proto";
import "sec.proto";
Expand Down
2 changes: 1 addition & 1 deletion messages/private_stub/sec_priv.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax = "proto3";

package orb.sec.private;
package orb.mcu.sec.private;

// incomplete, private definitions
// to be overwritten by actual definitions
Expand Down
2 changes: 1 addition & 1 deletion messages/sec.options
Original file line number Diff line number Diff line change
@@ -1 +1 @@
orb.sec.SERequest.data max_size: 512
orb.mcu.sec.SERequest.data max_size: 512
44 changes: 22 additions & 22 deletions messages/sec.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax = "proto3";

package orb.sec;
package orb.mcu.sec;

import "common.proto";
import "sec_priv.proto";
Expand All @@ -15,16 +15,16 @@ message JetsonToSec
// acknowledge all messages
oneof payload
{
orb.RebootWithDelay reboot = 3;
orb.FirmwareUpdateData dfu_block = 4;
orb.Heartbeat heartbeat = 5;
orb.mcu.RebootWithDelay reboot = 3;
orb.mcu.FirmwareUpdateData dfu_block = 4;
orb.mcu.Heartbeat heartbeat = 5;
SERequest se_request = 6;
orb.FirmwareImageCheck fw_image_check = 20;
orb.FirmwareActivateSecondary fw_image_secondary_activate = 21;
orb.ValueGet value_get = 22;
orb.FirmwareConfirmPrimary fw_image_primary_confirm = 23;
orb.SyncDiagData sync_diag_data = 24;
orb.DiagTest diag_test = 25;
orb.mcu.FirmwareImageCheck fw_image_check = 20;
orb.mcu.FirmwareActivateSecondary fw_image_secondary_activate = 21;
orb.mcu.ValueGet value_get = 22;
orb.mcu.FirmwareConfirmPrimary fw_image_primary_confirm = 23;
orb.mcu.SyncDiagData sync_diag_data = 24;
orb.mcu.DiagTest diag_test = 25;
}
}

Expand All @@ -34,18 +34,18 @@ message SecToJetson

oneof payload
{
orb.Ack ack = 1;
orb.Versions versions = 2;
orb.Log log = 3;
orb.sec.private.SEResponse se_response = 4;
orb.sec.private.Tamper tampered = 5;
orb.BatteryStatus battery_status = 7;
orb.FatalError fatal_error = 8;
orb.sec.private.TamperRaw tamper_raw = 9;
orb.sec.private.TamperStates tamper_states = 10;
orb.Temperature temperature = 11;
orb.MemfaultEvent memfault_event = 12;
orb.HardwareDiagnostic hardware_diag = 13;
orb.mcu.Ack ack = 1;
orb.mcu.Versions versions = 2;
orb.mcu.Log log = 3;
orb.mcu.sec.private.SEResponse se_response = 4;
orb.mcu.sec.private.Tamper tampered = 5;
orb.mcu.BatteryStatus battery_status = 7;
orb.mcu.FatalError fatal_error = 8;
orb.mcu.sec.private.TamperRaw tamper_raw = 9;
orb.mcu.sec.private.TamperStates tamper_states = 10;
orb.mcu.Temperature temperature = 11;
orb.mcu.MemfaultEvent memfault_event = 12;
orb.mcu.HardwareDiagnostic hardware_diag = 13;
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ pub use ::prost;

#[allow(clippy::all, clippy::pedantic)]
mod generated {
include!(concat!(env!("OUT_DIR"), "/orb.rs"));
include!(concat!(env!("OUT_DIR"), "/orb.mcu.rs"));

/// Main MCU messages
pub mod main {
include!(concat!(env!("OUT_DIR"), "/orb.main.rs"));
include!(concat!(env!("OUT_DIR"), "/orb.mcu.main.rs"));
}

/// Security MCU messages
pub mod sec {
include!(concat!(env!("OUT_DIR"), "/orb.sec.rs"));
include!(concat!(env!("OUT_DIR"), "/orb.mcu.sec.rs"));

/// Private obfuscated messages
pub mod private {
include!(concat!(env!("OUT_DIR"), "/orb.sec.private.rs"));
include!(concat!(env!("OUT_DIR"), "/orb.mcu.sec.private.rs"));
}
}
}
Expand Down

0 comments on commit d799435

Please sign in to comment.