Changeset e5165a3 in mainline for uspace/app/lsusb/main.c
- Timestamp:
- 2011-05-07T11:10:50Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 69ac0fd
- Parents:
- 431d6d6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/lsusb/main.c
r431d6d6 re5165a3 48 48 49 49 #define MAX_FAILED_ATTEMPTS 4 50 #define MAX_PATH_LENGTH 1024 50 51 51 52 static int get_hc_handle(size_t class_index, devman_handle_t *hc_handle) … … 75 76 int main(int argc, char *argv[]) 76 77 { 77 size_t class_index = 1;78 size_t class_index = 0; 78 79 size_t failed_attempts = 0; 79 80 80 81 while (failed_attempts < MAX_FAILED_ATTEMPTS) { 82 class_index++; 81 83 devman_handle_t hc_handle = 0; 82 84 int rc = get_hc_handle(class_index, &hc_handle); 83 class_index++;84 85 if (rc != EOK) { 85 86 failed_attempts++; 86 87 continue; 87 88 } 88 89 printf(NAME ": HC %zu has handle %" PRIun ".\n", 90 class_index, hc_handle); 89 char path[MAX_PATH_LENGTH]; 90 rc = devman_get_device_path(hc_handle, path, MAX_PATH_LENGTH); 91 if (rc != EOK) { 92 continue; 93 } 94 printf(NAME ": host controller %zu is `%s'.\n", 95 class_index, path); 91 96 } 92 97
Note:
See TracChangeset
for help on using the changeset viewer.