OkoLib
library for accessing Okolab devices
Device information

Functions

oko_res_type oko_DeviceGetPortName (uint32_t deviceh, char *port)
 Get the Port Name of the specified device. More...
 
oko_res_type oko_DeviceConnectionStatus (uint32_t deviceh, uint32_t *conn)
 Get the connection status of the current device. More...
 
oko_res_type oko_DeviceSetChecksumUsage (uint32_t deviceh, bool use_checksum)
 Set the checksum usage flag of the current device. More...
 
oko_res_type oko_DeviceGetChecksumUsage (uint32_t deviceh, bool *use_checksum)
 Get the checksum usage flag of the current device. More...
 
oko_res_type oko_DeviceGetChecksumAvailable (uint32_t deviceh, bool *checksum)
 Check if the communication protocol of the specified device supports checksum. More...
 

Detailed Description

Function Documentation

◆ oko_DeviceConnectionStatus()

oko_res_type oko_DeviceConnectionStatus ( uint32_t  deviceh,
uint32_t *  conn 
)

Get the connection status of the current device.

Parameters
[in]devicehA valid device handle.
[out]connA value describing the connection status (0=off, 1=0n)
Returns
OKO_OK upon success, an error code otherwise.

◆ oko_DeviceGetChecksumAvailable()

oko_res_type oko_DeviceGetChecksumAvailable ( uint32_t  deviceh,
bool *  checksum 
)

Check if the communication protocol of the specified device supports checksum.

Parameters
[in]devicehA valid device handle.
[out]checksumtrue if checksum is available
Returns
OKO_OK upon success, an error code otherwise.

◆ oko_DeviceGetChecksumUsage()

oko_res_type oko_DeviceGetChecksumUsage ( uint32_t  deviceh,
bool *  use_checksum 
)

Get the checksum usage flag of the current device.

Parameters
[in]devicehA valid device handle.
[out]use_checksumvariable where is stored the desired info
Returns
OKO_OK upon success, an error code otherwise.

◆ oko_DeviceGetPortName()

oko_res_type oko_DeviceGetPortName ( uint32_t  deviceh,
char *  port 
)

Get the Port Name of the specified device.

Parameters
[in]devicehA valid device handle.
[out]portThe serial port name, pre-allocated by the caller (eg. 'COM1' on Windows and '/dev/ttyS0' on Linux).
Returns
OKO_OK upon success, an error code otherwise.

◆ oko_DeviceSetChecksumUsage()

oko_res_type oko_DeviceSetChecksumUsage ( uint32_t  deviceh,
bool  use_checksum 
)

Set the checksum usage flag of the current device.

Parameters
[in]devicehA valid device handle.
[in]use_checksumset checksum usage
Returns
OKO_OK upon success, an error code otherwise.