Home | History | Annotate | Download | only in examples

Lines Matching refs:device

3  * Example program to detect a device and list capabilities.
71 fprintf(stdout, "Listing raw device(s)\n");
87 fprintf(stdout, " Found %d device(s):\n", numrawdevices);
115 fprintf(stdout, "Attempting to connect device(s)\n");
117 LIBMTP_mtpdevice_t *device;
129 device = LIBMTP_Open_Raw_Device(&rawdevices[i]);
130 if (device == NULL) {
131 fprintf(stderr, "Unable to open raw device %d\n", i);
135 LIBMTP_Dump_Errorstack(device);
136 LIBMTP_Clear_Errorstack(device);
137 LIBMTP_Dump_Device_Info(device);
139 printf("MTP-specific device properties:\n");
141 friendlyname = LIBMTP_Get_Friendlyname(device);
148 syncpartner = LIBMTP_Get_Syncpartner(device);
157 ret = LIBMTP_Get_Batterylevel(device, &maxbattlevel, &currbattlevel);
164 LIBMTP_Clear_Errorstack(device);
167 ret = LIBMTP_Get_Supported_Filetypes(device, &filetypes, &filetypes_len);
176 LIBMTP_Dump_Errorstack(device);
177 LIBMTP_Clear_Errorstack(device);
181 ret = LIBMTP_Get_Secure_Time(device, &sectime);
187 LIBMTP_Clear_Errorstack(device);
190 // Device certificate XML fragment
191 ret = LIBMTP_Get_Device_Certificate(device, &devcert);
196 fprintf(stdout, "Unable to acquire device certificate, perhaps this device "
198 LIBMTP_Dump_Errorstack(device);
199 LIBMTP_Clear_Errorstack(device);
202 // Try to get Media player device info XML file...
203 files = LIBMTP_Get_Filelisting_With_Callback(device, NULL, NULL);
217 int ret = LIBMTP_Get_Track_To_File_Descriptor(device,
229 LIBMTP_Dump_Errorstack(device);
230 LIBMTP_Clear_Errorstack(device);
243 LIBMTP_Dump_Errorstack(device);
244 LIBMTP_Clear_Errorstack(device);
248 LIBMTP_Dump_Errorstack(device);
249 LIBMTP_Clear_Errorstack(device);
260 LIBMTP_Release_Device(device);