add test setup
This commit is contained in:
parent
89fcef5619
commit
ddf35406c3
3 changed files with 19 additions and 3 deletions
|
@ -13,6 +13,7 @@ Device::Device(const std::string& macAddress) {
|
|||
Device::Device(uint8_t a, uint8_t b, uint8_t c, uint8_t d, uint8_t e, uint8_t f) :
|
||||
macAddress{a, b, c, d, e, f}
|
||||
{
|
||||
port = std::make_shared<Port>();
|
||||
}
|
||||
|
||||
void Device::parseAndSetMac(const std::string& mac) {
|
||||
|
@ -28,6 +29,11 @@ void Device::parseAndSetMac(const std::string& mac) {
|
|||
);
|
||||
}
|
||||
|
||||
void Device::Connect(std::shared_ptr<Device> other) {
|
||||
port->Connect(other->port);
|
||||
other->port->Connect(port);
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const Device& device) {
|
||||
printf(
|
||||
"%02X:%02X:%02X:%02X:%02X:%02X",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue