1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>usb_string_id</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="USB Gadget API for Linux"><link rel="up" href="composite.html" title="Composite Device Framework"><link rel="prev" href="API-usb-add-config.html" title="usb_add_config"><link rel="next" href="API-usb-string-ids-tab.html" title="usb_string_ids_tab"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">usb_string_id</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-usb-add-config.html">Prev</a> </td><th width="60%" align="center">Composite Device Framework</th><td width="20%" align="right"> <a accesskey="n" href="API-usb-string-ids-tab.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-usb-string-id"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>usb_string_id — 2 allocate an unused string ID 3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">usb_string_id </b>(</code></td><td>struct usb_composite_dev * <var class="pdparam">cdev</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1124452172"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>cdev</code></em></span></dt><dd><p> 4 the device whose string descriptor IDs are being allocated 5 </p></dd></dl></div></div><div class="refsect1"><a name="idp1124453780"></a><h2>Context</h2><p> 6 single threaded during gadget setup 7</p></div><div class="refsect1"><a name="idp1124454404"></a><h2>Description</h2><p> 8 <em class="parameter"><code>usb_string_id</code></em>() is called from <code class="function">bind</code> callbacks to allocate 9 string IDs. Drivers for functions, configurations, or gadgets will 10 then store that ID in the appropriate descriptors and string table. 11 </p><p> 12 13 All string identifier should be allocated using this, 14 <em class="parameter"><code>usb_string_ids_tab</code></em>() or <em class="parameter"><code>usb_string_ids_n</code></em>() routine, to ensure 15 that for example different functions don't wrongly assign different 16 meanings to the same identifier. 17</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-usb-add-config.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="composite.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-usb-string-ids-tab.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">usb_add_config</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">usb_string_ids_tab</span></td></tr></table></div></body></html> 18