OkoLib
library for accessing Okolab devices
|
Typedefs | |
typedef enum _oko_module_type | oko_module_type |
Specifies the available modules types. | |
Enumerations | |
enum | _oko_module_type { OKO_MODULE_TEMP = 0 , OKO_MODULE_CO2 = 1 , OKO_MODULE_O2 = 2 , OKO_MODULE_HMD = 3 , OKO_MODULE_MAXNUM } |
Specifies the available modules types. More... | |
Functions | |
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. More... | |
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. More... | |
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 application runtime. More... | |
oko_res_type | oko_ModuleGetCurrentValue (oko_module_type module, double *current_value) |
Returns current value of the specified module. More... | |
oko_res_type | oko_ModuleGetSetpointValue (oko_module_type module, double *setpoint_value) |
Returns setpoint value of the specified module of this device. More... | |
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. More... | |
oko_res_type | oko_ModuleSetSetpointValue (oko_module_type module, double setpoint_value) |
Set setpoint of the specified module of this device. More... | |
oko_res_type | oko_ModuleGetEnabled (oko_module_type module, bool *enabled) |
Returns enable status of the specified module of this device. More... | |
oko_res_type | oko_ModuleSetEnabled (oko_module_type module, bool enabled) |
Set enable status of the specified module of this device. More... | |
enum _oko_module_type |
oko_res_type oko_ModuleGetCurrentValue | ( | oko_module_type | module, |
double * | current_value | ||
) |
Returns current value of the specified module.
[in] | module | a valid module specifier (oko_module_type) |
[out] | current_value | Actual/current value |
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 application runtime.
[in] | module | valid module type |
[out] | name | name of the module. String needs to be pre-allocated by the caller. |
[out] | dim_unit | dimension unit of the module. String needs to be pre-allocated by the caller. |
[out] | can_disable | returns, if this module can be disabled or if it is always enabled. '1' for module can be disabled and '0' for module is always enabled. |
oko_res_type oko_ModuleGetEnabled | ( | oko_module_type | module, |
bool * | enabled | ||
) |
Returns enable status of the specified module of this device.
[in] | module | a valid module specifier (oko_module_type) |
[out] | enabled | enabled status (true/false) |
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.
[in] | module | a valid module specifier (oko_module_type) |
[out] | min_value | minimum value that can be used as setpoint |
[out] | max_value | maximum value that can be used as setpoint |
oko_res_type oko_ModuleGetSetpointValue | ( | oko_module_type | module, |
double * | setpoint_value | ||
) |
Returns setpoint value of the specified module of this device.
[in] | module | a valid module specifier (oko_module_type) |
[out] | setpoint_value | setpoint value |
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.
[in] | max_num | The max number of devices to detect. |
[out] | modules | Array of the detected module types. |
[out] | detected_num | number of detected modules. It is the length of modules array. |
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.
Keep only modules of interest according to specified module types.
[in] | selected_modules | array of module types to select |
[in] | selected_modules_num | length of selected_modules array |
[out] | modules | Array of module types. |
[out] | detected_num | number of detected modules. It is the length of modules array. |
oko_res_type oko_ModuleSetEnabled | ( | oko_module_type | module, |
bool | enabled | ||
) |
Set enable status of the specified module of this device.
[in] | module | a valid module specifier (oko_module_type) |
[in] | enabled | new enable status for this module (true/false) |
oko_res_type oko_ModuleSetSetpointValue | ( | oko_module_type | module, |
double | setpoint_value | ||
) |
Set setpoint of the specified module of this device.
[in] | module | a valid module specifier (oko_module_type) |
[in] | setpoint_value | new setpoint for this module, has to be between minimum and maximum of this module. |