mavtables
0.2.1
MAVLink router and firewall.
|
#include <MAVAddress.hpp>
Public Member Functions | |
MAVAddress (const MAVAddress &other)=default | |
MAVAddress (MAVAddress &&other)=default | |
MAVAddress (unsigned int address) | |
MAVAddress (unsigned int system, unsigned int component) | |
MAVAddress (std::string address) | |
unsigned int | address () const |
unsigned int | system () const |
unsigned int | component () const |
MAVAddress & | operator= (const MAVAddress &other)=default |
MAVAddress & | operator= (MAVAddress &&other)=default |
Related Functions | |
(Note that these are not member functions.) | |
bool | operator== (const MAVAddress &lhs, const MAVAddress &rhs) |
bool | operator!= (const MAVAddress &lhs, const MAVAddress &rhs) |
bool | operator< (const MAVAddress &lhs, const MAVAddress &rhs) |
bool | operator> (const MAVAddress &lhs, const MAVAddress &rhs) |
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) |
A MAVLink address.
MAVLink addresses consist of a system and component and can be represented as two ocetets in the form:
Therefore, a system ID of 16 and a component ID of 8 can be represented as 16.8
.
0.0
is reserved as the broadcast address.
Definition at line 38 of file MAVAddress.hpp.
|
default |
Copy constructor.
other | MAVLink address to copy from. |
|
default |
Move constructor.
other | MAVLink address to move from. |
MAVAddress::MAVAddress | ( | unsigned int | address | ) |
Construct a MAVLink address from an address in numeric representation.
The numeric representation of a MAVLink address is two bytes, the MSB contains the system ID and the LSB contains the component ID.
address | Address (0 - 65535) with system ID encoded in MSB and component ID encoded in LSB. |
std::out_of_range | if the address is not between 0 and 65535. |
Definition at line 38 of file MAVAddress.cpp.
References address().
MAVAddress::MAVAddress | ( | unsigned int | system, |
unsigned int | component | ||
) |
Construct a MAVLink address from the system ID and component ID.
system | System ID (0 - 255). |
component | Component ID (0 - 255). |
std::out_of_range | if either the system ID or the component ID is out of range. |
Definition at line 87 of file MAVAddress.cpp.
References component(), and system().
MAVAddress::MAVAddress | ( | std::string | address | ) |
Construct MAVLink address from a string.
Parse a string of the form "<System ID>.<Component ID>".
Some examples are:
address | String representing the MAVLink address. |
std::invalid_argument | if the address string does not represent a valid MAVLink address. |
std::out_of_range | if either the system ID or the component ID is out of range. |
Definition at line 108 of file MAVAddress.cpp.
References address().
unsigned int MAVAddress::address | ( | ) | const |
Return the MAVLink address in numeric form.
Definition at line 151 of file MAVAddress.cpp.
unsigned int MAVAddress::component | ( | ) | const |
Return the Component ID.
Definition at line 171 of file MAVAddress.cpp.
|
default |
Assignment operator.
other | MAVLink address to copy from. |
|
default |
Assignment operator (by move semantics).
other | MAVLink address to move from. |
unsigned int MAVAddress::system | ( | ) | const |
Return the System ID.
Definition at line 161 of file MAVAddress.cpp.
|
related |
Inequality comparison.
lhs | The left hand side MAVLink address. |
rhs | The right hand side MAVLink address. |
true | if lhs and rhs do not have the same system and component ID's |
false | if lhs and rhs have the same system and component ID's. |
Definition at line 201 of file MAVAddress.cpp.
References address().
|
related |
Less than comparison.
lhs | The left hand side MAVLink address. |
rhs | The right hand side MAVLink address. |
true | if lhs is less than rhs . |
false | if lhs is not less than rhs . |
Definition at line 217 of file MAVAddress.cpp.
References address().
|
related |
Print the MAVLink address to the given output stream.
The format is "<System ID>.<Component ID>".
Some examples are:
0.0
16.8
128.4
os | The output stream to print to. |
mavaddress | The MAVLink address to print. |
Definition at line 292 of file MAVAddress.cpp.
References component(), and system().
|
related |
Less than or equal comparison.
lhs | The left hand side IP address. |
rhs | The right hand side IP address. |
true | if lhs is less than or eqaul to rhs . |
false | if lhs is greater than rhs . |
Definition at line 249 of file MAVAddress.cpp.
References address().
|
related |
Equality comparison.
lhs | The left hand side MAVLink address. |
rhs | The right hand side MAVLink address. |
true | if lhs and rhs have the same system and component ID's. |
false | if lhs and rhs do not have the same system and component ID's. |
Definition at line 186 of file MAVAddress.cpp.
References address().
|
related |
Greater than comparison.
lhs | The left hand side MAVLink address. |
rhs | The right hand side IP address. |
true | if lhs is greater than rhs . |
false | if lhs is not greater than rhs . |
Definition at line 233 of file MAVAddress.cpp.
References address().
|
related |
Greater than comparison.
lhs | The left hand side IP address. |
rhs | The right hand side IP address. |
true | if lhs is greater than or equal to rhs . |
false | if lhs is less than rhs . |
Definition at line 265 of file MAVAddress.cpp.
References address().