lomoco.h File Reference
Go to the source code of this file.
Data Structures | |
struct | lomoco_base_s |
Used to store all needed information for lomoco. More... | |
struct | lomoco_device_s |
Used to store all needed information of a lomoco device. More... | |
Typedefs | |
typedef struct lomoco_base_s | lomoco_base_t |
typedef int(* | lomoco_device_func )(lomoco_device_t *device) |
typedef struct lomoco_device_s | lomoco_device_t |
Functions | |
void | lomoco_finish (lomoco_base_t *base) |
int | lomoco_get_devices (lomoco_base_t *base, lomoco_device_func fn) |
lomoco_base_t * | lomoco_init (int debug_level) |
Typedef Documentation
typedef struct lomoco_base_s lomoco_base_t |
typedef int(* lomoco_device_func)(lomoco_device_t *device) |
typedef struct lomoco_device_s lomoco_device_t |
Function Documentation
void lomoco_finish | ( | lomoco_base_t * | base | ) |
Frees the allocated memory of the base structure.
Frees all lists and allocated memory. This function should be called before you exit.
- Parameters:
-
base The initialized base structure.
int lomoco_get_devices | ( | lomoco_base_t * | base, | |
lomoco_device_func | fn | |||
) |
Get all attached supported devices by lomoco.
This function will search for all attached and supported devices. It will call a callback function on every found device.
- Parameters:
-
base The initialized base structure. fn The callback function called on every device found.
- Returns:
- 1 on success, 0 if no device has been found and -1 on an error.
lomoco_base_t* lomoco_init | ( | int | debug_level | ) |
Initializes all needed structures and reads the config file.
This function has to be called before you can use any other function. It reads the config file, allocates the base structure and add all information.
- Parameters:
-
debug_level Set the debug level of lomoco
- Returns:
- Returns the initialized base structure