Skip to content

Commit 49973ae

Browse files
committed
track unrelated mgs changes (factor me out pls)
1 parent 4cf9246 commit 49973ae

File tree

4 files changed

+66
-1
lines changed

4 files changed

+66
-1
lines changed

gateway-types/src/component_details.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ pub enum MeasurementKind {
374374
InputCurrent,
375375
InputVoltage,
376376
Speed,
377+
CpuTctl,
377378
}
378379

379380
impl From<gateway_messages::measurement::MeasurementKind> for MeasurementKind {
@@ -387,6 +388,7 @@ impl From<gateway_messages::measurement::MeasurementKind> for MeasurementKind {
387388
MeasurementKind::InputCurrent => Self::InputCurrent,
388389
MeasurementKind::InputVoltage => Self::InputVoltage,
389390
MeasurementKind::Speed => Self::Speed,
391+
MeasurementKind::CpuTctl => Self::CpuTctl,
390392
}
391393
}
392394
}

gateway/src/metrics.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,11 +791,13 @@ impl SpPoller {
791791
// We do this first so that we only have to clone the
792792
// sensor's name if there's an error, rather than always
793793
// cloning it in *case* there's an error.
794+
const TCTL_NAME: &str = "amd_cpu_tctl";
794795
if let Err(error) = m.value {
795796
let kind = match m.kind {
796797
MeasurementKind::Temperature if is_tctl => {
797-
"amd_cpu_tctl"
798+
TCTL_NAME
798799
}
800+
MeasurementKind::CpuTctl => TCTL_NAME,
799801
MeasurementKind::Temperature => "temperature",
800802
MeasurementKind::Current => "current",
801803
MeasurementKind::Voltage => "voltage",
@@ -878,6 +880,17 @@ impl SpPoller {
878880
&metric::Temperature { sensor, datum: 0.0 },
879881
)
880882
}
883+
884+
(Ok(datum), MeasurementKind::CpuTctl) => Sample::new(
885+
target,
886+
&metric::AmdCpuTctl { sensor, datum },
887+
),
888+
(Err(_), MeasurementKind::CpuTctl) => {
889+
Sample::new_missing(
890+
target,
891+
&metric::AmdCpuTctl { sensor, datum: 0.0 },
892+
)
893+
}
881894
(Ok(datum), MeasurementKind::Current) => Sample::new(
882895
target,
883896
&metric::Current { sensor, datum },
@@ -1204,5 +1217,8 @@ fn comms_error_str(error: CommunicationError) -> &'static str {
12041217
CommunicationError::BadTrailingDataSize { .. } => {
12051218
"bad_trailing_data_size"
12061219
}
1220+
CommunicationError::BadDecompressionSize { .. } => {
1221+
"bad_decompressed_size"
1222+
}
12071223
}
12081224
}

sp-sim/src/gimlet.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ use gateway_messages::SpError;
3434
use gateway_messages::SpPort;
3535
use gateway_messages::SpRequest;
3636
use gateway_messages::SpStateV2;
37+
use gateway_messages::DumpSegment;
38+
use gateway_messages::DumpTask;
3739
use gateway_messages::ignition::{self, LinkEvents};
3840
use gateway_messages::sp_impl::Sender;
3941
use gateway_messages::sp_impl::SpHandler;
@@ -1502,6 +1504,28 @@ impl SpHandler for Handler {
15021504
}
15031505
}
15041506
}
1507+
1508+
fn get_task_dump_count(&mut self) -> Result<u32, SpError> {
1509+
unimplemented!()
1510+
}
1511+
1512+
fn task_dump_read_start(
1513+
&mut self,
1514+
_index: u32,
1515+
_key: [u8; 16],
1516+
) -> Result<DumpTask, SpError> {
1517+
unimplemented!()
1518+
}
1519+
1520+
fn task_dump_read_continue(
1521+
&mut self,
1522+
_key: [u8; 16],
1523+
_seq: u32,
1524+
_buf: &mut [u8],
1525+
) -> Result<Option<DumpSegment>, SpError> {
1526+
unimplemented!()
1527+
}
1528+
15051529
}
15061530

15071531
impl SimSpHandler for Handler {

sp-sim/src/sidecar.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ use gateway_messages::ComponentAction;
2727
use gateway_messages::ComponentActionResponse;
2828
use gateway_messages::ComponentDetails;
2929
use gateway_messages::DiscoverResponse;
30+
use gateway_messages::DumpSegment;
31+
use gateway_messages::DumpTask;
3032
use gateway_messages::IgnitionCommand;
3133
use gateway_messages::IgnitionState;
3234
use gateway_messages::MgsError;
@@ -1202,6 +1204,27 @@ impl SpHandler for Handler {
12021204
}
12031205
}
12041206
}
1207+
1208+
fn get_task_dump_count(&mut self) -> Result<u32, SpError> {
1209+
unimplemented!()
1210+
}
1211+
1212+
fn task_dump_read_start(
1213+
&mut self,
1214+
_index: u32,
1215+
_key: [u8; 16],
1216+
) -> Result<DumpTask, SpError> {
1217+
unimplemented!()
1218+
}
1219+
1220+
fn task_dump_read_continue(
1221+
&mut self,
1222+
_key: [u8; 16],
1223+
_seq: u32,
1224+
_buf: &mut [u8],
1225+
) -> Result<Option<DumpSegment>, SpError> {
1226+
unimplemented!()
1227+
}
12051228
}
12061229

12071230
impl SimSpHandler for Handler {

0 commit comments

Comments
 (0)