| Crates.io | iec61850 |
| lib.rs | iec61850 |
| version | 0.1.0 |
| created_at | 2025-11-22 10:31:38.424011+00 |
| updated_at | 2025-11-22 10:31:38.424011+00 |
| description | A rust implementation of the IEC61850 protocol. |
| homepage | https://github.com/mzaniolo/iec61850 |
| repository | https://github.com/mzaniolo/iec61850 |
| max_upload_size | |
| id | 1945185 |
| size | 396,200 |
A pure rust implementation of the IEC61850 protocol.
This crate provides a client that implements the IEC61850 MMS part of the protocol. Goose and sv parts may come in the future. A server implementation may also come in the future. Basic tests where done using a test server but some error may still arise. Despite the client being already working this is still a work in progress and the interfaces may change.
A more complete example of how to use the client can be found on the examples folder.
use iec61850::{
ClientConfig, Iec61850Client,
mms::ReportCallback,
};
/// A test report callback that will print the report to the console.
struct TestReportCallback;
#[async_trait::async_trait]
impl ReportCallback for TestReportCallback {
async fn on_report(&self, report: Report) {
println!("Report: {:?}", report);
}
}
#[tokio::main]
async fn main() -> Result<(), dyn std::error::Error> {
// Connects to a server at localhost:102. Configurations like the serve ip and port can be changed using the ClientConfig
let client = Iec61850Client::new(ClientConfig::default(), Box::new(TestReportCallback)).await?;
let model = client.model();
println!("Ied model: {model:#?}");
let data = client
.read_data_from_ld("SampleIEDDevice1", &["DGEN1$ST$Mod", "DGEN1$MX$TotWh"])
.await?;
println!("Data: {data:#?}");
}
Contributions are welcome and encourage!
If a bug is found open and issue explaining the problem and, if possible, attach some package captures to help understanding the problem.
A set of pre-commits hooks are provided to help keep the code nice and tidy
pip install --user pre-commitpre-commit autoupdate to update the pre-commit config to use the newest templatepre-commit install to install the pre-commit hooks to your local environment