| Crates.io | moto-hses-proto |
| lib.rs | moto-hses-proto |
| version | 0.0.2 |
| created_at | 2025-09-21 21:37:31.033312+00 |
| updated_at | 2025-09-21 23:53:41.358543+00 |
| description | Protocol definitions and serialization for Yaskawa High-Speed Ethernet Server (HSES) |
| homepage | https://github.com/masayuki-kono/moto-hses |
| repository | https://github.com/masayuki-kono/moto-hses |
| max_upload_size | |
| id | 1849224 |
| size | 135,942 |
Protocol definitions and serialization for Yaskawa High-Speed Ethernet Server (HSES).
This crate provides the core protocol definitions and serialization/deserialization functionality for communicating with Yaskawa robots using the HSES (High Speed Ethernet Server) protocol over UDP.
Add this to your Cargo.toml:
[dependencies]
moto-hses-proto = "0.0.2"
use moto_hses_proto::{HsesRequestMessage, HsesResponseMessage, Service, Division, ReadAlarmData, Alarm};
// Create a read alarm command
let read_alarm = ReadAlarmData::new();
// Create HSES request message
let request = HsesRequestMessage::new(
Service::Control,
read_alarm,
Division::Robot,
vec![], // No additional data needed for read commands
);
// Serialize to bytes
let request_bytes: Vec<u8> = request.try_into()?;
// Deserialize from bytes
let parsed_request = HsesRequestMessage::try_from(request_bytes.as_slice())?;
// Example: Create an alarm for testing
let alarm = Alarm::new(
1001, // alarm code
0, // data
0, // alarm type
"2024-01-01 12:00:00".to_string(), // time
"Test alarm".to_string() // name
);
This crate implements the HSES protocol as specified in the official Yaskawa documentation:
The crate provides comprehensive error handling through the HsesError type:
use moto_hses_proto::HsesError;
match result {
Ok(data) => println!("Success: {:?}", data),
Err(HsesError::InvalidMessage) => println!("Invalid message format"),
Err(HsesError::UnsupportedCommand) => println!("Command not supported"),
Err(e) => println!("Other error: {}", e),
}
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.
moto-hses-client - Async UDP client for HSES communicationmoto-hses-mock - Mock HSES server for testing