Difference between revisions of "Truxton usb get vendor id"

From truxwiki.com
Jump to navigation Jump to search
(Created page with "This retrieves the identifier of the maker of the USB device. This corresponds to the <code>[VID]</code> column of the <code><nowiki>[</nowiki>USBDevice<no...")
 
Line 4: Line 4:
 
=Syntax=
 
=Syntax=
 
<source lang="C">
 
<source lang="C">
void truxton_usb_get_vendor_id( uint64_t usb_handle );
+
uint64_t truxton_usb_get_vendor_id( uint64_t usb_handle );
 
</source>
 
</source>
  

Revision as of 15:00, 1 February 2021

This retrieves the identifier of the maker of the USB device. This corresponds to the [VID] column of the [USBDevice] table.

Syntax

uint64_t truxton_usb_get_vendor_id( uint64_t usb_handle );

Parameters

usb_handle

This handle comes from calling truxton_usb_create().

Return value

The vendor identifier as stored in the [VID] column in the [USBDevice] table.

Sample

void dump_usb(uint64_t usb_handle)
{
   uint64_t integer_value = 0;

   char temp_string[ 1024 ];

   truxton_usb_get_id( usb_handle, temp_string, sizeof(temp_string) );
   printf( "USB ID is %s\n", temp_string );

   truxton_usb_get_media_id( usb_handle, temp_string, sizeof(temp_string) );
   printf( "Media ID is %s\n", temp_string );

   truxton_usb_get_file_id( usb_handle, temp_string, sizeof(temp_string) );
   printf( "File ID is %s\n", temp_string );

   truxton_usb_get_device_id( usb_handle, temp_string, sizeof(temp_string) );
   printf( "Device ID is \"%s\"\n", temp_string );

   integer_value = truxton_usb_get_device_type( usb_handle );
   printf( "Device type is %" PRIu64 "\n", integer_value );

   integer_value = truxton_usb_get_file_offset( usb_handle );
   printf( "File offset is %" PRIu64 "\n", integer_value );

   integer_value = truxton_usb_get_vendor_id( usb_handle );
   printf( "VID is %" PRIu64 "\n", integer_value );

   integer_value = truxton_usb_get_product_id( usb_handle );
   printf( "PID is %" PRIu64 "\n", integer_value );

   integer_value = truxton_usb_get_revision( usb_handle );
   printf( "Revision is %" PRIu64 "\n", integer_value );

   integer_value = truxton_usb_get_when( usb_handle );
   printf( "When is %" PRIu64 "\n", integer_value );
}