Revamp the way that ethernet devices are found

Also add RADStar2 Ethernet support
This commit is contained in:
Paul Hollinsky
2018-10-08 16:32:51 -04:00
parent 466d35c68b
commit 7d821b9745
13 changed files with 207 additions and 116 deletions
+2 -5
View File
@@ -139,11 +139,8 @@ bool Device::open() {
}
std::string currentSerial = getNeoDevice().serial;
if(currentSerial == SERIAL_FIND_ON_OPEN) {
strncpy(getWritableNeoDevice().serial, serial->deviceSerial.c_str(), sizeof(getNeoDevice().serial));
getWritableNeoDevice().serial[sizeof(getWritableNeoDevice().serial) - 1] = '\0';
} else if(currentSerial != serial->deviceSerial) {
std::cout << "NeoDevice has serial " << getNeoDevice().serial << " but device has serial " << serial->deviceSerial.c_str() << "!" << std::endl;
if(currentSerial != serial->deviceSerial) {
std::cout << "Found device had serial " << getNeoDevice().serial << " but connected device has serial " << serial->deviceSerial.c_str() << "!" << std::endl;
return false;
}