mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Drivers: Decouple from devices
This allows us to better implement alternative drivers for devices, such as for device sharing servers or talking to CoreMini processors within the same device.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
#include "icsneo/device/neodevice.h"
|
||||
#include "icsneo/device/founddevice.h"
|
||||
#include <cstring>
|
||||
|
||||
neodevice_t::neodevice_t() : device(nullptr), handle(0), type(0) {
|
||||
memset(serial, 0, sizeof(serial));
|
||||
}
|
||||
|
||||
neodevice_t::neodevice_t(const icsneo::FoundDevice& found, devicetype_t inType)
|
||||
: device(nullptr), handle(found.handle), type(inType) {
|
||||
static_assert(sizeof(found.serial) == sizeof(serial), "Serial sizes should match!");
|
||||
memcpy(serial, found.serial, sizeof(serial));
|
||||
}
|
||||
Reference in New Issue
Block a user