summaryrefslogtreecommitdiff
path: root/examples/detect.c
diff options
context:
space:
mode:
authorLinus Walleij <triad@df.lth.se>2006-04-26 14:12:44 +0000
committerLinus Walleij <triad@df.lth.se>2006-04-26 14:12:44 +0000
commit8c45b291051788a947b1845c73e040b8c286a755 (patch)
tree05fded1510c84f8efb18b970d8281a71549d2036 /examples/detect.c
parent99ba91a2651c8925ce6912d3f9e2f07399041c55 (diff)
downloadlibmtp-8c45b291051788a947b1845c73e040b8c286a755.tar.gz
Minor fixups.
Diffstat (limited to 'examples/detect.c')
-rw-r--r--examples/detect.c25
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...