pub struct AssociationHandle { /* private fields */ }Expand description
Handle used to make requests against a particular outstation associated with the master channel
Implementations§
Source§impl AssociationHandle
impl AssociationHandle
Sourcepub fn address(&self) -> EndpointAddress
pub fn address(&self) -> EndpointAddress
retrieve the outstation address of the association
Sourcepub async fn add_poll(
&mut self,
request: ReadRequest,
period: Duration,
) -> Result<PollHandle, PollError>
pub async fn add_poll( &mut self, request: ReadRequest, period: Duration, ) -> Result<PollHandle, PollError>
Add a poll to the association
requestdefines what data is being requestedperioddefines how often the READ operation is performed
Sourcepub async fn read(&mut self, request: ReadRequest) -> Result<(), TaskError>
pub async fn read(&mut self, request: ReadRequest) -> Result<(), TaskError>
Perform an asynchronous READ request
If successful, the ReadHandler will process the received measurement data
Sourcepub async fn send_and_expect_empty_response(
&mut self,
function: FunctionCode,
headers: Headers,
) -> Result<(), WriteError>
pub async fn send_and_expect_empty_response( &mut self, function: FunctionCode, headers: Headers, ) -> Result<(), WriteError>
Perform an asynchronous request with the specified function code and object headers
This is useful for constructing various types of WRITE and FREEZE operations where an empty response is expected from the outstation, and the only indication of success are bits in IIN.2
Sourcepub async fn read_with_handler(
&mut self,
request: ReadRequest,
handler: Box<dyn ReadHandler>,
) -> Result<(), TaskError>
pub async fn read_with_handler( &mut self, request: ReadRequest, handler: Box<dyn ReadHandler>, ) -> Result<(), TaskError>
Perform an asynchronous READ request with a custom read handler
If successful, the custom ReadHandler will process the received measurement data
Sourcepub async fn operate(
&mut self,
mode: CommandMode,
headers: CommandHeaders,
) -> Result<(), CommandError>
pub async fn operate( &mut self, mode: CommandMode, headers: CommandHeaders, ) -> Result<(), CommandError>
Perform an asynchronous operate request
The actual function code used depends on the value of the CommandMode.
Sourcepub async fn warm_restart(&mut self) -> Result<Duration, TaskError>
pub async fn warm_restart(&mut self) -> Result<Duration, TaskError>
Perform a WARM_RESTART operation
Returns the delay from the outstation’s response as a Duration
Sourcepub async fn cold_restart(&mut self) -> Result<Duration, TaskError>
pub async fn cold_restart(&mut self) -> Result<Duration, TaskError>
Perform a COLD_RESTART operation
Returns the delay from the outstation’s response as a Duration
Sourcepub async fn synchronize_time(
&mut self,
procedure: TimeSyncProcedure,
) -> Result<(), TimeSyncError>
pub async fn synchronize_time( &mut self, procedure: TimeSyncProcedure, ) -> Result<(), TimeSyncError>
Perform the specified time synchronization operation
Sourcepub async fn write_dead_bands(
&mut self,
headers: Vec<DeadBandHeader>,
) -> Result<(), WriteError>
pub async fn write_dead_bands( &mut self, headers: Vec<DeadBandHeader>, ) -> Result<(), WriteError>
Perform write one or more headers of analog input dead-bands to the outstation
Sourcepub async fn check_link_status(&mut self) -> Result<(), TaskError>
pub async fn check_link_status(&mut self) -> Result<(), TaskError>
Trigger the master to issue a REQUEST_LINK_STATUS function in advance of the link status timeout
This function is provided for testing purposes. Using the configured link status timeout is the preferred so that the master automatically issues these requests.
If a TaskError::UnexpectedResponseHeaders is returned, the link might be alive
but it didn’t answer with the expected LINK_STATUS.
Sourcepub async fn get_file_auth_key(
&mut self,
credentials: FileCredentials,
) -> Result<AuthKey, FileError>
pub async fn get_file_auth_key( &mut self, credentials: FileCredentials, ) -> Result<AuthKey, FileError>
Obtain an AuthKey from the outstation which may then be used to open the file.
Sourcepub async fn open_file<T: ToString>(
&mut self,
file_name: T,
auth_key: AuthKey,
permissions: Permissions,
file_size: u32,
file_mode: FileMode,
max_block_size: u16,
) -> Result<OpenFile, FileError>
pub async fn open_file<T: ToString>( &mut self, file_name: T, auth_key: AuthKey, permissions: Permissions, file_size: u32, file_mode: FileMode, max_block_size: u16, ) -> Result<OpenFile, FileError>
Open a file on the outstation with the requested parameters
Sourcepub async fn write_file_block(
&mut self,
handle: FileHandle,
block_number: BlockNumber,
block_data: Vec<u8>,
) -> Result<(), FileError>
pub async fn write_file_block( &mut self, handle: FileHandle, block_number: BlockNumber, block_data: Vec<u8>, ) -> Result<(), FileError>
Write a file block to the outstation
Sourcepub async fn close_file(&mut self, handle: FileHandle) -> Result<(), FileError>
pub async fn close_file(&mut self, handle: FileHandle) -> Result<(), FileError>
Close a file on the outstation
Sourcepub async fn read_file<T: ToString>(
&mut self,
remote_file_path: T,
config: FileReadConfig,
reader: Box<dyn FileReader>,
credentials: Option<FileCredentials>,
) -> Result<(), Shutdown>
pub async fn read_file<T: ToString>( &mut self, remote_file_path: T, config: FileReadConfig, reader: Box<dyn FileReader>, credentials: Option<FileCredentials>, ) -> Result<(), Shutdown>
Start an operation to READ a file from the outstation using a FileReader to receive data
Sourcepub async fn read_directory<T: ToString>(
&mut self,
dir_path: T,
config: DirReadConfig,
credentials: Option<FileCredentials>,
) -> Result<Vec<FileInfo>, FileError>
pub async fn read_directory<T: ToString>( &mut self, dir_path: T, config: DirReadConfig, credentials: Option<FileCredentials>, ) -> Result<Vec<FileInfo>, FileError>
Read a file directory
Trait Implementations§
Source§impl Clone for AssociationHandle
impl Clone for AssociationHandle
Source§fn clone(&self) -> AssociationHandle
fn clone(&self) -> AssociationHandle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more