Correct printing generic descriptors (the length includes the two other struct fields). Fixed warnings.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22008 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
b60056cdb3
commit
ff9e2d0cf7
@ -21,12 +21,12 @@ DumpInterface(const BUSBInterface *interface)
|
||||
printf(" Protocol ........... %d\n", interface->Protocol());
|
||||
printf(" Interface String ... \"%s\"\n", interface->InterfaceString());
|
||||
|
||||
for (int32 i = 0; i < interface->CountEndpoints(); i++) {
|
||||
for (uint32 i = 0; i < interface->CountEndpoints(); i++) {
|
||||
const BUSBEndpoint *endpoint = interface->EndpointAt(i);
|
||||
if (!endpoint)
|
||||
continue;
|
||||
|
||||
printf(" [Endpoint %d]\n", i);
|
||||
printf(" [Endpoint %lu]\n", i);
|
||||
printf(" MaxPacketSize .... %d\n", endpoint->MaxPacketSize());
|
||||
printf(" Interval ......... %d\n", endpoint->Interval());
|
||||
|
||||
@ -47,12 +47,12 @@ DumpInterface(const BUSBInterface *interface)
|
||||
|
||||
char buffer[256];
|
||||
usb_descriptor *generic = (usb_descriptor *)buffer;
|
||||
for (int32 i = 0; interface->OtherDescriptorAt(i, generic, 256) == B_OK; i++) {
|
||||
printf(" [Descriptor %d]\n", i);
|
||||
for (uint32 i = 0; interface->OtherDescriptorAt(i, generic, 256) == B_OK; i++) {
|
||||
printf(" [Descriptor %lu]\n", i);
|
||||
printf(" Type ............. 0x%02x\n", generic->generic.descriptor_type);
|
||||
|
||||
printf(" Data ............. ");
|
||||
for(int32 j = 0; j < generic->generic.length; j++)
|
||||
// the length includes the length and descriptor_type field
|
||||
for(int32 j = 0; j < generic->generic.length - 2; j++)
|
||||
printf("%02x ", generic->generic.data[j]);
|
||||
printf("\n");
|
||||
}
|
||||
@ -66,8 +66,8 @@ DumpConfiguration(const BUSBConfiguration *configuration)
|
||||
return;
|
||||
|
||||
printf(" Configuration String . \"%s\"\n", configuration->ConfigurationString());
|
||||
for (int32 i = 0; i < configuration->CountInterfaces(); i++) {
|
||||
printf(" [Interface %d]\n", i);
|
||||
for (uint32 i = 0; i < configuration->CountInterfaces(); i++) {
|
||||
printf(" [Interface %lu]\n", i);
|
||||
DumpInterface(configuration->InterfaceAt(i));
|
||||
}
|
||||
}
|
||||
@ -89,8 +89,8 @@ DumpInfo(BUSBDevice &device)
|
||||
printf("Product String ......... \"%s\"\n", device.ProductString());
|
||||
printf("Serial Number .......... \"%s\"\n", device.SerialNumberString());
|
||||
|
||||
for (int32 i = 0; i < device.CountConfigurations(); i++) {
|
||||
printf(" [Configuration %d]\n", i);
|
||||
for (uint32 i = 0; i < device.CountConfigurations(); i++) {
|
||||
printf(" [Configuration %lu]\n", i);
|
||||
DumpConfiguration(device.ConfigurationAt(i));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user