pub trait PlatformServices {
type OtaWriter: OtaActions + 'static;
type Can: BufferedCan + 'static;
// Required methods
fn can(&self) -> &'static Self::Can;
fn save_config(
&self,
config: &SSHStampConfig,
) -> impl Future<Output = Result<(), HalError>>;
fn reset(&self) -> !;
fn ota_writer(&self) -> Self::OtaWriter;
fn activate_uart(&self);
}Expand description
Platform-owned services the app layer cannot provide on its own.
§Contract
Self::save_configmust be durable: after it returnsOk(())the config must survive a reboot.Self::resetmust not return.Self::ota_writermay be called multiple times; each call yields a fresh writer suitable for a single OTA session.Self::activate_uartsignals the platform’s buffered UART task (if any) that it is OK to start streaming. Idempotent.
Required Associated Types§
Sourcetype OtaWriter: OtaActions + 'static
type OtaWriter: OtaActions + 'static
OTA writer type this platform provides. Must live for the whole
SFTP session, so 'static is required.
Sourcetype Can: BufferedCan + 'static
type Can: BufferedCan + 'static
Buffered CAN type this platform provides. The CAN pump task owns
it for the lifetime of the device, so 'static is required.
Required Methods§
Sourcefn can(&self) -> &'static Self::Can
fn can(&self) -> &'static Self::Can
Access the platform’s buffered CAN interface for the SSH can
subsystem bridge.
Sourcefn save_config(
&self,
config: &SSHStampConfig,
) -> impl Future<Output = Result<(), HalError>>
fn save_config( &self, config: &SSHStampConfig, ) -> impl Future<Output = Result<(), HalError>>
Persist the full config to non-volatile storage.
§Errors
Returns HalError::Flash on write / erase failure.
Sourcefn ota_writer(&self) -> Self::OtaWriter
fn ota_writer(&self) -> Self::OtaWriter
Construct a fresh OTA writer for a new SFTP OTA session.
Sourcefn activate_uart(&self)
fn activate_uart(&self)
Signal the platform’s buffered UART task that SSH is ready and UART transfer may start. Idempotent.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".