liblabpro
Portable C library for data collection from Vernier LabPro devices
Initialization/Deinitialization

Data Structures

struct  LabPro_Context
 Thin wrapper around libusb_context. More...
 
struct  LabPro_List
 Struct acting as an array of LabPros. More...
 

Functions

int LabPro_init (LabPro_Context *context)
 Initialize liblabpro. Currently just a wrapper around libusb_init(). More...
 
void LabPro_exit (LabPro_Context *context)
 De-initialize liblabpro. More...
 
LabPro_List LabPro_list_labpros (LabPro_Context *context)
 Obtain a list connected LabPro devices. More...
 
void LabPro_close_labpro (LabPro *labpro)
 Close the LabPro. More...
 

Detailed Description

Function Documentation

◆ LabPro_close_labpro()

void LabPro_close_labpro ( LabPro labpro)

Close the LabPro.

Close a LabPro, releasing its USB interface and closing its libusb device handle.

Parameters
labproA pointer to the LabPro to close.

Definition at line 180 of file liblabpro.c.

◆ LabPro_exit()

void LabPro_exit ( LabPro_Context context)

De-initialize liblabpro.

Definition at line 59 of file liblabpro.c.

◆ LabPro_init()

int LabPro_init ( LabPro_Context context)

Initialize liblabpro. Currently just a wrapper around libusb_init().

Parameters
contextA pointer to a liblabpro context to be populated.
Returns
One of the LabPro_USB_Errors error codes or zero on success. If there is an error, it will be translated with libusb_strerror() and printed to the console.

Definition at line 46 of file liblabpro.c.

◆ LabPro_list_labpros()

LabPro_List LabPro_list_labpros ( LabPro_Context context)

Obtain a list connected LabPro devices.

This function attempts to open and claim the USB interface for each LabPro, so the application should call LabPro_close_labpro() on each LabPro in the LabPro_List that will not be used.

Parameters
contextA pointer to the liblabpro context.
Returns
A struct containing a pointer to an array of up to 5 LabPro devices and the number of found devices.

Definition at line 63 of file liblabpro.c.