OkoLib
library for accessing Okolab devices
Reading property value

Functions

oko_res_type oko_PropertyReadString (uint32_t deviceh, const char *name, char *val)
 Get the current value of a string property. More...
 
oko_res_type oko_PropertyReadInt (uint32_t deviceh, const char *name, int32_t *val)
 Get the current value of a integer property. More...
 
oko_res_type oko_PropertyReadDouble (uint32_t deviceh, const char *name, double *val)
 Get the current value of a double property. More...
 
oko_res_type oko_PropertyUpdate (uint32_t deviceh, const char *name)
 Update the specified property value, reading it from the current device. More...
 

Detailed Description

Function Documentation

◆ oko_PropertyReadDouble()

oko_res_type oko_PropertyReadDouble ( uint32_t  deviceh,
const char *  name,
double *  val 
)

Get the current value of a double property.

Parameters
[in]devicehA valid device handle.
[in]nameThe property name.
[out]valCurrent value of the specified property.
Returns
OKO_OK upon success, an error code otherwise.
Note
It returns the last updated value. To refresh the value, call oko_PropertyUpdate first

◆ oko_PropertyReadInt()

oko_res_type oko_PropertyReadInt ( uint32_t  deviceh,
const char *  name,
int32_t *  val 
)

Get the current value of a integer property.

Parameters
[in]devicehA valid device handle.
[in]nameThe property name.
[out]valCurrent value of the specified property.
Note
It returns the last updated value. To refresh the value, call oko_PropertyUpdate first
Returns
OKO_OK upon success, an error code otherwise.

◆ oko_PropertyReadString()

oko_res_type oko_PropertyReadString ( uint32_t  deviceh,
const char *  name,
char *  val 
)

Get the current value of a string property.

Parameters
[in]nameThe property name.
[in]devicehA valid device handle.
[out]valCurrent value of the specified property. String needs to be pre-allocated by the caller.
Returns
OKO_OK upon success, an error code otherwise.
Note
It returns the last updated value. To refresh the value, call oko_PropertyUpdate first

◆ oko_PropertyUpdate()

oko_res_type oko_PropertyUpdate ( uint32_t  deviceh,
const char *  name 
)

Update the specified property value, reading it from the current device.

Parameters
[in]devicehA valid device handle.
[in]nameThe property name.
Returns
OKO_OK upon success, an error code otherwise.