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 (uint64_t hardware_addr, uint16_t port) noexcept
 Constructor. More...
 
 WOL (std::array< uint8_t, 6 > 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

Definition at line 68 of file wol.h.

Constructor & Destructor Documentation

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.

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.

rcdiscover::WOL::~WOL ( )
default

Member Function Documentation

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.

void rcdiscover::WOL::send ( ) const

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

Definition at line 59 of file wol.cc.

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.

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.

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

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

Definition at line 124 of file wol.h.

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 Sun Apr 18 2021 02:16:32