Truxton usb destroy

From truxwiki.com
Revision as of 09:37, 25 January 2021 by Sam (talk | contribs) (Created page with "This destroys a USB object. =Syntax= <source lang="C"> void truxton_usb_destroy( uint64_t usb_handle ); </source> =Parameters= ==<code>usb_handle</code>== The handle to the...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This destroys a USB object.

Syntax

void truxton_usb_destroy( uint64_t usb_handle );

Parameters

usb_handle

The handle to the USB object. This handle comes from calling truxton_usb_create(), truxton_child_file_create_usb(), truxton_file_create_usb(),

Sample

 1 void add_thumb_drive( uint64_t truxton, uint64_t media, uint64_t child_file, uint64_t when )
 2 {
 3    char media_id[ 65 ];
 4    char file_id[ 65 ];
 5    
 6    truxton_media_get_id( media, media_id, sizeof( media_id ) );
 7    truxton_child_file_get_id( child_file, file_id, sizeof( file_id ) );
 8 
 9    uint64_t usb = truxton_usb_create( truxton );
10 
11    truxton_usb_set_file_id( usb, file_id );
12    truxton_usb_set_media_id( usb, media_id );
13    truxton_usb_set_when( usb, when );
14    truxton_usb_set_vendor_id( usb, 0x8EC );
15    truxton_usb_set_product_id( usb, 0x16 );
16 
17    // Commit the data to the database
18    truxton_usb_save( url );
19    truxton_usb_destroy( url );
20 }