mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 09:28:40 +02:00
The icsneolegacy API finds devices correctly now
This commit is contained in:
@@ -6,11 +6,12 @@
|
||||
|
||||
static NeoDevice OldNeoDeviceFromNew(const neodevice_t* newnd) {
|
||||
NeoDevice oldnd = { 0 };
|
||||
oldnd.DeviceType = newnd->type;
|
||||
oldnd.SerialNumber = icsneo_serialStringToNum(newnd->serial);
|
||||
oldnd.NumberOfClients = 0;
|
||||
oldnd.MaxAllowedClients = 1;
|
||||
static_assert(sizeof(neodevice_handle_t) <= sizeof(oldnd.Handle), "neodevice_handle_t size must be at least sizeof(int) for compatibility reasons");
|
||||
*(neodevice_handle_t*)(&oldnd.Handle) = newnd->handle;
|
||||
static_assert(sizeof(neodevice_handle_t) == sizeof(oldnd.Handle), "neodevice_handle_t size must be sizeof(int) for compatibility reasons");
|
||||
oldnd.Handle = newnd->handle;
|
||||
return oldnd;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user