Changeset aad3587 in mainline for uspace/app/usbinfo/main.c


Ignore:
Timestamp:
2011-03-17T23:10:26Z (15 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2d6787b
Parents:
7b13d8e
Message:

String printing back in usbinfo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/usbinfo/main.c

    r7b13d8e raad3587  
    134134        _OPTION("-m --match-ids", "Print match ids generated for the device.");
    135135        _OPTION("-t --descriptor-tree", "Print descriptor tree.");
     136        _OPTION("-s --strings", "Try to print all string descriptors.");
    136137
    137138        printf("\n");
     
    148149        {"match-ids", no_argument, NULL, 'm'},
    149150        {"descriptor-tree", no_argument, NULL, 't'},
     151        {"strings", no_argument, NULL, 's'},
    150152        {0, 0, NULL, 0}
    151153};
    152 static const char *short_options = "himt";
     154static const char *short_options = "himts";
    153155
    154156int main(int argc, char *argv[])
     
    162164        bool action_print_match_ids = false;
    163165        bool action_print_descriptor_tree = false;
     166        bool action_print_strings = false;
    164167
    165168        /*
     
    189192                                action_print_descriptor_tree = true;
    190193                                break;
     194                        case 's':
     195                                action_print_strings = true;
     196                                break;
    191197                        default:
    192198                                assert(false && "unreachable code");
     
    198204        if (!action_print_match_ids
    199205            && !action_print_short_identification
     206            && !action_print_strings
    200207            && !action_print_descriptor_tree) {
    201208                action_print_short_identification = true;
     
    239246                        dump_descriptor_tree_brief(dev);
    240247                }
     248                if (action_print_strings) {
     249                        dump_strings(dev);
     250                }
    241251
    242252                /* Destroy the control pipe (close the session etc.). */
Note: See TracChangeset for help on using the changeset viewer.