mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Device: Add isOnlineSupported()
This commit is contained in:
committed by
Kyle Johannes
parent
3264a1ecbe
commit
4782e26bed
@@ -740,4 +740,11 @@ int icsneo_getDeviceStatus(const neodevice_t* device, void* status, size_t* size
|
||||
*size = rawMessage->data.size();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool icsneo_isOnlineSupported(const neodevice_t* device) {
|
||||
if(!icsneo_isValidNeoDevice(device))
|
||||
return false;
|
||||
|
||||
return device->device->isOnlineSupported();
|
||||
}
|
||||
|
||||
@@ -417,8 +417,19 @@ int LegacyDLLExport icsneoOpenNeoDevice(NeoDevice* pNeoDevice, void** hObject, u
|
||||
*hObject = device;
|
||||
if (!icsneo_openDevice(device))
|
||||
return false;
|
||||
|
||||
return icsneo_setPollingMessageLimit(device, 20000) && icsneo_enableMessagePolling(device) && icsneo_goOnline(device);
|
||||
|
||||
if (icsneo_isOnlineSupported(device)) {
|
||||
if (!icsneo_setPollingMessageLimit(device, 20000))
|
||||
return false;
|
||||
|
||||
if (!icsneo_enableMessagePolling(device))
|
||||
return false;
|
||||
|
||||
if (!icsneo_goOnline(device))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int LegacyDLLExport icsneoOpenDevice(
|
||||
@@ -447,7 +458,18 @@ int LegacyDLLExport icsneoOpenDevice(
|
||||
if(!icsneo_openDevice(device))
|
||||
return false;
|
||||
|
||||
return icsneo_setPollingMessageLimit(device, 20000) && icsneo_enableMessagePolling(device) && icsneo_goOnline(device);
|
||||
if (icsneo_isOnlineSupported(device)) {
|
||||
if (!icsneo_setPollingMessageLimit(device, 20000))
|
||||
return false;
|
||||
|
||||
if (!icsneo_enableMessagePolling(device))
|
||||
return false;
|
||||
|
||||
if (!icsneo_goOnline(device))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int LegacyDLLExport icsneoClosePort(void* hObject, int* pNumberOfErrors)
|
||||
|
||||
Reference in New Issue
Block a user