From 8c45b291051788a947b1845c73e040b8c286a755 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Wed, 26 Apr 2006 14:12:44 +0000 Subject: Minor fixups. --- examples/detect.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'examples/detect.c') 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... -- cgit v1.2.1