diff options
author | Krzysztof Opasiak <k.opasiak@samsung.com> | 2014-02-19 14:39:35 +0100 |
---|---|---|
committer | Krzysztof Opasiak <k.opasiak@samsung.com> | 2014-02-19 21:17:19 +0100 |
commit | 8133bd5909a158f069ffc79d221306e2bc3c2eb7 (patch) | |
tree | 29e5bde9df7dfa3cd895223c499f5191793428e6 /include/usbg | |
parent | 39035cdb9045b42e5c24e94a2fcaa2bf266b3a7b (diff) | |
download | libusbg-8133bd5909a158f069ffc79d221306e2bc3c2eb7.tar.gz libusbg-8133bd5909a158f069ffc79d221306e2bc3c2eb7.tar.bz2 libusbg-8133bd5909a158f069ffc79d221306e2bc3c2eb7.zip |
libusbg: Separate config attrs and strs form configuration.
Configuration, its attributes and strings are all logically
independent so should be placed in separate structures.
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Diffstat (limited to 'include/usbg')
-rw-r--r-- | include/usbg/usbg.h | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/include/usbg/usbg.h b/include/usbg/usbg.h index e90a3b6..847d536 100644 --- a/include/usbg/usbg.h +++ b/include/usbg/usbg.h @@ -99,6 +99,25 @@ struct gadget }; /** + * @struct config_attrs + * @brief USB configuration attributes + */ +struct config_attrs +{ + uint8_t bmAttributes; + uint8_t bMaxPower; +}; + +/** + * @struct config_strs + * @brief USB configuration strings + */ +struct config_strs +{ + char configuration[USBG_MAX_STR_LENGTH]; +}; + +/** * @struct config * @brief USB gadget configuration attributes */ @@ -110,9 +129,8 @@ struct config char name[USBG_MAX_NAME_LENGTH]; char path[USBG_MAX_PATH_LENGTH]; - int maxpower; - int bmattrs; - char str_cfg[USBG_MAX_STR_LENGTH]; + struct config_attrs attrs; + struct config_strs strs; }; /** @@ -461,16 +479,16 @@ extern struct config *usbg_create_config(struct gadget *g, char *name); /** * @brief Set the configuration maximum power * @param c Pointer to config - * @param maxpower Maximum power (in 2 mA units) + * @param bMaxPower Maximum power (in 2 mA units) */ -extern void usbg_set_config_max_power(struct config *c, int maxpower); +extern void usbg_set_config_max_power(struct config *c, int bMaxPower); /** * @brief Set the configuration bitmap attributes * @param c Pointer to config - * @param bmattrs Configuration characteristics + * @param bmAttributes Configuration characteristics */ -extern void usbg_set_config_bm_attrs(struct config *c, int bmattrs); +extern void usbg_set_config_bm_attrs(struct config *c, int bmAttributes); /** * @brief Set the configuration string |