diff options
author | Linus Walleij <triad@df.lth.se> | 2006-04-26 14:12:44 +0000 |
---|---|---|
committer | Linus Walleij <triad@df.lth.se> | 2006-04-26 14:12:44 +0000 |
commit | 8c45b291051788a947b1845c73e040b8c286a755 (patch) | |
tree | 05fded1510c84f8efb18b970d8281a71549d2036 /examples/detect.c | |
parent | 99ba91a2651c8925ce6912d3f9e2f07399041c55 (diff) | |
download | libmtp-8c45b291051788a947b1845c73e040b8c286a755.tar.gz |
Minor fixups.
Diffstat (limited to 'examples/detect.c')
-rw-r--r-- | examples/detect.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/examples/detect.c b/examples/detect.c index f26f604..1f81699 100644 --- a/examples/detect.c +++ b/examples/detect.c @@ -24,13 +24,16 @@ int main (int argc, char **argv) printf("No devices.\n"); exit (0); } + + LIBMTP_Dump_Device_Info(device); + printf("MTP-specific device properties:\n"); // The owner name owner = LIBMTP_Get_Ownername(device); if (owner == NULL) { - printf(" Owner name: (NULL)\n"); + printf(" Owner name: (NULL)\n"); } else { - printf(" Owner name: %s\n", owner); + printf(" Owner name: %s\n", owner); free(owner); } @@ -38,35 +41,35 @@ int main (int argc, char **argv) ret = LIBMTP_Get_Storageinfo(device, &totalbytes, &freebytes, &storage_description, &volume_label); if (ret == 0) { #ifdef __WIN32__ - printf(" Total bytes on device: %I64u (%I64u MB)\n", + printf(" Total bytes on device: %I64u (%I64u MB)\n", totalbytes, totalbytes/(1024*1024)); - printf(" Free bytes on device: %I64u (%I64u MB)\n", + printf(" Free bytes on device: %I64u (%I64u MB)\n", freebytes, freebytes/(1024*1024)); #else - printf(" Total bytes on device: %llu (%llu MB)\n", + printf(" Total bytes on device: %llu (%llu MB)\n", totalbytes, totalbytes/(1024*1024)); - printf(" Free bytes on device: %llu (%llu MB)\n", + printf(" Free bytes on device: %llu (%llu MB)\n", freebytes, freebytes/(1024*1024)); #endif if (storage_description != NULL) { - printf(" Storage description: \"%s\"\n", storage_description); + printf(" Storage description: \"%s\"\n", storage_description); free(storage_description); } if (volume_label != NULL) { - printf(" Volume label: \"%s\"\n", volume_label); + printf(" Volume label: \"%s\"\n", volume_label); free(volume_label); } } else { - printf(" Error getting disk info...\n"); + printf(" Error getting disk info...\n"); } // Some battery info ret = LIBMTP_Get_Batterylevel(device, &maxbattlevel, &currbattlevel); if (ret == 0) { - printf(" Battery level %d of %d (%d%%)\n",currbattlevel, maxbattlevel, + printf(" Battery level %d of %d (%d%%)\n",currbattlevel, maxbattlevel, (currbattlevel/maxbattlevel * 100)); } else { - printf(" Error getting battery info...\n"); + printf(" Error getting battery info...\n"); } // Try to get device info XML file... |