2022-01-25 05:56:12 +08:00
|
|
|
#ifndef SC_USB_H
|
|
|
|
#define SC_USB_H
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <libusb-1.0/libusb.h>
|
|
|
|
|
|
|
|
struct sc_usb {
|
|
|
|
libusb_context *context;
|
|
|
|
libusb_device_handle *handle;
|
|
|
|
};
|
|
|
|
|
|
|
|
bool
|
2022-01-26 02:10:23 +08:00
|
|
|
sc_usb_init(struct sc_usb *usb);
|
2022-01-25 05:56:12 +08:00
|
|
|
|
|
|
|
void
|
|
|
|
sc_usb_destroy(struct sc_usb *usb);
|
|
|
|
|
2022-01-26 04:11:32 +08:00
|
|
|
libusb_device *
|
|
|
|
sc_usb_find_device(struct sc_usb *usb, const char *serial);
|
|
|
|
|
2022-01-26 02:10:23 +08:00
|
|
|
bool
|
2022-01-26 04:11:32 +08:00
|
|
|
sc_usb_connect(struct sc_usb *usb, libusb_device *device);
|
2022-01-26 02:10:23 +08:00
|
|
|
|
|
|
|
void
|
|
|
|
sc_usb_disconnect(struct sc_usb *usb);
|
|
|
|
|
2022-01-25 05:56:12 +08:00
|
|
|
#endif
|