mirror of
https://github.com/linux-usb-gadgets/libusbgx.git
synced 2025-07-13 13:29:44 +03:00
libusbgx: Add functions to set all strs and attrs with one call.
Rename usbg_create_gadget() to usbg_create_vid_pid(). dd usbg_create_gadget() to allow gadget creation with given attributes and strings. Add usbg_set_gadget_attrs() which allow to set all attributes with one call. Add usbg_set_gadget_strs() which allow to set all strings with one call. Gadget structure creation and initialization has been moved to usbg_create_empty_gadget() to avoid copy-paste same code in usbg_create_gadget_vid_pid() and usbg_create_gadget(). Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com> [Port from libusbg and update description] Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
This commit is contained in:
parent
d1148ca3fc
commit
2a0e2bc756
3 changed files with 137 additions and 22 deletions
|
@ -42,7 +42,7 @@ int main(void)
|
|||
goto out1;
|
||||
}
|
||||
|
||||
g = usbg_create_gadget(s, "g1", VENDOR, PRODUCT);
|
||||
g = usbg_create_gadget_vid_pid(s, "g1", VENDOR, PRODUCT);
|
||||
if (!g) {
|
||||
fprintf(stderr, "Error on create gadget\n");
|
||||
goto out2;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue