Commit 9d698fff06943b348e736c26b68a024d4dda36c7
1 parent
2a840a25
Listage des endpoints
Showing
2 changed files
with
5 additions
and
3 deletions
Show diff stats
test_list_all.c renamed to test_list_devices.c
test_com.c renamed to test_list_endpoints.c
@@ -64,10 +64,12 @@ int main(){ | @@ -64,10 +64,12 @@ int main(){ | ||
64 | 64 | ||
65 | // find endpoints | 65 | // find endpoints |
66 | for(int k=0; k<interface_desc->bNumEndpoints; k++){ | 66 | for(int k=0; k<interface_desc->bNumEndpoints; k++){ |
67 | - libusb_endpoint_descriptor *endpoint_desc = interface_desc->endpoints | 67 | + libusb_endpoint_descriptor *endpoint_desc = interface_desc->endpoints[k]; |
68 | 68 | ||
69 | - /* ... some code ... */ | ||
70 | - // TODO what to do next ? | 69 | + // list endpoints bEndpointAddress and bmAttributes |
70 | + printf("Endpoint inter. %d, num. %d\n", j, k); | ||
71 | + printf("bEndpointAddress = 0x%x\n", endpoint_desc->bEndpointAddress); | ||
72 | + printf("bmAttributes = 0x%x\n", endpoint_desc->bmAttributes); | ||
71 | } | 73 | } |
72 | 74 | ||
73 | // release interfaces | 75 | // release interfaces |