core/ldn_types: Minor corrections and additions
This commit is contained in:
parent
63b236d853
commit
6791301d9a
@ -113,7 +113,7 @@ enum class LinkLevel : s8 {
|
|||||||
Bad,
|
Bad,
|
||||||
Low,
|
Low,
|
||||||
Good,
|
Good,
|
||||||
Excelent,
|
Excellent,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct NodeLatestUpdate {
|
struct NodeLatestUpdate {
|
||||||
@ -148,9 +148,24 @@ struct Ssid {
|
|||||||
u8 length;
|
u8 length;
|
||||||
std::array<char, SsidLengthMax + 1> raw;
|
std::array<char, SsidLengthMax + 1> raw;
|
||||||
|
|
||||||
|
Ssid() {
|
||||||
|
length = 0;
|
||||||
|
std::memset(raw.data(), 0, raw.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
Ssid(std::string data) {
|
||||||
|
length = static_cast<u8>(std::min(data.size(), SsidLengthMax));
|
||||||
|
std::memcpy(raw.data(), data.data(), length);
|
||||||
|
raw[length] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
std::string GetStringValue() const {
|
std::string GetStringValue() const {
|
||||||
return std::string(raw.data(), length);
|
return std::string(raw.data(), length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool operator==(const Ssid& b) const {
|
||||||
|
return (length == b.length) && (std::memcmp(raw.data(), b.raw.data(), length) == 0);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
static_assert(sizeof(Ssid) == 0x22, "Ssid is an invalid size");
|
static_assert(sizeof(Ssid) == 0x22, "Ssid is an invalid size");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user