From ec6fc33d13b1aeea5d049bbac842521e4761cec7 Mon Sep 17 00:00:00 2001 From: fengyingcai Date: Wed, 15 Jun 2022 00:02:42 +0800 Subject: [PATCH] docs: update doc --- CHANGELOG.md | 12 +++++++++--- Cargo.toml | 2 +- README.md | 2 +- src/lib.rs | 13 +++++++++---- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bed002c..1bbbd40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,17 @@ -# v0.9.0 +# CHANGELOG + +## v0.9.1 + +1. Update docs + +## v0.9.0 1. Stable release -# v0.0.2 +## v0.0.2 1. Update docs -# v0.0.1 +## v0.0.1 1. First release diff --git a/Cargo.toml b/Cargo.toml index 474ec17..5d45a9b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wol-rs" -version = "0.9.0" +version = "0.9.1" edition = "2021" authors = ["fengyingcai "] description = "Wake-on-LAN utility" diff --git a/README.md b/README.md index 11a4b75..a1ad50c 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Add `wol-rs` to `Cargo.toml` [dependencies] wol-rs = "1" -Send a WoL magic packet +Send a WoL magic packet over UDP send_wol(, None, None).unwrap() diff --git a/src/lib.rs b/src/lib.rs index 73f29a3..99de0ab 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,9 +3,14 @@ use std::io; use std::net::{IpAddr, UdpSocket}; use std::str::FromStr; -pub const MAC_ADDR_SIZE: usize = 6; -pub const BIND_PORT: u16 = 0; -pub const WOL_PORT: u16 = 9; +/// Mac address size of bytes +const MAC_ADDR_SIZE: usize = 6; + +/// Bind port, 0 means assigned by os +const BIND_PORT: u16 = 0; + +/// WoL port could be 0/7/9, use 9 here +const WOL_PORT: u16 = 9; /// Mac address. /// @@ -58,7 +63,7 @@ impl FromStr for MacAddr { } } -/// Send a WoL magic packet. +/// Send a WoL magic packet over UDP. /// /// # Arguments ///