Don't reuse the device object we use to get the serial
parent
840fe54bcd
commit
126c8efd2a
|
|
@ -22,12 +22,16 @@ public:
|
||||||
std::vector<std::shared_ptr<Device>> found;
|
std::vector<std::shared_ptr<Device>> found;
|
||||||
|
|
||||||
for(auto neodevice : PCAP::FindByProduct(PRODUCT_ID)) {
|
for(auto neodevice : PCAP::FindByProduct(PRODUCT_ID)) {
|
||||||
strncpy(neodevice.serial, SERIAL_FIND_ON_OPEN, sizeof(neodevice.serial));
|
{
|
||||||
neodevice.serial[sizeof(neodevice.serial) - 1] = '\0';
|
strncpy(neodevice.serial, SERIAL_FIND_ON_OPEN, sizeof(neodevice.serial));
|
||||||
auto device = std::make_shared<NeoVIFIRE2ETH>(neodevice);
|
neodevice.serial[sizeof(neodevice.serial) - 1] = '\0';
|
||||||
if(!device->open()) // We will get the serial number on open
|
auto device = std::make_shared<NeoVIFIRE2ETH>(neodevice);
|
||||||
continue; // If the open failed, we won't display the device as an option to connect to
|
if(!device->open()) // We will get the serial number on open
|
||||||
found.push_back(device);
|
continue; // If the open failed, we won't display the device as an option to connect to
|
||||||
|
strncpy(neodevice.serial, device->getNeoDevice().serial, sizeof(neodevice.serial));
|
||||||
|
neodevice.serial[sizeof(neodevice.serial) - 1] = '\0';
|
||||||
|
}
|
||||||
|
found.push_back(std::make_shared<NeoVIFIRE2ETH>(neodevice));
|
||||||
}
|
}
|
||||||
|
|
||||||
return found;
|
return found;
|
||||||
|
|
|
||||||
|
|
@ -28,12 +28,16 @@ public:
|
||||||
std::vector<std::shared_ptr<Device>> found;
|
std::vector<std::shared_ptr<Device>> found;
|
||||||
|
|
||||||
for(auto neodevice : PCAP::FindByProduct(PRODUCT_ID)) {
|
for(auto neodevice : PCAP::FindByProduct(PRODUCT_ID)) {
|
||||||
strncpy(neodevice.serial, SERIAL_FIND_ON_OPEN, sizeof(neodevice.serial));
|
{
|
||||||
neodevice.serial[sizeof(neodevice.serial) - 1] = '\0';
|
strncpy(neodevice.serial, SERIAL_FIND_ON_OPEN, sizeof(neodevice.serial));
|
||||||
auto device = std::make_shared<RADGalaxy>(neodevice);
|
neodevice.serial[sizeof(neodevice.serial) - 1] = '\0';
|
||||||
if(!device->open()) // We will get the serial number on open
|
auto device = std::make_shared<RADGalaxy>(neodevice);
|
||||||
continue; // If the open failed, we won't display the device as an option to connect to
|
if(!device->open()) // We will get the serial number on open
|
||||||
found.push_back(device);
|
continue; // If the open failed, we won't display the device as an option to connect to
|
||||||
|
strncpy(neodevice.serial, device->getNeoDevice().serial, sizeof(neodevice.serial));
|
||||||
|
neodevice.serial[sizeof(neodevice.serial) - 1] = '\0';
|
||||||
|
}
|
||||||
|
found.push_back(std::make_shared<RADGalaxy>(neodevice));
|
||||||
}
|
}
|
||||||
|
|
||||||
return found;
|
return found;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue