libVitaMTP 2.5.9

vitamtp.h
1//
2// Library for interacting with Vita's MTP connection
3// VitaMTP
4//
5// Created by Yifan Lu
6// This program is free software: you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation, either version 3 of the License, or
9// (at your option) any later version.
10//
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15//
16// You should have received a copy of the GNU General Public License
17// along with this program. If not, see <http://www.gnu.org/licenses/>.
18//
19
20#ifndef VitaMTP_h
21#define VitaMTP_h
22
23#ifdef __cplusplus
24 extern "C" {
25#endif
26
27#include <stdint.h>
28#include <time.h>
29
35 struct vita_raw_device
36{
37 char serial[18];
38 void *data;
39};
40
46 struct LIBVitaMTP_event
47{
48 uint16_t Code;
49 uint32_t SessionID;
50 uint32_t Transaction_ID;
51 uint32_t Param1;
52 uint32_t Param2;
53 uint32_t Param3;
54};
55
62 struct vita_info
63{
64 char responderVersion[6]; // max: XX.XX\0
65 int protocolVersion;
66 char *onlineId;
67 char *modelInfo;
68 struct
69 {
70 int type;
71 int codecType;
72 int width;
73 int height;
74 } photoThumb;
75 struct
76 {
77 int type;
78 int codecType;
79 int width;
80 int height;
81 int duration;
82 } videoThumb;
83 struct
84 {
85 int type;
86 int codecType;
87 int width;
88 int height;
89 } musicThumb;
90 struct
91 {
92 int type;
93 int codecType;
94 int width;
95 int height;
96 } gameThumb;
97};
98
107 struct initiator_info
108{
109 char *platformType;
110 char *platformSubtype;
111 char *osVersion;
112 char *version;
113 int protocolVersion;
114 char *name;
115 int applicationType;
116};
117
125 struct settings_info
126{
127 struct account // remember to free each string!
128 {
129 char *userName;
130 char *signInId;
131 char *accountId;
132 char *countryCode;
133 char *langCode;
134 char *birthday;
135 char *onlineUser;
136 char *passwd;
137 struct account *next_account;
138 } current_account;
139};
140
148 struct browse_info
149{
150 uint32_t ohfiParent;
151 uint32_t unk1; // seen: 0 always
152 uint32_t index;
153 uint32_t numObjects;
154 uint32_t unk4; // seen: 0 always
155} __attribute__((packed));
156
160 enum DataType
161{
162 Folder = (1 << 0),
163 File = (1 << 1),
164 App = (1 << 2),
165 Thumbnail = (1 << 3),
166 SaveData = (1 << 4),
167 Music = (1 << 5),
168 Photo = (1 << 6),
169 Video = (1 << 7),
170 Special = (1 << 8),
171 Package = (1 << 9)
172};
173
177 struct media_track
178{
179 int type;
180 union
181 {
182 struct media_track_audio
183 {
184 int padding[2];
185 int codecType;
186 int bitrate;
187 } track_audio;
188
189 struct media_track_video
190 {
191 int width;
192 int height;
193 int codecType;
194 int bitrate;
195 unsigned long duration;
196 } track_video;
197
198 struct media_track_photo
199 {
200 int width;
201 int height;
202 int codecType;
203 } track_photo;
204 } data;
205};
206
220 struct metadata
221{
222 int ohfiParent;
223 int ohfi;
224 unsigned int handle; // only used by PTP object commands
225 char *name;
226 char *path;
227 int type;
228 time_t dateTimeCreated; // unix timestamp
229 uint64_t size;
230 enum DataType dataType;
231
232 union
233 {
234 struct metadata_thumbnail
235 {
236 int codecType;
237 int width;
238 int height;
239 int type;
240 int orientationType;
241 float aspectRatio;
242 int fromType;
243 } thumbnail;
244
245 struct metadata_saveData
246 {
247 int padding[2];
248 char *title;
249 char *dirName;
250 char *savedataTitle;
251 int statusType;
252 char *detail;
253 long dateTimeUpdated; // unix timestamp
254 } saveData;
255
256 struct metadata_photo
257 {
258 int numTracks;
259 struct media_track *tracks;
260 char *title;
261 char *fileName;
262 int fileFormatType;
263 int statusType;
264 long dateTimeOriginal;
265 } photo;
266
267 struct metadata_music
268 {
269 int numTracks;
270 struct media_track *tracks;
271 char *title;
272 char *fileName;
273 int fileFormatType;
274 int statusType;
275 char *album;
276 char *artist;
277 } music;
278
279 struct metadata_video
280 {
281 int numTracks;
282 struct media_track *tracks;
283 char *title;
284 char *fileName;
285 int fileFormatType;
286 int statusType;
287 long dateTimeUpdated;
288 int parentalLevel;
289 char *explanation;
290 char *copyright;
291 } video;
292 } data;
293
294 struct metadata *next_metadata;
295};
296
304 struct object_status
305{
306 uint32_t ohfiRoot;
307 uint32_t len;
308 char *title;
309} __attribute__((packed));
310
318 struct send_part_init
319{
320 uint32_t ohfi;
321 uint64_t offset;
322 uint64_t size;
323} __attribute__((packed));
324
331 struct http_object_prop
332{
333 uint64_t size;
334 uint8_t timestamp_len;
335 char *timestamp;
336} __attribute__((packed));
337
344 struct operate_object
345{
346 uint32_t cmd;
347 uint32_t ohfi;
348 uint32_t unk1;
349 uint32_t len;
350 char *title;
351} __attribute__((packed));
352
359 struct treat_object
360{
361 uint32_t ohfiParent;
362 uint32_t unk0;
363 uint32_t handle;
364} __attribute__((packed));
365
375 struct existance_object
376{
377 uint64_t size;
378 char *name;
379 unsigned int data_length;
380 char data[0x400];
381};
382
389 struct copy_confirmation_info
390{
391 uint32_t count;
392 uint32_t ohfi[];
393} __attribute__((packed));
394
402 struct capability_info
403{
404 char *version;
405 struct capability_info_function
406 {
407 char *type;
408 struct capability_info_format
409 {
410 char *contentType;
411 char *codec;
412 struct capability_info_format *next_item;
413 } formats;
414 struct capability_info_option
415 {
416 char *name;
417 struct capability_info_option *next_item;
418 } options;
419 struct capability_info_function *next_item;
420 } functions;
421};
422
426 enum vita_device_type
427{
428 VitaDeviceUndefined,
429 VitaDeviceUSB,
430 VitaDeviceWireless
431};
432
439 struct wireless_host_info
440{
441 const char *guid;
442 const char *type;
443 const char *name;
444 int port;
445};
446
453 struct wireless_vita_info
454{
455 const char *deviceid;
456 const char *type;
457 const char *mac_addr;
458 const char *name;
459};
460
464 typedef struct vita_raw_device vita_raw_device_t;
465 typedef struct vita_device vita_device_t;
466 typedef struct LIBVitaMTP_event vita_event_t;
467 typedef struct vita_info vita_info_t;
468 typedef struct initiator_info initiator_info_t;
469 typedef struct settings_info settings_info_t;
470 typedef struct browse_info browse_info_t;
471 typedef struct metadata metadata_t;
472 typedef struct thumbnail thumbnail_t;
473 typedef struct object_status object_status_t;
474 typedef struct send_part_init send_part_init_t;
475 typedef struct http_object_prop http_object_prop_t;
476 typedef struct operate_object operate_object_t;
477 typedef struct treat_object treat_object_t;
478 typedef struct existance_object existance_object_t;
479 typedef struct copy_confirmation_info copy_confirmation_info_t;
480 typedef struct capability_info capability_info_t;
481 typedef struct wireless_host_info wireless_host_info_t;
482 typedef struct wireless_vita_info wireless_vita_info_t;
483
484 typedef int (*device_registered_callback_t)(const char *deviceid);
485 typedef int (*register_device_callback_t)(wireless_vita_info_t *info, int *p_err);
486 typedef void (*device_reg_complete_callback_t)(void);
487 typedef int (*read_callback_t)(unsigned char *data, unsigned long wantlen, unsigned long *gotlen);
488 typedef int (*write_callback_t)(const unsigned char *data, unsigned long size, unsigned long *written);
489
500 typedef int (* VitaMTP_progressfunc_t)(uint64_t const sent, uint64_t const total,
501 void const *const data);
502
503
507#define VITA_PID 0x04E4
508#define VITA_VID 0x054C
509
513#define VITAMTP_VERSION_MAJOR 2
514#define VITAMTP_VERSION_MINOR 5
515#define VITAMTP_PROTOCOL_FW_3_30 1900010
516#define VITAMTP_PROTOCOL_FW_3_10 1800010
517#define VITAMTP_PROTOCOL_FW_3_00 1700010
518#define VITAMTP_PROTOCOL_FW_2_60 1600010
519#define VITAMTP_PROTOCOL_FW_2_10 1500010
520#define VITAMTP_PROTOCOL_FW_2_00 1400010
521#define VITAMTP_PROTOCOL_FW_1_80 1300010
522#define VITAMTP_PROTOCOL_FW_1_60 1200010
523#define VITAMTP_PROTOCOL_FW_1_50 1100010
524#define VITAMTP_PROTOCOL_FW_1_00 1000010
525#define VITAMTP_PROTOCOL_MAX_VERSION VITAMTP_PROTOCOL_FW_3_30
526#define VITAMTP_WIRELESS_FW_2_00 1000000
527#define VITAMTP_WIRELESS_MAX_VERSION VITAMTP_WIRELESS_FW_2_00
528
532#ifndef PTP_RC_OK
533#define PTP_RC_OK 0x2001
534#endif
535
536#ifndef PTP_RC_GeneralError
537#define PTP_RC_GeneralError 0x2002
538#endif
539
540#ifndef PTP_ERROR_CANCEL
541#define PTP_ERROR_CANCEL 0x02FB
542#endif
543
544#define PTP_EC_VITA_RequestSendNumOfObject 0xC104
545#define PTP_EC_VITA_RequestSendObjectMetadata 0xC105
546#define PTP_EC_VITA_RequestSendObject 0xC107
547#define PTP_EC_VITA_RequestCancelTask 0xC108
548#define PTP_EC_VITA_RequestSendHttpObjectFromURL 0xC10B
549#define PTP_EC_VITA_Unknown1 0xC10D
550#define PTP_EC_VITA_RequestSendObjectStatus 0xC10F
551#define PTP_EC_VITA_RequestSendObjectThumb 0xC110
552#define PTP_EC_VITA_RequestDeleteObject 0xC111
553#define PTP_EC_VITA_RequestGetSettingInfo 0xC112
554#define PTP_EC_VITA_RequestSendHttpObjectPropFromURL 0xC113
555#define PTP_EC_VITA_RequestSendPartOfObject 0xC115
556#define PTP_EC_VITA_RequestOperateObject 0xC117
557#define PTP_EC_VITA_RequestGetPartOfObject 0xC118
558#define PTP_EC_VITA_RequestSendStorageSize 0xC119
559#define PTP_EC_VITA_RequestCheckExistance 0xC120
560#define PTP_EC_VITA_RequestGetTreatObject 0xC122
561#define PTP_EC_VITA_RequestSendCopyConfirmationInfo 0xC123
562#define PTP_EC_VITA_RequestSendObjectMetadataItems 0xC124
563#define PTP_EC_VITA_RequestSendNPAccountInfo 0xC125
564#define PTP_EC_VITA_RequestTerminate 0xC126
565
569#define PTP_OC_VITA_GetVitaInfo 0x9511
570#define PTP_OC_VITA_SendNumOfObject 0x9513
571#define PTP_OC_VITA_GetBrowseInfo 0x9514
572#define PTP_OC_VITA_SendObjectMetadata 0x9515
573#define PTP_OC_VITA_SendObjectThumb 0x9516
574#define PTP_OC_VITA_ReportResult 0x9518
575#define PTP_OC_VITA_SendInitiatorInfo 0x951C
576#define PTP_OC_VITA_GetUrl 0x951F
577#define PTP_OC_VITA_SendHttpObjectFromURL 0x9520
578#define PTP_OC_VITA_SendNPAccountInfo 0x9523
579#define PTP_OC_VITA_GetSettingInfo 0x9524
580#define PTP_OC_VITA_SendObjectStatus 0x9528
581#define PTP_OC_VITA_SendHttpObjectPropFromURL 0x9529
582#define PTP_OC_VITA_SendHostStatus 0x952A
583#define PTP_OC_VITA_SendPartOfObjectInit 0x952B
584#define PTP_OC_VITA_SendPartOfObject 0x952C
585#define PTP_OC_VITA_OperateObject 0x952E
586#define PTP_OC_VITA_GetPartOfObject 0x952F
587#define PTP_OC_VITA_SendStorageSize 0x9533
588#define PTP_OC_VITA_GetTreatObject 0x9534
589#define PTP_OC_VITA_SendCopyConfirmationInfo 0x9535
590#define PTP_OC_VITA_SendObjectMetadataItems 0x9536
591#define PTP_OC_VITA_SendCopyConfirmationInfoInit 0x9537
592#define PTP_OC_VITA_KeepAlive 0x9538
593#define PTP_OC_VITA_Unknown1 0x953A
594#define PTP_OC_VITA_GetVitaCapabilityInfo 0x953B
595#define PTP_OC_VITA_SendPCCapabilityInfo 0x953C
596
600#define PTP_RC_VITA_Invalid_Context 0xA001
601#define PTP_RC_VITA_Not_Ready 0xA002
602#define PTP_RC_VITA_Invalid_OHFI 0xA003
603#define PTP_RC_VITA_Invalid_Data 0xA004
604#define PTP_RC_VITA_Too_Large_Data 0xA005
605#define PTP_RC_VITA_Invalid_Result_Code 0xA006
606#define PTP_RC_VITA_Cannot_Access_Server 0xA008
607#define PTP_RC_VITA_Cannot_Read_Info 0xA009
608#define PTP_RC_VITA_Not_Exist_Object 0xA00A
609#define PTP_RC_VITA_Invalid_Protocol_Version 0xA00B
610#define PTP_RC_VITA_Invalid_App_Version 0xA00C
611#define PTP_RC_VITA_Disconnect_Network 0xA00D
612#define PTP_RC_VITA_Cannot_Cancel_Operation 0xA00F
613#define PTP_RC_VITA_Timeout_Server 0xA010
614#define PTP_RC_VITA_Already_Finish 0xA011
615#define PTP_RC_VITA_Invalid_Permission 0xA012
616#define PTP_RC_VITA_Busy_Object 0xA013
617#define PTP_RC_VITA_Locked_Object 0xA014
618#define PTP_RC_VITA_Under_Maintenance 0xA017
619#define PTP_RC_VITA_Failed_Download 0xA018
620#define PTP_RC_VITA_Not_Support_Property 0xA019
621#define PTP_RC_VITA_Over_End 0xA01A
622#define PTP_RC_VITA_Cannot_Access_DB 0xA01B
623#define PTP_RC_VITA_Reconstructing_DB 0xA01C
624#define PTP_RC_VITA_Invalid_Charactor 0xA01D
625#define PTP_RC_VITA_Long_String 0xA01E
626#define PTP_RC_VITA_Failed_Operate_Object 0xA01F
627#define PTP_RC_VITA_Canceled 0xA020
628#define PTP_RC_VITA_Invalid_Account_Info 0xA021
629#define PTP_RC_VITA_Same_Object 0xA022
630#define PTP_RC_VITA_Different_Object 0xA023
631#define PTP_RC_VITA_Invalid_Metadata_Item 0xA024
632#define PTP_RC_VITA_Same_OHFI 0xA025
633#define PTP_RC_VITA_Folder_WriteProtected 0xA027
634#define PTP_RC_VITA_NP_Error 0xA029
635
639#define PTP_OFC_Unknown1 0xB005
640#define PTP_OFC_Unknown2 0xB006
641#define PTP_OFC_PSPGame 0xB007
642#define PTP_OFC_PSPSave 0xB00A
643#define PTP_OFC_Unknown3 0xB00B
644#define PTP_OFC_Unknown4 0xB00F
645#define PTP_OFC_Unknown5 0xB010
646#define PTP_OFC_VitaGame 0xB014
647
651#define VITA_STORAGE_ID 0x00010001
652
658#define VITA_HOST_STATUS_Connected 0x0
659#define VITA_HOST_STATUS_Unknown1 0x1
660#define VITA_HOST_STATUS_Deactivate 0x2
661#define VITA_HOST_STATUS_EndConnection 0x3
662#define VITA_HOST_STATUS_StartConnection 0x4
663#define VITA_HOST_STATUS_Unknown2 0x5
664
673#define VITA_OHFI_MUSIC 0x01
674#define VITA_OHFI_PHOTO 0x02
675#define VITA_OHFI_VIDEO 0x03
676#define VITA_OHFI_PACKAGE 0x05
677#define VITA_OHFI_BACKUP 0x06
678#define VITA_OHFI_VITAAPP 0x0A
679#define VITA_OHFI_PSPAPP 0x0D
680#define VITA_OHFI_PSPSAVE 0x0E
681#define VITA_OHFI_PSXAPP 0x10
682#define VITA_OHFI_PSMAPP 0x12
683
684#define VITA_OHFI_SUBNONE 0x00
685#define VITA_OHFI_SUBFILE 0x01
686
687#define VITA_DIR_TYPE_MASK_MUSIC 0x1000000
688#define VITA_DIR_TYPE_MASK_PHOTO 0x2000000
689#define VITA_DIR_TYPE_MASK_VIDEO 0x4000000
690#define VITA_DIR_TYPE_MASK_ROOT 0x0010000
691#define VITA_DIR_TYPE_MASK_REGULAR 0x0000001
692#define VITA_DIR_TYPE_MASK_ALL 0x0000200
693#define VITA_DIR_TYPE_MASK_ARTISTS 0x0000004
694#define VITA_DIR_TYPE_MASK_ALBUMS 0x0000005
695#define VITA_DIR_TYPE_MASK_GENRES 0x0000006
696#define VITA_DIR_TYPE_MASK_PLAYLISTS 0x0000007
697#define VITA_DIR_TYPE_MASK_SONGS 0x0000008
698#define VITA_DIR_TYPE_MASK_MONTH 0x000000A
699
700#define VITA_TRACK_TYPE_AUDIO 0x1
701#define VITA_TRACK_TYPE_VIDEO 0x2
702#define VITA_TRACK_TYPE_PHOTO 0x3
703
709#define VITA_OPERATE_CREATE_FOLDER 1
710#define VITA_OPERATE_UNKNOWN 2
711#define VITA_OPERATE_RENAME 3
712#define VITA_OPERATE_CREATE_FILE 4
713
714#define MASK_SET(v,m) (((v) & (m)) == (m))
715
716#define VitaMTP_DEBUG 15
717#define VitaMTP_VERBOSE 7
718#define VitaMTP_INFO 3
719#define VitaMTP_ERROR 1
720#define VitaMTP_NONE 0
721#define VitaMTP_Log(mask, format, args...) \
722 do { \
723 if (MASK_SET (g_VitaMTP_logmask, mask)) { \
724 if (mask == VitaMTP_DEBUG) { \
725 fprintf(stderr, "VitaMTP %s[%d]: " format, __FUNCTION__, __LINE__, ##args); \
726 } else { \
727 fprintf(stderr, "VitaMTP: " format, ##args); \
728 } \
729 } \
730 } while (0)
731
732// TODO: Const correctness
733
737 void VitaMTP_Release_Device(vita_device_t *device);
738 int VitaMTP_Read_Event(vita_device_t *device, vita_event_t *event);
739 const char *VitaMTP_Get_Identification(vita_device_t *device);
740 enum vita_device_type VitaMTP_Get_Device_Type(vita_device_t *device);
741uint16_t VitaMTP_SendData(vita_device_t *device, uint32_t event_id, uint32_t code, unsigned char *data,
742 unsigned int len);
743uint16_t VitaMTP_SendData_Callback(vita_device_t *device, uint32_t event_id, uint32_t code, unsigned int len,
744 read_callback_t read_callback);
745uint16_t VitaMTP_GetData(vita_device_t *device, uint32_t event_id, uint32_t code, unsigned char **p_data,
746 unsigned int *p_len);
747
751 vita_device_t *VitaMTP_Open_USB_Vita(vita_raw_device_t *raw_device);
752 void VitaMTP_Release_USB_Device(vita_device_t *device);
753 int VitaMTP_Get_USB_Vitas(vita_raw_device_t **p_raw_devices);
754 void VitaMTP_Unget_USB_Vitas(vita_raw_device_t *raw_devices, int numdevs);
755 vita_device_t *VitaMTP_Get_First_USB_Vita(void);
756 int VitaMTP_USB_Init(void);
757 int VitaMTP_USB_Clear(vita_device_t *vita_device);
758 int VitaMTP_USB_Reset(vita_device_t *vita_device);
759 void VitaMTP_USB_Exit(void);
760
764 int VitaMTP_Broadcast_Host(wireless_host_info_t *info, unsigned int host_addr);
765 void VitaMTP_Stop_Broadcast(void);
766 void VitaMTP_Release_Wireless_Device(vita_device_t *device);
767 vita_device_t *VitaMTP_Get_First_Wireless_Vita(wireless_host_info_t *info, unsigned int host_addr, device_registered_callback_t is_registered,
768 register_device_callback_t create_register_pin, device_reg_complete_callback_t reg_complete);
769 int VitaMTP_Get_Device_IP(vita_device_t *device);
770 void VitaMTP_Cancel_Get_Wireless_Vita(void);
771
775 void VitaMTP_Set_Logging(int logmask);
776uint16_t VitaMTP_GetVitaInfo(vita_device_t *device, vita_info_t *info);
777uint16_t VitaMTP_SendNumOfObject(vita_device_t *device, uint32_t event_id, uint32_t num);
778uint16_t VitaMTP_GetBrowseInfo(vita_device_t *device, uint32_t event_id, browse_info_t *info);
779uint16_t VitaMTP_SendObjectMetadata(vita_device_t *device, uint32_t event_id, metadata_t *metas);
780uint16_t VitaMTP_SendObjectThumb(vita_device_t *device, uint32_t event_id, metadata_t *meta, unsigned char *thumb_data,
781 uint64_t thumb_len);
782uint16_t VitaMTP_ReportResult(vita_device_t *device, uint32_t event_id, uint16_t result);
783uint16_t VitaMTP_ReportResultWithParam(vita_device_t *device, uint32_t event_id, uint16_t result, uint32_t param);
784uint16_t VitaMTP_SendInitiatorInfo(vita_device_t *device, initiator_info_t *info);
785uint16_t VitaMTP_GetUrl(vita_device_t *device, uint32_t event_id, char **url);
786uint16_t VitaMTP_SendHttpObjectFromURL(vita_device_t *device, uint32_t event_id, void *data, unsigned int len);
787uint16_t VitaMTP_SendNPAccountInfo(vita_device_t *device, uint32_t event_id, unsigned char *data,
788 unsigned int len); // unused?
789uint16_t VitaMTP_GetSettingInfo(vita_device_t *device, uint32_t event_id, settings_info_t **p_info);
790uint16_t VitaMTP_SendObjectStatus(vita_device_t *device, uint32_t event_id, object_status_t *status);
791uint16_t VitaMTP_SendHttpObjectPropFromURL(vita_device_t *device, uint32_t event_id, http_object_prop_t *prop);
792uint16_t VitaMTP_SendHostStatus(vita_device_t *device, uint32_t status);
793uint16_t VitaMTP_SendPartOfObjectInit(vita_device_t *device, uint32_t event_id, send_part_init_t *init);
794uint16_t VitaMTP_SendPartOfObject(vita_device_t *device, uint32_t event_id, unsigned char *object_data,
795 uint64_t object_len);
796uint16_t VitaMTP_OperateObject(vita_device_t *device, uint32_t event_id, operate_object_t *op_object);
797uint16_t VitaMTP_GetPartOfObject(vita_device_t *device, uint32_t event_id, send_part_init_t *init,
798 unsigned char **data);
799uint16_t VitaMTP_SendStorageSize(vita_device_t *device, uint32_t event_id, uint64_t storage_size,
800 uint64_t available_size);
801uint16_t VitaMTP_GetTreatObject(vita_device_t *device, uint32_t event_id, treat_object_t *treat);
802uint16_t VitaMTP_SendCopyConfirmationInfoInit(vita_device_t *device, uint32_t event_id,
803 copy_confirmation_info_t **p_info);
804uint16_t VitaMTP_SendCopyConfirmationInfo(vita_device_t *device, uint32_t event_id, copy_confirmation_info_t *info,
805 uint64_t size);
806uint16_t VitaMTP_SendObjectMetadataItems(vita_device_t *device, uint32_t event_id, uint32_t *ohfi);
807uint16_t VitaMTP_CancelTask(vita_device_t *device, uint32_t cancel_event_id);
808uint16_t VitaMTP_KeepAlive(vita_device_t *device, uint32_t event_id);
809uint16_t VitaMTP_SendObject(vita_device_t *device, uint32_t *parenthandle, uint32_t *p_handle, metadata_t *p_meta,
810 unsigned char *data);
811uint16_t VitaMTP_SendObject_Callback(vita_device_t *device, uint32_t *parenthandle, uint32_t *p_handle, metadata_t *p_meta,
812 read_callback_t read_callback);
813uint16_t VitaMTP_GetObject(vita_device_t *device, uint32_t handle, metadata_t *meta, void **p_data,
814 unsigned int *p_len);
815uint16_t VitaMTP_GetObject_Callback(vita_device_t *device, uint32_t handle, uint64_t *size, write_callback_t write_callback);
816uint16_t VitaMTP_GetObject_Info(vita_device_t *device, uint32_t handle, char **name, int *dataType);
817uint16_t VitaMTP_GetObject_Folder(vita_device_t *device, uint32_t handle, uint32_t **p_handles, unsigned int *p_len);
818uint16_t VitaMTP_CheckExistance(vita_device_t *device, uint32_t handle, existance_object_t *existance);
819uint16_t VitaMTP_GetVitaCapabilityInfo(vita_device_t *device, capability_info_t **p_info);
820uint16_t VitaMTP_SendPCCapabilityInfo(vita_device_t *device, capability_info_t *info);
821 void VitaMTP_RegisterCancelEventId(uint32_t event_id);
822
826 char *VitaMTP_Data_Add_Size_Header(const char *orig, uint32_t len);
827 char *VitaMTP_Data_Make_Timestamp(time_t time);
828 int VitaMTP_Data_Info_From_XML(vita_info_t *vita_info, const char *raw_data, const int len);
829 int VitaMTP_Data_Initiator_To_XML(const initiator_info_t *p_initiator_info, char **data, int *len);
830 const initiator_info_t *VitaMTP_Data_Initiator_New(const char *host_name, int protocol_version);
831 void VitaMTP_Data_Free_Initiator(const initiator_info_t *init_info);
832 int VitaMTP_Data_Settings_From_XML(settings_info_t **p_settings_info, const char *raw_data, const int len);
833 int VitaMTP_Data_Free_Settings(settings_info_t *settings_info);
834 int VitaMTP_Data_Metadata_To_XML(const metadata_t *p_metadata, char **data, int *len);
835 int VitaMTP_Data_Capability_From_XML(capability_info_t **p_info, const char *data, int len);
836 int VitaMTP_Data_Capability_To_XML(const capability_info_t *info, char **p_data, int *p_len);
837 int VitaMTP_Data_Free_Capability(capability_info_t *info);
838 int VitaMTP_Data_Free_VitaInfo(vita_info_t *info);
839
843 int VitaMTP_Init(void);
844 void VitaMTP_Cleanup(void);
845
846#ifdef __cplusplus
847}
848#endif
849
850#endif
LIBVitaMTP_event
Definition: vitamtp.h:47
browse_info
Definition: vitamtp.h:149
capability_info::capability_info_function::capability_info_format
Definition: vitamtp.h:409
capability_info::capability_info_function::capability_info_option
Definition: vitamtp.h:415
capability_info::capability_info_function
Definition: vitamtp.h:406
capability_info
Definition: vitamtp.h:403
copy_confirmation_info
Definition: vitamtp.h:390
existance_object
Definition: vitamtp.h:376
http_object_prop
Definition: vitamtp.h:332
initiator_info
Definition: vitamtp.h:108
media_track
Definition: vitamtp.h:178
metadata
Definition: vitamtp.h:221
object_status
Definition: vitamtp.h:305
operate_object
Definition: vitamtp.h:345
send_part_init
Definition: vitamtp.h:319
settings_info::account
Definition: vitamtp.h:128
settings_info
Definition: vitamtp.h:126
treat_object
Definition: vitamtp.h:360
vita_device
Definition: device.c:37
vita_info
Definition: vitamtp.h:63
vita_raw_device
Definition: vitamtp.h:36
wireless_host_info
Definition: vitamtp.h:440
wireless_vita_info
Definition: vitamtp.h:454