summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolger Schemel <holger.schemel@virtion.de>2020-10-26 16:02:43 +0100
committerHolger Schemel <holger.schemel@virtion.de>2020-10-27 15:24:22 +0100
commit6d12e58a5ae3538b50953f8aa8155810ca9f10c0 (patch)
treef66228ece1a7c7f016eaceba4de0ed3d28be160c
parentac80717d9b73d34ba5560e79ae14cbba27b2bedb (diff)
downloadlibmtp-6d12e58a5ae3538b50953f8aa8155810ca9f10c0.tar.gz
added serial number of device to output of 'mtp-files'
-rw-r--r--examples/files.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/examples/files.c b/examples/files.c
index 6af3b7b..3ee0846 100644
--- a/examples/files.c
+++ b/examples/files.c
@@ -21,6 +21,7 @@
* Boston, MA 02111-1307, USA.
*/
#include "common.h"
+#include "ptp.h"
#include <stdlib.h>
static void dump_fileinfo(LIBMTP_file_t *file)
@@ -117,6 +118,7 @@ int main(int argc, char **argv)
for (i = 0; i < numrawdevices; i++) {
LIBMTP_mtpdevice_t *device;
LIBMTP_devicestorage_t *storage;
+ PTPParams *params;
char *friendlyname;
device = LIBMTP_Open_Raw_Device_Uncached(&rawdevices[i]);
@@ -127,10 +129,13 @@ int main(int argc, char **argv)
/* Echo the friendly name so we know which device we are working with */
friendlyname = LIBMTP_Get_Friendlyname(device);
+ params = (PTPParams *) device->params;
if (friendlyname == NULL) {
- printf("Listing File Information on Device with name: (NULL)\n");
+ printf("Listing File Information on Device with name: (NULL) [SN:%s]\n",
+ params->deviceinfo.SerialNumber);
} else {
- printf("Listing File Information on Device with name: %s\n", friendlyname);
+ printf("Listing File Information on Device with name: %s [SN:%s]\n",
+ friendlyname, params->deviceinfo.SerialNumber);
free(friendlyname);
}