Skip to content
Snippets Groups Projects
Commit 5d1d9b99 authored by Julia Starke's avatar Julia Starke
Browse files

serial connection support fixed by Stefan

parent 5c8dd362
No related branches found
No related tags found
No related merge requests found
......@@ -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();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment