49 WOL::WOL(uint64_t hardware_addr, uint16_t port) noexcept :
50 hardware_addr_(toByteArray<6>(std::move(hardware_addr))),
54 WOL::WOL(std::array<uint8_t, 6> hardware_addr, uint16_t port) noexcept :
55 hardware_addr_(std::move(hardware_addr)),
64 void WOL::send(
const std::array<uint8_t, 4>& password)
const
70 std::vector<uint8_t>& sendbuf,
71 const std::array<uint8_t, 4> *password)
const
73 for (
int i = 0; i < 6; ++i)
75 sendbuf.push_back(0xFF);
77 for (
int i = 0; i < 16; ++i)
84 if (password !=
nullptr)
86 for (
int i = 0; i < 4; ++i)
88 sendbuf.push_back((*password)[i]);
98 std::array<uint8_t, num> result;
99 for (uint8_t i = 0; i < num; ++i)
101 result[i] =
static_cast<uint8_t
>((data >> (((num - 1 - i)*8))) & 0xFF);
110 for (
auto &socket : sockets)
112 std::vector<uint8_t> sendbuf;
115 socket.enableBroadcast();
116 socket.enableNonBlocking();
120 socket.send(sendbuf);