add test setup

This commit is contained in:
Robert 2023-07-02 18:24:59 +02:00
parent 89fcef5619
commit ddf35406c3
3 changed files with 19 additions and 3 deletions

View file

@ -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",