Crates.io | sep2_client |
lib.rs | sep2_client |
version | 0.1.0 |
source | src |
created_at | 2024-03-19 11:04:54.178192 |
updated_at | 2024-03-19 11:04:54.178192 |
description | A Rust library for building IEEE 2030.5 Clients |
homepage | |
repository | https://github.com/ethanndickson/sep2_client |
max_upload_size | |
id | 1179142 |
size | 227,089 |
sep2_client
is a (WIP) Rust library for developing IEEE 2030.5 compliant clients on Linux1 based operating systems.
It relies on, and should be used alongside, the sep2_common
crate, and it's implementation of the IEEE 2030.5 XSD.
This crate uses async rust, and currently only supports the tokio
runtime.
sep2_client
- Implementation of an IEEE 2030.5 Client Library, including documentation & examples
sep2_test_server
- Dumb IEEE 2030.5 Server for testing
docs
- Thesis Project Reports & Seminars
A client that synchronises it's time with the server:
use sep2_client::{client::Client, time::update_time_offset};
use sep2_common::packages::{dcap::DeviceCapability, time::Time};
#[tokio::main]
async fn main() {
// Create a HTTPS client for a specific server
let client = Client::new_https(
"https://127.0.0.1:1337",
"client_cert.pem",
"client_private_key.pem",
"serca.pem",
// No KeepAlive
None,
// Default Poll Tick Rate (10 minutes)
None,
)
.expect("Couldn't create client");
let dcap = client
.get::<DeviceCapability>("/dcap")
.await
.expect("Couldn't retrieve dcap");
let time_link = &dcap.time_link.unwrap();
let time = client.get::<Time>(&time_link.href).await.unwrap();
// Sync client time
update_time_offset(time);
}
More comprehensive examples can be found in the sep2_client/examples
directory.
Features can be enabled or disabled through your crate's Cargo.toml
[dependencies.sep2_client]
features = ["der","pubsub"]
default
: All mandatory IEEE 2030.5 Client function sets. Application Support, Security & Time.
event
: A Generic Event Schedule interface
der
: A Scheduler for DER Function Set Events
pricing
: A Scheduler for Pricing Function Set Events
messaging
: A Scheduler for Messaging Function Set Events
drlc
: A Scheduler for DRLC Function Set Events
pubsub
: A lightweight server for the Subscription / Notification function set.
csip_aus
: CSIP-AUS Extensions
all
: All of the above
Due to the security requirements of IEEE 2030.5, this library only supports TLS using OpenSSL.
To use this library you will require a local installation of OpenSSL with support for ECDHE-ECDSA-AES128-CCM8
.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
The library happens to performs as expected on macOS. If you would like to test the client locally on macOS, ensure openssl
does not refer to libressl
, as is the case by default. ↩