Skip to main content

Crate moto_hses_client

Crate moto_hses_client 

Source
Expand description

moto-hses-client - HSES (High Speed Ethernet Server) client implementation

This crate provides an async UDP client for communicating with Yaskawa robot controllers using the High-Speed Ethernet Server (HSES) protocol.

§Thread Safety

The crate provides two ways to use the client:

  • HsesClient: The basic client, suitable for single-task usage
  • SharedHsesClient: A thread-safe wrapper that can be shared across multiple tasks

Both implement the HsesClientOps trait, allowing generic code to work with either.

§Example

use moto_hses_client::{HsesClient, SharedHsesClient, HsesClientOps};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create a basic client
    let client = HsesClient::new("192.168.1.1:10040").await?;

    // Wrap it for thread-safe access
    let shared_client = SharedHsesClient::new(client);

    // Use from multiple tasks
    let client1 = shared_client.clone();
    let client2 = shared_client.clone();

    let handle1 = tokio::spawn(async move {
        client1.read_status().await
    });

    let handle2 = tokio::spawn(async move {
        client2.read_position(0).await
    });

    let (status, position) = tokio::try_join!(handle1, handle2)?;
    Ok(())
}

Re-exports§

pub use shared::SharedHsesClient;
pub use traits::HsesClientOps;
pub use types::ClientConfig;
pub use types::ClientError;
pub use types::HsesClient;

Modules§

connection
Connection management for HSES client
convenience
Convenience methods for HSES client
protocol
Protocol communication for HSES client
shared
Thread-safe wrapper for HSES client
traits
Trait definitions for HSES client operations
types
Type definitions for HSES client

Structs§

Alarm
Alarm data structure
ExecutingJobInfo
Executing job information data structure
Status

Enums§

Position
TextEncoding
Supported text encodings for HSES protocol

Traits§

HsesPayload
Trait for HSES protocol payload data types