OkoLib
library for accessing Okolab devices
Library access functions

Functions

oko_res_type oko_LibInit (const char *db_path)
 Initialize the library. More...
 
oko_res_type oko_LibShutDown ()
 Deallocates any resource that were allocated by oko_LibInitialize. More...
 
oko_res_type oko_LibGetVersion (char *version)
 Print the version of Okolib library on a string passed by reference. More...
 
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 functions. More...
 
oko_res_type oko_LibSetSuggestedUSBOnly (bool use)
 Turn on/off the filter on the USB serial ports. More...
 
oko_res_type oko_LibGetSuggestedUSBOnly (bool *use)
 Get the usage status of the USB serial ports filter. More...
 

Detailed Description

Function Documentation

◆ oko_LibGetLastError()

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 functions.

Parameters
[out]errmsgA pointer to a valid string, pre-allocated by the caller, where the error message will be stored in.
[in]maxsizeMaximum size of the error message. If bigger, the message will be truncated.
Returns
OKO_OK upon success, an error code otherwise.

◆ oko_LibGetSuggestedUSBOnly()

oko_res_type oko_LibGetSuggestedUSBOnly ( bool *  use)

Get the usage status of the USB serial ports filter.

Parameters
[out]usefilter in use (true/false)
Returns
OKO_OK upon success, an error code otherwise.

◆ oko_LibGetVersion()

oko_res_type oko_LibGetVersion ( char *  version)

Print the version of Okolib library on a string passed by reference.

Parameters
[out]versionA pointer to a valid string, pre-allocated by the caller, where the version will be stored in.
Returns
OKO_OK upon success, an error code otherwise.

◆ oko_LibInit()

oko_res_type oko_LibInit ( const char *  db_path)

Initialize the library.

Parameters
[in]db_pathThe path where okolib.db file is installed. The specified path can be absolute or relative to the current working directory. If it is null or an empty string, the db file is looked for in the same path of okolib.dll
Returns
OKO_OK upon success, an error code otherwise.

◆ oko_LibSetSuggestedUSBOnly()

oko_res_type oko_LibSetSuggestedUSBOnly ( bool  use)

Turn on/off the filter on the USB serial ports.

Parameters
[in]usetrue to turn on the filter, false to torn off it
Returns
OKO_OK upon success, an error code otherwise.

◆ oko_LibShutDown()

oko_res_type oko_LibShutDown ( )

Deallocates any resource that were allocated by oko_LibInitialize.

Returns
OKO_OK upon success, an error code otherwise.