Hello there!

As an exercise, I am trying to implement a WOL programme to use inside my local network. As per the specification of a magic packet:

The magic packet is a broadcast frame containing anywhere within its payload 6 bytes of all 255 (FF FF FF FF FF FF in hexadecimal), followed by sixteen repetitions of the target computer's 48-bit MAC address, for a total of 102 bytes.
Let's say I have a MAC address of AA:BB:CCD and I want to construct a data element to be sent to my network (broadcasted actually) so that my device with said MAC address can accept it.

If I go and write std::string mac = "AABBCCDD", I am giving the ASCII values of each character to mac, which will be translated (to bytes) 41 41 42 42 43 43 44 44. Would I need to use std::hex in a string stream to accomplice my goal?

What is the standard practice to create such a low level packet? Should I still use unsigned char arrays?

Thank you so much for your time!