340 typedef __int8 int8_t;
341 typedef __int16 int16_t;
342 typedef __int32 int32_t;
343 typedef __int64 int64_t;
344 typedef unsigned __int8 uint8_t;
345 typedef unsigned __int16 uint16_t;
346 typedef unsigned __int32 uint32_t;
347 typedef unsigned __int64 uint64_t;
362 #if defined(OKO_NO_DLL)
364 #elif defined(OKO_BUILDING_DLL)
365 # define OKO_API __declspec (dllexport)
367 # define OKO_API __declspec (dllimport)
371 #define OKO_EXPORT __cdecl
376 #define OKO_EXPORT __stdcall
524 uint32_t selected_modules_num,
oko_module_type *modules, uint32_t *detected_num);
1192 oko_OkolabSetDebugPropertiesUsage(
bool debug_properties);
1195 oko_OkolabGetLastProtocolError(uint32_t deviceh,
const char *name,
int *err);
oko_res_type oko_CommandExecute(uint32_t deviceh, const char *name)
Execute a command.
oko_res_type oko_PropertyLoggingGetFileName(uint32_t deviceh, char *filename)
Get the file path used to log the specified device.
oko_res_type oko_StartPropertyLogging(uint32_t deviceh, const char *filename, uint32_t freq_ms)
Start the property logging feature for the specified device.
oko_res_type oko_StopPropertyLogging(uint32_t deviceh)
Stop the property logging feature for the specified device.
oko_res_type oko_PlaybakGetFileName(uint32_t deviceh, char *filename)
Get the file path used to playback the specified device.
oko_res_type oko_StartPlayback(uint32_t deviceh, const char *filename)
Start the playback feature for the specified device.
oko_res_type oko_StopPlayback(uint32_t deviceh)
Start the playback feature for the specified device.
oko_res_type oko_DeviceGetChecksumUsage(uint32_t deviceh, bool *use_checksum)
Get the checksum usage flag of the current device.
oko_res_type oko_DeviceGetPortName(uint32_t deviceh, char *port)
Get the Port Name of the specified device.
oko_res_type oko_DeviceGetChecksumAvailable(uint32_t deviceh, bool *checksum)
Check if the communication protocol of the specified device supports checksum.
oko_res_type oko_DeviceSetChecksumUsage(uint32_t deviceh, bool use_checksum)
Set the checksum usage flag of the current device.
oko_res_type oko_DeviceConnectionStatus(uint32_t deviceh, uint32_t *conn)
Get the connection status of the current device.
_oko_res_type
Specifies the return values.
Definition: okolib.h:394
enum _oko_res_type oko_res_type
Specifies the return values.
@ OKO_ERR_PORT_NOTVALID
Port not valid.
Definition: okolib.h:404
@ OKO_ERR_DEV_SLAVE
Slave device.
Definition: okolib.h:411
@ OKO_ERR_FAIL
A system error occurred while executing the operation.
Definition: okolib.h:398
@ OKO_ERR_DEV_NOTFOUND
Device not found.
Definition: okolib.h:407
@ OKO_ERR_MODULE_NOTFOUND
Module specified not found.
Definition: okolib.h:410
@ OKO_ERR_MEMORY
Memory allocation failed.
Definition: okolib.h:413
@ OKO_ERR_PROP_NOTFOUND
Property not found.
Definition: okolib.h:406
@ OKO_ERR_CLOSED
The specified device is not opened.
Definition: okolib.h:400
@ OKO_ERR_NOTSUPP
The requested operation is not supported by this system or device.
Definition: okolib.h:399
@ OKO_ERR_COMM
Communication error.
Definition: okolib.h:408
@ OKO_ERR_ENUM_NOTFOUND
Enum of the Property not found.
Definition: okolib.h:409
@ OKO_ERR_TIMEOUT
Timeout error.
Definition: okolib.h:414
@ OKO_ERR_DB_OPEN
Database error on open.
Definition: okolib.h:405
@ OKO_ERR_ARG
Invalid arguments were passed to the function.
Definition: okolib.h:397
@ OKO_ERR_UNCONN
The specified device is not connected.
Definition: okolib.h:401
@ OKO_OK
Operation completed successfully.
Definition: okolib.h:395
@ OKO_ERR_UNDEF
Undefined error.
Definition: okolib.h:415
@ OKO_ERR_UNINIT
Library not initialized yet.
Definition: okolib.h:396
@ OKO_ERR_PORT_BUSY
Serial port busy.
Definition: okolib.h:402
@ OKO_ERR_PORT_CFG
Port configuration failed.
Definition: okolib.h:403
@ OKO_ERR_DEV_NOTRUNNING
Device not running.
Definition: okolib.h:412
oko_res_type oko_LibGetLastError(char *errmsg, unsigned int maxsize)
Return a text message that describes the error for the most recent failed call on general library fun...
oko_res_type oko_LibGetSuggestedUSBOnly(bool *use)
Get the usage status of the USB serial ports filter.
oko_res_type oko_LibSetSuggestedUSBOnly(bool use)
Turn on/off the filter on the USB serial ports.
oko_res_type oko_LibGetVersion(char *version)
Print the version of Okolib library on a string passed by reference.
oko_res_type oko_LibShutDown()
Deallocates any resource that were allocated by oko_LibInitialize.
oko_res_type oko_LibInit(const char *db_path)
Initialize the library.
oko_res_type oko_ModuleGetCurrentValue(oko_module_type module, double *current_value)
Returns current value of the specified module.
oko_res_type oko_ModulesDetect(uint32_t max_num, oko_module_type *modules, uint32_t *detected_num)
Detect available modules and open them, returning the type for each module.
oko_res_type oko_ModuleGetDetails(oko_module_type module, char *name, char *dim_unit, bool *can_disable)
Returns all information related to the specified module of this device, which is not changing during ...
oko_res_type oko_ModuleGetLimits(oko_module_type module, double *min_value, double *max_value)
Returns setpoint limits of the specified module of this device.
oko_res_type oko_ModuleGetSetpointValue(oko_module_type module, double *setpoint_value)
Returns setpoint value of the specified module of this device.
oko_res_type oko_ModuleSetSetpointValue(oko_module_type module, double setpoint_value)
Set setpoint of the specified module of this device.
oko_res_type oko_ModulesDetectSelected(const oko_module_type *selected_modules, uint32_t selected_modules_num, oko_module_type *modules, uint32_t *detected_num)
Detect available modules and open them, returning the type for each module.
oko_res_type oko_ModuleSetEnabled(oko_module_type module, bool enabled)
Set enable status of the specified module of this device.
_oko_module_type
Specifies the available modules types.
Definition: okolib.h:494
enum _oko_module_type oko_module_type
Specifies the available modules types.
oko_res_type oko_ModuleGetEnabled(oko_module_type module, bool *enabled)
Returns enable status of the specified module of this device.
@ OKO_MODULE_HMD
Humidity module.
Definition: okolib.h:498
@ OKO_MODULE_MAXNUM
Number of available modules.
Definition: okolib.h:499
@ OKO_MODULE_TEMP
Temperature module.
Definition: okolib.h:495
@ OKO_MODULE_CO2
CO2 module.
Definition: okolib.h:496
@ OKO_MODULE_O2
O2 module.
Definition: okolib.h:497
oko_res_type oko_LibGetPortNames(char **names)
Refresh available ports and return their names.
oko_res_type oko_DevicesDetect(uint32_t max_num, uint32_t *devicesh, uint32_t *detected_num)
Detect available devices and open them, returning an handle for each device.
oko_res_type oko_DevicesCloseAll(void)
Close all the opened devices.
oko_res_type oko_DeviceClose(uint32_t deviceh)
Close the specified device.
oko_res_type oko_LibGetNumberOfPorts(uint32_t *count)
Refresh available ports and return the number of them.
oko_res_type oko_DeviceDetectSingleByName(uint32_t *deviceh, char *name_filter)
Detect the first available device matching the filter name and open it, returning a handle for it.
oko_res_type oko_LibGetPortName(uint32_t portidx, char *portname)
Get the name of the specified port, using the ports refreshed by oko_LibGetNumberOfPorts.
oko_res_type oko_DeviceDetectSingle(uint32_t *deviceh)
Detect the first available device and open it, returning a handle for it.
oko_res_type oko_DevicesDetectByName(uint32_t max_num, uint32_t *devicesh, char *name_filter, uint32_t *detected_num)
Detect the first available device matching the filter name and open it, returning a handle for it.
oko_res_type oko_DeviceOpen(const char *port, uint32_t *deviceh)
Open the specified device, returning a handle for it.
oko_res_type oko_DeviceGetLastError(uint32_t deviceh, char *errmsg, unsigned int maxsize)
Return a text message that describes the error for the most recent failed call on a specified device.
oko_res_type oko_PropertyAutoUpdate(uint32_t deviceh, const char *name, uint32_t freq_ms)
Set the update frequency to read the specified property value from the current device.
oko_res_type oko_PropertyGetName(uint32_t deviceh, uint32_t index, char *name)
Get the name of the specified property, using its index.
_oko_write_type
Specifies the available write types.
Definition: okolib.h:890
oko_res_type oko_PropertyGetWriteOnly(uint32_t deviceh, const char *name, bool *write_only)
Verify if the specified property is write-only.
_oko_prop_type
Specifies the available property types.
Definition: okolib.h:806
oko_res_type oko_PropertyGetDescription(uint32_t deviceh, const char *name, char *desc)
Get the description of the specified property.
enum _oko_prop_type oko_prop_type
Specifies the available property types.
oko_res_type oko_PropertyHasLimits(uint32_t deviceh, const char *name, bool *has_limits)
Verify if the specified property has readable limits.
oko_res_type oko_PropertiesGetNumber(uint32_t deviceh, uint32_t *num)
Get the number of available properties of the current device.
oko_res_type oko_PropertyGetType(uint32_t deviceh, const char *name, oko_prop_type *prop_type)
Get the type of the specified property.
oko_res_type oko_PropertyGetUnit(uint32_t deviceh, const char *name, char *unit)
Get the measure unit of the specified property.
oko_res_type oko_PropertyGetWriteType(uint32_t deviceh, const char *name, oko_write_type *write_type)
Get the write type of the specified property.
oko_res_type oko_PropertyIsAdvanced(uint32_t deviceh, const char *name, bool *is_adv)
Verify if the specified property is an advanced feature of the device.
oko_res_type oko_PropertyGetEnumName(uint32_t deviceh, const char *name, uint32_t enum_val, char *enum_name)
Get the name of a given enum value of the specified property.
oko_res_type oko_PropertyGetLimits(uint32_t deviceh, const char *name, double *min, double *max)
Get the minimum and maximum value that can be set for the specified property.
oko_res_type oko_PropertyGetEnumNumber(uint32_t deviceh, const char *name, unsigned int *num)
Get the number of available enum values of the specified property.
oko_res_type oko_PropertyIsMain(uint32_t deviceh, const char *name, bool *is_main)
Verify if the specified property is a main feature of the device.
enum _oko_write_type oko_write_type
Specifies the available write types.
oko_res_type oko_PropertyGetReadOnly(uint32_t deviceh, const char *name, bool *read_only)
Verify if the specified property is read-only.
@ OKO_WRITE_NONE
No write available (read-only)
Definition: okolib.h:891
@ OKO_WRITE_EEPROM
Only standard write is available.
Definition: okolib.h:892
@ OKO_WRITE_BOTH
Standard and volatile write types are available.
Definition: okolib.h:894
@ OKO_WRITE_VOLATILE
Only volatile write is available.
Definition: okolib.h:893
@ OKO_PROP_INT
Integer (long) property type.
Definition: okolib.h:809
@ OKO_PROP_ENUM
Enum property type.
Definition: okolib.h:811
@ OKO_PROP_DOUBLE
Double property type.
Definition: okolib.h:810
@ OKO_PROP_UNDEF
Undefined property type.
Definition: okolib.h:807
@ OKO_PROP_STRING
String property type.
Definition: okolib.h:808
oko_res_type oko_PropertyReadString(uint32_t deviceh, const char *name, char *val)
Get the current value of a string property.
oko_res_type oko_PropertyUpdate(uint32_t deviceh, const char *name)
Update the specified property value, reading it from the current device.
oko_res_type oko_PropertyReadDouble(uint32_t deviceh, const char *name, double *val)
Get the current value of a double property.
oko_res_type oko_PropertyReadInt(uint32_t deviceh, const char *name, int32_t *val)
Get the current value of a integer property.
oko_res_type oko_PropertyWriteDouble(uint32_t deviceh, const char *name, double val, char async)
Change the current value of the specified double property.
oko_res_type oko_PropertyWriteVolatileDouble(uint32_t deviceh, const char *name, double val, char async)
Change the current value of the specified double property in the volatile memory.
oko_res_type oko_PropertyWriteInt(uint32_t deviceh, const char *name, int32_t val, char async)
Change the current value of the specified integer property.
oko_res_type oko_PropertyWriteVolatileInt(uint32_t deviceh, const char *name, int32_t val, char async)
Change the current value of the specified integer property in the volatile memory.
oko_res_type oko_PropertyWriteVolatileString(uint32_t deviceh, const char *name, const char *val, bool async)
Change the current value of the specified string property in the volatile memory.
oko_res_type oko_PropertyWriteString(uint32_t deviceh, const char *name, const char *val, bool async)
Change the current value of the specified string property.