OkoLib
library for accessing Okolab devices
|
Typedefs | |
typedef enum _oko_prop_type | oko_prop_type |
Specifies the available property types. | |
typedef enum _oko_write_type | oko_write_type |
Specifies the available write types. | |
Enumerations | |
enum | _oko_prop_type { OKO_PROP_UNDEF = 0 , OKO_PROP_STRING = 1 , OKO_PROP_INT = 2 , OKO_PROP_DOUBLE = 3 , OKO_PROP_ENUM = 4 } |
Specifies the available property types. More... | |
enum | _oko_write_type { OKO_WRITE_NONE = 0 , OKO_WRITE_EEPROM = 1 , OKO_WRITE_VOLATILE = 2 , OKO_WRITE_BOTH = 3 } |
Specifies the available write types. More... | |
Functions | |
oko_res_type | oko_PropertiesGetNumber (uint32_t deviceh, uint32_t *num) |
Get the number of available properties of the current device. More... | |
oko_res_type | oko_PropertyGetName (uint32_t deviceh, uint32_t index, char *name) |
Get the name of the specified property, using its index. More... | |
oko_res_type | oko_PropertyGetType (uint32_t deviceh, const char *name, oko_prop_type *prop_type) |
Get the type of the specified property. More... | |
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. More... | |
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. More... | |
oko_res_type | oko_PropertyGetUnit (uint32_t deviceh, const char *name, char *unit) |
Get the measure unit of the specified property. More... | |
oko_res_type | oko_PropertyGetDescription (uint32_t deviceh, const char *name, char *desc) |
Get the description of the specified property. More... | |
oko_res_type | oko_PropertyGetReadOnly (uint32_t deviceh, const char *name, bool *read_only) |
Verify if the specified property is read-only. More... | |
oko_res_type | oko_PropertyGetWriteOnly (uint32_t deviceh, const char *name, bool *write_only) |
Verify if the specified property is write-only. More... | |
oko_res_type | oko_PropertyGetWriteType (uint32_t deviceh, const char *name, oko_write_type *write_type) |
Get the write type of the specified property. More... | |
oko_res_type | oko_PropertyHasLimits (uint32_t deviceh, const char *name, bool *has_limits) |
Verify if the specified property has readable limits. More... | |
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. More... | |
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. More... | |
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. More... | |
enum _oko_prop_type |
enum _oko_write_type |
oko_res_type oko_PropertiesGetNumber | ( | uint32_t | deviceh, |
uint32_t * | num | ||
) |
Get the number of available properties of the current device.
[in] | deviceh | A valid device handle. |
[out] | num | The total number of properties for the current device. |
oko_res_type oko_PropertyGetDescription | ( | uint32_t | deviceh, |
const char * | name, | ||
char * | desc | ||
) |
Get the description of the specified property.
[in] | deviceh | A valid device handle. |
[in] | name | The property name. |
[out] | desc | Description string, pre-allocated by the caller. |
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.
This function is used for properties that have oko_prop_type equal to OKO_PROP_ENUM. A description string is available for each numeric value of the enumerator. This string is the suggested description to convert the numeric value in a meaningful string to be printed in the end-user interface.
[in] | deviceh | A valid device handle. |
[in] | name | The property name. |
[in] | enum_val | One of the possible numeric value for the enumerator. |
[out] | enum_name | the desired value. String needs to be pre-allocated by the caller. |
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.
[in] | deviceh | A valid device handle. |
[in] | name | The property name. |
[out] | num | pointer to desired value |
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.
Values are zero if the property has no limits.
[in] | deviceh | A valid device handle. |
[in] | name | The property name. |
[out] | min | Minimum value that can be set. |
[out] | max | Maximum value that can be set. |
oko_res_type oko_PropertyGetName | ( | uint32_t | deviceh, |
uint32_t | index, | ||
char * | name | ||
) |
Get the name of the specified property, using its index.
Index is zero-based, so the first property has index 0 and the last num-1 (where num is the value returned by oko_PropertiesGetNumber). This should be used at start to obtain the property names.
[in] | deviceh | A valid device handle. |
[in] | index | Index of the property. Index is zero-based. |
[out] | name | The name of the property. It needs to be pre-allocated by the caller. |
oko_res_type oko_PropertyGetReadOnly | ( | uint32_t | deviceh, |
const char * | name, | ||
bool * | read_only | ||
) |
Verify if the specified property is read-only.
[in] | deviceh | A valid device handle. |
[in] | name | The property name. |
[out] | read_only | TRUE if the property is read-only. |
oko_res_type oko_PropertyGetType | ( | uint32_t | deviceh, |
const char * | name, | ||
oko_prop_type * | prop_type | ||
) |
Get the type of the specified property.
[in] | deviceh | A valid device handle. |
[in] | name | The property name. |
[out] | prop_type | The property type as defined in oko_prop_type. |
oko_res_type oko_PropertyGetUnit | ( | uint32_t | deviceh, |
const char * | name, | ||
char * | unit | ||
) |
Get the measure unit of the specified property.
[in] | deviceh | A valid device handle. |
[in] | name | The property name string, pre-allocated by the caller. |
[out] | unit | Unit of measure string, pre-allocated by the caller. |
oko_res_type oko_PropertyGetWriteOnly | ( | uint32_t | deviceh, |
const char * | name, | ||
bool * | write_only | ||
) |
Verify if the specified property is write-only.
[in] | deviceh | A valid device handle. |
[in] | name | The property name. |
[out] | write_only | TRUE if the property is write-only. |
oko_res_type oko_PropertyGetWriteType | ( | uint32_t | deviceh, |
const char * | name, | ||
oko_write_type * | write_type | ||
) |
Get the write type of the specified property.
[in] | deviceh | A valid device handle. |
[in] | name | The property name. |
[out] | write_type | The property type as defined in oko_prop_type. |
oko_res_type oko_PropertyHasLimits | ( | uint32_t | deviceh, |
const char * | name, | ||
bool * | has_limits | ||
) |
Verify if the specified property has readable limits.
It can be used with write properties to know if the high and low value can be requested to the device.
[in] | deviceh | A valid device handle. |
[in] | name | The property name. |
[out] | has_limits | TRUE if the property limits can be read. |
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.
Advanced feature should are mainly used for advanced application or debugging.
[in] | deviceh | A valid device handle. |
[in] | name | The property name. |
[out] | is_adv | TRUE if the property is an advanced feature. |
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.
[in] | deviceh | A valid device handle. |
[in] | name | The property name. |
[out] | is_main | TRUE if the property is one of the main feature. |