Changes in / [9c0f158:f08c560] in mainline
- Location:
- uspace/lib/usb
- Files:
-
- 2 edited
-
include/usb/classes/hidparser.h (modified) (2 diffs)
-
src/hidparser.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/include/usb/classes/hidparser.h
r9c0f158 rf08c560 207 207 const usb_hid_report_in_callbacks_t *callbacks, void *arg); 208 208 209 size_t usb_hid_report_input_length(const usb_hid_report_parser_t *parser,209 int usb_hid_report_input_length(const usb_hid_report_parser_t *parser, 210 210 usb_hid_report_path_t *path, int flags); 211 211 … … 223 223 void usb_hid_report_set_last_item(usb_hid_report_path_t *usage_path, int32_t tag, int32_t data); 224 224 int usb_hid_report_compare_usage_path(usb_hid_report_path_t *report_path, usb_hid_report_path_t *path, int flags); 225 usb_hid_report_path_t *usb_hid_report_path_clone(usb_hid_report_path_t *usage_path); 226 227 228 // output API 229 /** Allocates output report buffer*/ 230 uint8_t *usb_hid_report_output(usb_hid_report_parser_t *parser); 231 /** Frees output report buffer*/ 232 void usb_hid_report_output_free(uint8_t *output); 233 234 /** Returns size of output for given usage path */ 235 size_t usb_hid_report_output_size(usb_hid_report_parser_t *parser, 236 usb_hid_report_path_t *path, int flags); 237 /** Updates the output report buffer by translated given data */ 238 int usb_hid_report_output_translate(usb_hid_report_parser_t *parser, 239 usb_hid_report_path_t *path, int flags, 240 uint8_t *buffer, size_t size, 241 int32_t *data, size_t data_size); 225 int usb_hid_report_path_clone(usb_hid_report_path_t *new_usage_path, usb_hid_report_path_t *usage_path); 226 227 228 // output 229 // - funkce co vrati cesty poli v output reportu 230 // - funkce co pro danou cestu nastavi data 231 // - finalize 232 242 233 #endif 243 234 /** -
uspace/lib/usb/src/hidparser.c
r9c0f158 rf08c560 164 164 // store current usage path 165 165 report_item->usage_path = usage_path; 166 167 // new current usage path 168 tmp_usage_path = usb_hid_report_path(); 166 169 167 // c lonepath to the new one168 tmp_usage_path = usb_hid_report_path_clone(usage_path);170 // copy old path to the new one 171 usb_hid_report_path_clone(tmp_usage_path, usage_path); 169 172 170 173 // swap … … 793 796 } 794 797 795 size_t usb_hid_report_input_length(const usb_hid_report_parser_t *parser,798 int usb_hid_report_input_length(const usb_hid_report_parser_t *parser, 796 799 usb_hid_report_path_t *path, int flags) 797 800 { … … 946 949 break; 947 950 948 /* compare with only the end of path*/951 /* given path must be the end of the report one*/ 949 952 case USB_HID_PATH_COMPARE_END: 950 953 report_link = report_path->link.prev; … … 1016 1019 1017 1020 /** 1018 * Clone content of given usage path to the new one 1019 * 1020 */ 1021 usb_hid_report_path_t *usb_hid_report_path_clone(usb_hid_report_path_t *usage_path) 1021 * 1022 */ 1023 int usb_hid_report_path_clone(usb_hid_report_path_t *new_usage_path, usb_hid_report_path_t *usage_path) 1022 1024 { 1023 1025 usb_hid_report_usage_path_t *path_item; 1024 1026 link_t *path_link; 1025 usb_hid_report_path_t *new_usage_path = usb_hid_report_path (); 1026 1027 if(new_usage_path == NULL){ 1028 return NULL; 1029 } 1027 1030 1028 1031 1029 if(list_empty(&usage_path->link)){ 1032 return new_usage_path;1030 return EOK; 1033 1031 } 1034 1032 … … 1041 1039 } 1042 1040 1043 return new_usage_path;1041 return EOK; 1044 1042 } 1045 1043
Note:
See TracChangeset
for help on using the changeset viewer.
