use crate::nrc::NrcError;
pub trait ServerHandler {
type Error: NrcError;
fn read_did(&self, did: u16, buf: &mut [u8]) -> Result<usize, Self::Error>;
fn write_did(&mut self, did: u16, data: &[u8]) -> Result<(), Self::Error>;
fn ecu_reset(&mut self, reset_type: u8) -> Result<(), Self::Error>;
fn routine_control(
&mut self,
_routine_id: u16,
_sub_function: u8,
_data: &[u8],
_buf: &mut [u8],
) -> Result<usize, Self::Error> {
Err(Self::Error::service_not_supported())
}
fn communication_control(
&mut self,
_control_type: u8,
_comm_type: u8,
) -> Result<usize, Self::Error> {
Err(Self::Error::service_not_supported())
}
fn request_download(
&mut self,
_memory_address: &[u8],
_memory_size: &[u8],
_compression_method: u8,
_encrypting_method: u8,
_buf: &mut [u8],
) -> Result<usize, Self::Error> {
Err(Self::Error::service_not_supported())
}
fn io_control(
&mut self,
_did: u16,
_parameter: u8,
_control_state: &[u8],
_buf: &mut [u8],
) -> Result<usize, Self::Error> {
Err(Self::Error::service_not_supported())
}
fn transfer_data(
&mut self,
_block_sequence_counter: u8,
_data: &[u8],
_buf: &mut [u8],
) -> Result<usize, Self::Error> {
Err(Self::Error::service_not_supported())
}
fn request_transfer_exit(
&mut self,
_parameter_record: &[u8],
_buf: &mut [u8],
) -> Result<usize, Self::Error> {
Err(Self::Error::service_not_supported())
}
fn request_file_transfer(
&mut self,
_operation: u8,
_path: &[u8],
_buf: &mut [u8],
) -> Result<usize, Self::Error> {
Err(Self::Error::service_not_supported())
}
}