Proof-of-concept driver added

This commit is contained in:
2023-09-19 15:06:41 +02:00
parent 0543d56dd5
commit c2ae875a82
7 changed files with 72 additions and 13 deletions

View File

@@ -4,7 +4,7 @@
struct DEVICE
{
void* driver;
};
array_t* device_array;

View File

@@ -89,16 +89,16 @@ void usb_init()
struct libusb_device_descriptor desc;
libusb_get_device_descriptor(current, &desc);
printf("Found usb device %04x:%04x\n", desc.idVendor, desc.idProduct);
array_t* array = device_get_array();
array_add(array, 0);
// printf("Found usb device %04x:%04x\n", desc.idVendor, desc.idProduct);
// array_t* array = device_get_array();
// array_add(array, 0);
libusb_device_handle* handle;
libusb_open(current, &handle);
char buf[4096] = {0};
libusb_get_string_descriptor_ascii(handle, 1, buf, 4096);
printf("Device desc (1): %s\n", buf);
libusb_get_string_descriptor_ascii(handle, 2, buf, 4096);
printf("Device desc (2): %s\n", buf);
// libusb_device_handle* handle;
// libusb_open(current, &handle);
// char buf[4096] = {0};
// libusb_get_string_descriptor_ascii(handle, 1, buf, 4096);
// printf("Device desc (1): %s\n", buf);
// libusb_get_string_descriptor_ascii(handle, 2, buf, 4096);
// printf("Device desc (2): %s\n", buf);
}
}