Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
rcdiscover::WOL Class Reference

Class for Magic Packet (Wake-on-Lan (WOL)) reset of device. More...

#include <wol.h>

Public Member Functions

void send () const
 Send Magic Packet without any data ("password"). More...
 
void send (const std::array< uint8_t, 4 > &password) const
 Send Magic Packet with data ("password"). More...
 
 WOL (std::array< uint8_t, 6 > hardware_addr, uint16_t port) noexcept
 Constructor. More...
 
 WOL (uint64_t hardware_addr, uint16_t port) noexcept
 Constructor. More...
 
 ~WOL ()=default
 

Private Types

typedef SocketLinux SocketType
 

Private Member Functions

std::vector< uint8_t > & appendMagicPacket (std::vector< uint8_t > &sendbuf, const std::array< uint8_t, 4 > *password) const
 Appends a magic packet to a data buffer. More...
 
void sendImpl (const std::array< uint8_t, 4 > *password) const
 sendImpl Actually send Magic packet with specified data. More...
 
template<uint8_t num>
std::array< uint8_t, num > toByteArray (uint64_t data) noexcept
 Converts a larger-than-byte data type to an array of bytes. More...
 

Private Attributes

const std::array< uint8_t, 6 > hardware_addr_
 
uint16_t port_
 

Detailed Description

Class for Magic Packet (Wake-on-Lan (WOL)) reset of device.

Definition at line 62 of file wol.h.

Member Typedef Documentation

◆ SocketType

Definition at line 68 of file wol.h.

Constructor & Destructor Documentation

◆ WOL() [1/2]

rcdiscover::WOL::WOL ( uint64_t  hardware_addr,
uint16_t  port 
)
noexcept

Constructor.

Parameters
hardware_addrMAC-address of device
portdestination UDP port

Definition at line 49 of file wol.cc.

◆ WOL() [2/2]

rcdiscover::WOL::WOL ( std::array< uint8_t, 6 >  hardware_addr,
uint16_t  port 
)
noexcept

Constructor.

Parameters
hardware_addrMAC-address of device
portdestination UDP port

Definition at line 54 of file wol.cc.

◆ ~WOL()

rcdiscover::WOL::~WOL ( )
default

Member Function Documentation

◆ appendMagicPacket()

std::vector< uint8_t > & rcdiscover::WOL::appendMagicPacket ( std::vector< uint8_t > &  sendbuf,
const std::array< uint8_t, 4 > *  password 
) const
private

Appends a magic packet to a data buffer.

Parameters
sendbufbuffer to which the magic packet is appended (is modified)
passwordMagic Packet password (null if no such password should be included
Returns
reference to input sendbuf

Definition at line 69 of file wol.cc.

◆ send() [1/2]

void rcdiscover::WOL::send ( ) const

Send Magic Packet without any data ("password").

Definition at line 59 of file wol.cc.

◆ send() [2/2]

void rcdiscover::WOL::send ( const std::array< uint8_t, 4 > &  password) const

Send Magic Packet with data ("password").

Parameters
passworddata to send

Definition at line 64 of file wol.cc.

◆ sendImpl()

void rcdiscover::WOL::sendImpl ( const std::array< uint8_t, 4 > *  password) const
private

sendImpl Actually send Magic packet with specified data.

Parameters
passworddata to send (null if non)

Definition at line 106 of file wol.cc.

◆ toByteArray()

template<uint8_t num>
std::array< uint8_t, num > rcdiscover::WOL::toByteArray ( uint64_t  data)
privatenoexcept

Converts a larger-than-byte data type to an array of bytes.

Definition at line 96 of file wol.cc.

Member Data Documentation

◆ hardware_addr_

const std::array<uint8_t, 6> rcdiscover::WOL::hardware_addr_
private

Definition at line 124 of file wol.h.

◆ port_

uint16_t rcdiscover::WOL::port_
private

Definition at line 125 of file wol.h.


The documentation for this class was generated from the following files:


rcdiscover
Author(s): Heiko Hirschmueller , Raphael Schaller
autogenerated on Thu Aug 1 2024 02:55:56