From 3428a637ce420baef9aa9f9803e71bd587867005 Mon Sep 17 00:00:00 2001 From: FxQnLr Date: Wed, 10 Apr 2024 00:16:55 +0200 Subject: Closes #24. Changed postgres to json directory storage --- src/wol.rs | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'src/wol.rs') diff --git a/src/wol.rs b/src/wol.rs index 31cf350..6392366 100644 --- a/src/wol.rs +++ b/src/wol.rs @@ -2,26 +2,6 @@ use std::net::{ToSocketAddrs, UdpSocket}; use crate::error::Error; -/// Creates the magic packet from a mac address -/// -/// # Panics -/// -/// Panics if `mac_addr` is an invalid mac -pub fn create_buffer(mac_addr: &str) -> Result, Error> { - let mut mac = Vec::new(); - let sp = mac_addr.split(':'); - for f in sp { - mac.push(u8::from_str_radix(f, 16)?); - } - let mut buf = vec![255; 6]; - for _ in 0..16 { - for i in &mac { - buf.push(*i); - } - } - Ok(buf) -} - /// Sends a buffer on UDP broadcast pub fn send_packet( bind_addr: A, -- cgit v1.2.3