Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 84eb7432 in mainline


Ignore:
Timestamp:
2011-06-18T17:04:14Z (11 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master
Children:
c4fb5ecd
Parents:
58c0917
Message:

String representation of USB direction

Location:
uspace/lib/usb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/include/usb/usb.h

    r58c0917 r84eb7432  
    6969        USB_DIRECTION_BOTH
    7070} usb_direction_t;
     71
     72const char *usb_str_direction(usb_direction_t);
    7173
    7274/** USB speeds. */
  • uspace/lib/usb/src/usb.c

    r58c0917 r84eb7432  
    5858};
    5959
     60static const char *str_direction[] = {
     61        "in",
     62        "out",
     63        "both"
     64};
     65
    6066/** String representation for USB transfer type.
    6167 *
     
    8490}
    8591
     92/** String representation of USB direction.
     93 *
     94 * @param d The direction.
     95 * @return Direction as a string (in English).
     96 */
     97const char *usb_str_direction(usb_direction_t d)
     98{
     99        if (d >= ARR_SIZE(str_direction)) {
     100                return "invalid";
     101        }
     102        return str_direction[d];
     103}
     104
    86105/** String representation of USB speed.
    87106 *
Note: See TracChangeset for help on using the changeset viewer.