42 throw std::out_of_range(
43 "Address (" + std::to_string(
address) +
44 ") is outside of the allowed range (0 - 65535).");
58 void MAVAddress::construct_(
unsigned int system,
unsigned int component)
62 throw std::out_of_range(
63 "System ID (" + std::to_string(
system) +
64 ") is outside of the allowed range (0 - 255).");
69 throw std::out_of_range(
70 "Component ID (" + std::to_string(
component) +
71 ") is outside of the allowed range (0 - 255).");
114 throw std::invalid_argument(
"Invalid MAVLink address string.");
119 if (!(c ==
'.' || isdigit(c)))
121 throw std::invalid_argument(
"Invalid MAVLink address string.");
127 std::vector<unsigned int> octets;
128 std::istringstream ss(
address);
137 if (octets.size() != 2 || !ss.eof())
139 throw std::invalid_argument(
"Invalid MAVLink address string.");
142 construct_(octets[0], octets[1]);
163 return (address_ >> 8) & 0x00FF;
173 return address_ & 0x00FF;
unsigned int component() const
bool operator!=(const MAVAddress &lhs, const MAVAddress &rhs)
unsigned int system() const
bool operator>(const MAVAddress &lhs, const MAVAddress &rhs)
bool operator>=(const MAVAddress &lhs, const MAVAddress &rhs)
bool operator<=(const MAVAddress &lhs, const MAVAddress &rhs)
unsigned int address() const
MAVAddress(const MAVAddress &other)=default
bool operator==(const MAVAddress &lhs, const MAVAddress &rhs)
bool operator<(const MAVAddress &lhs, const MAVAddress &rhs)
std::ostream & operator<<(std::ostream &os, const MAVAddress &mavaddress)