- Notifications
You must be signed in to change notification settings - Fork5
LesnyRumcajs/wakey
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Library for managingWake-on-LAN packets. It supports:
- creating magic packets,
- broadcasting them via UDP.
From string representation of MAC address and using defaults when broadcasting:
let wol = wakey::WolPacket::from_string(&mac_adress, sep)?;if wol.send_magic().is_ok(){println!("Sent the magic packet.");}else{println!("Failed to send the magic packet.");}
Packets can also be constructed with raw bytes and sent from / to custom addresses:
use std::net::SocketAddr;let wol = wakey::WolPacket::from_bytes(&[0x00,0x01,0x02,0x03,0x04,0x05])?;let src =SocketAddr::from(([0,0,0,0],0));let dst =SocketAddr::from(([255,255,255,255],9));wol.send_magic_to(src, dst)?;
cargo run --bin wakey-wake 00:11:22:33:44:55
About
Rust Wake-on-LAN library
Topics
Resources
License
Code of conduct
Stars
Watchers
Forks
Packages0
No packages published