1
0
Fork 0
mirror of https://github.com/linux-usb-gadgets/libusbgx.git synced 2025-07-23 16:15:06 +03:00

libusbgx: Add functions for get/set function attributes.

Add usbg_get_function_attrs() and usbg_get_function_type()
to aviod direct access to function structure members.

Add usbg_set_function_attrs() to allow set all function\
attributes with one call.

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:
Krzysztof Opasiak 2014-02-13 13:47:37 +01:00
parent 894741889e
commit 42c6bc3e56
3 changed files with 90 additions and 7 deletions

View file

@ -51,19 +51,19 @@ int main(void)
usbg_set_gadget_manufacturer(g, LANG_US_ENG, "Foo Inc.");
usbg_set_gadget_product(g, LANG_US_ENG, "Bar Gadget");
f_acm0 = usbg_create_function(g, F_ACM, "usb0");
f_acm0 = usbg_create_function(g, F_ACM, "usb0", NULL);
if (!f_acm0) {
fprintf(stderr, "Error creating acm0 function\n");
goto out2;
}
f_acm1 = usbg_create_function(g, F_ACM, "usb1");
f_acm1 = usbg_create_function(g, F_ACM, "usb1", NULL);
if (!f_acm1) {
fprintf(stderr, "Error creating acm1 function\n");
goto out2;
}
f_ecm = usbg_create_function(g, F_ECM, "usb0");
f_ecm = usbg_create_function(g, F_ECM, "usb0", NULL);
if (!f_ecm) {
fprintf(stderr, "Error creating ecm function\n");
goto out2;