OLD | NEW |
1 /** | 1 /** |
2 * \file detect.c | 2 * \file detect.c |
3 * Example program to detect a device and list capabilities. | 3 * Example program to detect a device and list capabilities. |
4 * | 4 * |
5 * Copyright (C) 2005-2008 Linus Walleij <triad@df.lth.se> | 5 * Copyright (C) 2005-2008 Linus Walleij <triad@df.lth.se> |
6 * Copyright (C) 2007 Ted Bullock <tbullock@canada.com> | 6 * Copyright (C) 2007 Ted Bullock <tbullock@canada.com> |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 LIBMTP_error_number_t err; | 64 LIBMTP_error_number_t err; |
65 int i; | 65 int i; |
66 | 66 |
67 int opt; | 67 int opt; |
68 extern int optind; | 68 extern int optind; |
69 extern char *optarg; | 69 extern char *optarg; |
70 | 70 |
71 while ((opt = getopt(argc, argv, "d")) != -1 ) { | 71 while ((opt = getopt(argc, argv, "d")) != -1 ) { |
72 switch (opt) { | 72 switch (opt) { |
73 case 'd': | 73 case 'd': |
74 LIBMTP_Set_Debug(LIBMTP_DEBUG_ALL); | 74 LIBMTP_Set_Debug(LIBMTP_DEBUG_PTP | LIBMTP_DEBUG_DATA); |
75 break; | 75 break; |
76 } | 76 } |
77 } | 77 } |
78 | 78 |
79 argc -= optind; | 79 argc -= optind; |
80 argv += optind; | 80 argv += optind; |
81 | 81 |
82 LIBMTP_Init(); | 82 LIBMTP_Init(); |
83 | 83 |
84 fprintf(stdout, "libmtp version: " LIBMTP_VERSION_STRING "\n\n"); | 84 fprintf(stdout, "libmtp version: " LIBMTP_VERSION_STRING "\n\n"); |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 } | 282 } |
283 LIBMTP_Release_Device(device); | 283 LIBMTP_Release_Device(device); |
284 } /* End For Loop */ | 284 } /* End For Loop */ |
285 | 285 |
286 free(rawdevices); | 286 free(rawdevices); |
287 | 287 |
288 printf("OK.\n"); | 288 printf("OK.\n"); |
289 | 289 |
290 return 0; | 290 return 0; |
291 } | 291 } |
OLD | NEW |