Expose driver info to library users
This commit is contained in:
parent
711bb1151b
commit
2c06a4ebfa
2 changed files with 27 additions and 0 deletions
|
@ -118,6 +118,11 @@ API_EXPORTED void fp_dscv_devs_free(struct fp_dscv_dev **devs)
|
|||
g_free(devs);
|
||||
}
|
||||
|
||||
API_EXPORTED const struct fp_driver *fp_dscv_dev_get_driver(struct fp_dscv_dev *dev)
|
||||
{
|
||||
return dev->drv;
|
||||
}
|
||||
|
||||
API_EXPORTED struct fp_dev *fp_dev_open(struct fp_dscv_dev *ddev)
|
||||
{
|
||||
struct fp_dev *dev;
|
||||
|
@ -152,6 +157,21 @@ API_EXPORTED void fp_dev_close(struct fp_dev *dev)
|
|||
g_free(dev);
|
||||
}
|
||||
|
||||
API_EXPORTED const struct fp_driver *fp_dev_get_driver(struct fp_dev *dev)
|
||||
{
|
||||
return dev->drv;
|
||||
}
|
||||
|
||||
API_EXPORTED const char *fp_driver_get_name(const struct fp_driver *drv)
|
||||
{
|
||||
return drv->name;
|
||||
}
|
||||
|
||||
API_EXPORTED const char *fp_driver_get_full_name(const struct fp_driver *drv)
|
||||
{
|
||||
return drv->full_name;
|
||||
}
|
||||
|
||||
API_EXPORTED int fp_init(void)
|
||||
{
|
||||
usb_init();
|
||||
|
|
|
@ -23,14 +23,21 @@
|
|||
/* structs that applications are not allowed to peek into */
|
||||
struct fp_dscv_dev;
|
||||
struct fp_dev;
|
||||
struct fp_driver;
|
||||
|
||||
/* Device discovery */
|
||||
struct fp_dscv_dev **fp_discover_devs(void);
|
||||
void fp_dscv_devs_free(struct fp_dscv_dev **devs);
|
||||
const struct fp_driver *fp_dscv_dev_get_driver(struct fp_dscv_dev *dev);
|
||||
|
||||
/* Device handling */
|
||||
struct fp_dev *fp_dev_open(struct fp_dscv_dev *ddev);
|
||||
void fp_dev_close(struct fp_dev *dev);
|
||||
const struct fp_driver *fp_dev_get_driver(struct fp_dev *dev);
|
||||
|
||||
/* Drivers */
|
||||
const char *fp_driver_get_name(const struct fp_driver *drv);
|
||||
const char *fp_driver_get_full_name(const struct fp_driver *drv);
|
||||
|
||||
int fp_init(void);
|
||||
|
||||
|
|
Loading…
Reference in a new issue