diff --git a/source/RobotAPI/components/KITHandUnit/KITHandUnit.cpp b/source/RobotAPI/components/KITHandUnit/KITHandUnit.cpp index 0b048a2463e7c63c347645ab9280239d42bda5fa..b3cb24cfd9d4249aeecbd474f5c040ed488861cd 100644 --- a/source/RobotAPI/components/KITHandUnit/KITHandUnit.cpp +++ b/source/RobotAPI/components/KITHandUnit/KITHandUnit.cpp @@ -77,8 +77,19 @@ namespace armarx std::vector<HandDevice> devices = _driver->scanForDevices(mode); for (HandDevice& d : devices) { - ARMARX_INFO << "Found device with MAC-Address: " << d.macAdress; - if (d.macAdress == macAddress) + if (mode == KITHandCommunicationDriver::ScanMode::Bluetooth) + { + ARMARX_INFO << "Found device with MAC-Address: " << d.macAdress; + } + else if (mode == KITHandCommunicationDriver::ScanMode::Serial) + { + ARMARX_INFO << "Found device at serial port: " << d.serialDeviceFile; + } + else + { + ARMARX_INFO << "Found hand"; //TODO + } + if (d.macAdress == macAddress || (mode == KITHandCommunicationDriver::ScanMode::Serial)) { d.hardwareTarget = mode == KITHandCommunicationDriver::ScanMode::Bluetooth ? KITHand::HardwareTarget::Bluetooth : KITHand::HardwareTarget::Serial; _driver->connect(d); @@ -101,7 +112,14 @@ namespace armarx && !found && std::chrono::duration_cast<std::chrono::seconds>(std::chrono::system_clock::now() - start).count() < getProperty<int>("ScanTimeout").getValue()); - ARMARX_WARNING << "Could not find hand with the given MAC-Address: " << macAddress << " Shutting down this KITHandUnit."; + if (mode == KITHandCommunicationDriver::ScanMode::Bluetooth) + { + ARMARX_WARNING << "Could not find hand with the given MAC-Address: " << macAddress << " Shutting down this KITHandUnit."; + } + else + { + ARMARX_WARNING << "Could not find hand ove serial ports. Shutting down this KITHHandUnit"; + } getArmarXManager()->asyncShutdown(); }