原始 MAC 地址 / Raw MAC address
More...
#include <net.hpp>
原始 MAC 地址 / Raw MAC address
Definition at line 64 of file net.hpp.
◆ FromString()
| static MACAddressRaw LibXR::MACAddressRaw::FromString |
( |
const char * | str | ) |
|
|
inlinestatic |
Definition at line 68 of file net.hpp.
69 {
70 MACAddressRaw mac{};
71 std::sscanf(str, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &mac.bytes[0], &mac.bytes[1],
72 &mac.bytes[2], &mac.bytes[3], &mac.bytes[4], &mac.bytes[5]);
73 return mac;
74 }
◆ operator!=()
| bool LibXR::MACAddressRaw::operator!= |
( |
const MACAddressRaw & | other | ) |
const |
|
inline |
Definition at line 87 of file net.hpp.
87{ return !(*this == other); }
◆ operator==()
| bool LibXR::MACAddressRaw::operator== |
( |
const MACAddressRaw & | other | ) |
const |
|
inline |
Definition at line 82 of file net.hpp.
83 {
85 }
static int FastCmp(const void *a, const void *b, size_t size)
快速内存比较 / Fast memory comparison
◆ ToString()
| void LibXR::MACAddressRaw::ToString |
( |
char | out[MACADDR_STRLEN] | ) |
const |
|
inline |
Definition at line 76 of file net.hpp.
77 {
78 std::snprintf(out, MACADDR_STRLEN, "%02X:%02X:%02X:%02X:%02X:%02X", bytes[0],
79 bytes[1], bytes[2], bytes[3], bytes[4], bytes[5]);
80 }
◆ bytes
| uint8_t LibXR::MACAddressRaw::bytes[6] {} |
The documentation for this struct was generated from the following file: