mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
C API: Digital IO function use stdbool.h
This requirement is already in place and makes the API more consistent
This commit is contained in:
@@ -621,7 +621,7 @@ bool icsneo_getTimestampResolution(const neodevice_t* device, uint16_t* resoluti
|
||||
return true;
|
||||
}
|
||||
|
||||
bool icsneo_getDigitalIO(const neodevice_t* device, neoio_t type, uint32_t number, uint8_t* value) {
|
||||
bool icsneo_getDigitalIO(const neodevice_t* device, neoio_t type, uint32_t number, bool* value) {
|
||||
if(!icsneo_isValidNeoDevice(device))
|
||||
return false;
|
||||
|
||||
@@ -634,13 +634,13 @@ bool icsneo_getDigitalIO(const neodevice_t* device, neoio_t type, uint32_t numbe
|
||||
if(!val.has_value())
|
||||
return false;
|
||||
|
||||
*value = uint8_t(*val);
|
||||
*value = *val;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool icsneo_setDigitalIO(const neodevice_t* device, neoio_t type, uint32_t number, uint8_t value) {
|
||||
bool icsneo_setDigitalIO(const neodevice_t* device, neoio_t type, uint32_t number, bool value) {
|
||||
if(!icsneo_isValidNeoDevice(device))
|
||||
return false;
|
||||
|
||||
return device->device->setDigitalIO(static_cast<icsneo::IO>(type), number, bool(value));
|
||||
return device->device->setDigitalIO(static_cast<icsneo::IO>(type), number, value);
|
||||
}
|
||||
|
||||
@@ -497,7 +497,7 @@ int icsneoEnableDOIPLine(void* hObject, bool enable) {
|
||||
if(!icsneoValidateHObject(hObject))
|
||||
return false;
|
||||
neodevice_t* device = (neodevice_t*)hObject;
|
||||
return icsneo_setDigitalIO(device, ICSNEO_IO_ETH_ACTIVATION, 1, uint8_t(enable));
|
||||
return icsneo_setDigitalIO(device, ICSNEO_IO_ETH_ACTIVATION, 1, enable);
|
||||
}
|
||||
|
||||
int icsneoStartSockServer(void* hObject, int iPort) {
|
||||
|
||||
Reference in New Issue
Block a user