<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://truxwiki.com/index.php?action=history&amp;feed=atom&amp;title=Truxton_usb_get_id</id>
	<title>Truxton usb get id - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://truxwiki.com/index.php?action=history&amp;feed=atom&amp;title=Truxton_usb_get_id"/>
	<link rel="alternate" type="text/html" href="https://truxwiki.com/index.php?title=Truxton_usb_get_id&amp;action=history"/>
	<updated>2026-09-09T14:21:10Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://truxwiki.com/index.php?title=Truxton_usb_get_id&amp;diff=3459&amp;oldid=prev</id>
		<title>Sam: Created page with &quot;This retrieves the [https://en.wikipedia.org/wiki/Universally_unique_identifier GUID] of the USB object. This call is only valid after a successful call to &lt;code&gt;truxton_usb...&quot;</title>
		<link rel="alternate" type="text/html" href="https://truxwiki.com/index.php?title=Truxton_usb_get_id&amp;diff=3459&amp;oldid=prev"/>
		<updated>2021-01-26T14:36:26Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;This retrieves the [https://en.wikipedia.org/wiki/Universally_unique_identifier GUID] of the USB object. This call is only valid after a successful call to &amp;lt;code&amp;gt;truxton_usb...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This retrieves the [https://en.wikipedia.org/wiki/Universally_unique_identifier GUID] of the USB object.&lt;br /&gt;
This call is only valid after a successful call to &amp;lt;code&amp;gt;[[truxton_usb_save]]()&amp;lt;/code&amp;gt;.&lt;br /&gt;
This corresponds to the &amp;lt;code&amp;gt;[ID]&amp;lt;/code&amp;gt; column of the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[USBDevice Table|USBDevice]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; table.&lt;br /&gt;
&lt;br /&gt;
=Syntax=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;C&amp;quot;&amp;gt;&lt;br /&gt;
void truxton_usb_get_id( uint64_t usb_handle, char * destination_string, size_t max_size );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Parameters=&lt;br /&gt;
==&amp;lt;code&amp;gt;usb_handle&amp;lt;/code&amp;gt;==&lt;br /&gt;
This handle comes from calling &amp;lt;code&amp;gt;[[truxton_usb_create]]()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==&amp;lt;code&amp;gt;destination_string&amp;lt;/code&amp;gt;==&lt;br /&gt;
The string to be written to. &lt;br /&gt;
&lt;br /&gt;
==&amp;lt;code&amp;gt;max_size&amp;lt;/code&amp;gt;==&lt;br /&gt;
The maximum number of characters that can be written to &amp;lt;code&amp;gt;destination_string&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=Sample=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;C&amp;quot; highlight=&amp;quot;26&amp;quot;&amp;gt;&lt;br /&gt;
void add_thumb_drive( uint64_t truxton, uint64_t media, uint64_t child_file, uint64_t when, uint64_t where )&lt;br /&gt;
{&lt;br /&gt;
   char media_id[ 65 ];&lt;br /&gt;
   char file_id[ 65 ];&lt;br /&gt;
   char usb_id[ 65 ];&lt;br /&gt;
   &lt;br /&gt;
   truxton_media_get_id( media, media_id, sizeof( media_id ) );&lt;br /&gt;
   truxton_child_file_get_id( child_file, file_id, sizeof( file_id ) );&lt;br /&gt;
&lt;br /&gt;
   uint64_t usb = truxton_usb_create( truxton );&lt;br /&gt;
&lt;br /&gt;
   truxton_usb_set_file_id( usb, file_id );&lt;br /&gt;
   truxton_usb_set_media_id( usb, media_id );&lt;br /&gt;
   truxton_usb_set_when( usb, when );&lt;br /&gt;
   truxton_usb_set_vendor_id( usb, 0x8EC );&lt;br /&gt;
   truxton_usb_set_product_id( usb, 0x16 );&lt;br /&gt;
   truxton_usb_set_file_offset( usb, where );&lt;br /&gt;
&lt;br /&gt;
   // Commit the data to the database&lt;br /&gt;
   if ( truxton_usb_save( usb ) == 0 )&lt;br /&gt;
   {&lt;br /&gt;
      printf( &amp;quot;Cannot save USB to the database\n&amp;quot; );&lt;br /&gt;
   }&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
      truxton_usb_get_id( usb, usb_id, sizeof( usb_id ) );&lt;br /&gt;
      printf( &amp;quot;USB information saved to record id %s\n&amp;quot;, usb_id );&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   truxton_usb_destroy( usb );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sam</name></author>
		
	</entry>
</feed>