add first tests for assy helper
This commit is contained in:
@ -488,12 +488,6 @@ impl ModeRequestHandler for AcsSubsystem {
|
||||
}
|
||||
}
|
||||
|
||||
impl AcsSubsystem {
|
||||
fn internal_request_id(&self) -> Option<RequestId> {
|
||||
self.subsystem_helper.internal_request_id()
|
||||
}
|
||||
}
|
||||
|
||||
struct MgmAssembly {
|
||||
pub mode_node: ModeRequestorAndHandlerMpscBounded,
|
||||
pub mode_requestor_info: Option<MessageMetadata>,
|
||||
@ -544,9 +538,9 @@ impl MgmAssembly {
|
||||
// Otherwise, we command everything OFF, because we can not keep the mode.
|
||||
}
|
||||
AssemblyHelperResult::ModeCommandingDone => {
|
||||
if self.commanding_helper.target_mode.is_some() {
|
||||
if self.commanding_helper.target_mode().is_some() {
|
||||
// Complete the mode command.
|
||||
self.mode_and_submode = self.commanding_helper.target_mode.take().unwrap();
|
||||
self.mode_and_submode = self.commanding_helper.target_mode().unwrap();
|
||||
self.handle_mode_reached(self.mode_requestor_info)?;
|
||||
}
|
||||
}
|
||||
@ -593,7 +587,7 @@ impl ModeRequestHandler for MgmAssembly {
|
||||
forced: bool,
|
||||
) -> Result<(), Self::Error> {
|
||||
// Always accept forced commands and commands to mode OFF.
|
||||
if self.commanding_helper.target_mode.is_some()
|
||||
if self.commanding_helper.target_mode().is_some()
|
||||
&& !forced
|
||||
&& mode_and_submode.mode() != DefaultMode::OFF as u32
|
||||
{
|
||||
@ -739,10 +733,10 @@ impl DeviceManager {
|
||||
}
|
||||
}
|
||||
AssemblyHelperResult::ModeCommandingDone => {
|
||||
if self.commanding_helper.target_mode.is_some() {
|
||||
if self.commanding_helper.target_mode().is_some() {
|
||||
// Complete the mode command.
|
||||
self.handle_mode_reached(self.mode_requestor_info)?;
|
||||
self.mode_and_submode = self.commanding_helper.target_mode.take().unwrap();
|
||||
self.mode_and_submode = self.commanding_helper.target_mode().unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user