Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1702 | - | 1 | #ifndef __PTPOBJINFOPARSER_H__ |
2 | #define __PTPOBJINFOPARSER_H__ |
||
3 | |||
4 | #include <ptp.h> |
||
5 | #include <mtpconst.h> |
||
6 | #include <ptpcallback.h> |
||
7 | |||
8 | const char msgUndefined [] PROGMEM = "Undefined"; |
||
9 | |||
10 | // Ancillary formats |
||
11 | const char msgAssociation [] PROGMEM = "Association"; |
||
12 | const char msgScript [] PROGMEM = "Script"; |
||
13 | const char msgExecutable [] PROGMEM = "Executable"; |
||
14 | const char msgText [] PROGMEM = "Text"; |
||
15 | const char msgHTML [] PROGMEM = "HTML"; |
||
16 | const char msgDPOF [] PROGMEM = "DPOF"; |
||
17 | const char msgAIFF [] PROGMEM = "AIFF"; |
||
18 | const char msgWAV [] PROGMEM = "WAV"; |
||
19 | const char msgMP3 [] PROGMEM = "MP3"; |
||
20 | const char msgAVI [] PROGMEM = "AVI"; |
||
21 | const char msgMPEG [] PROGMEM = "MPEG"; |
||
22 | const char msgASF [] PROGMEM = "ASF"; |
||
23 | const char msgQT [] PROGMEM = "QT"; |
||
24 | |||
25 | // Image formats |
||
26 | const char msgEXIF_JPEG [] PROGMEM = "EXIF_JPEG"; |
||
27 | const char msgTIFF_EP [] PROGMEM = "TIFF_EP"; |
||
28 | const char msgFlashPix [] PROGMEM = "FlashPix"; |
||
29 | const char msgBMP [] PROGMEM = "BMP"; |
||
30 | const char msgCIFF [] PROGMEM = "CIFF"; |
||
31 | const char msgUndefined_0x3806 [] PROGMEM = "Undefined_0x3806"; |
||
32 | const char msgGIF [] PROGMEM = "GIF"; |
||
33 | const char msgJFIF [] PROGMEM = "JFIF"; |
||
34 | const char msgPCD [] PROGMEM = "PCD"; |
||
35 | const char msgPICT [] PROGMEM = "PICT"; |
||
36 | const char msgPNG [] PROGMEM = "PNG"; |
||
37 | const char msgUndefined_0x380C [] PROGMEM = "Undefined_0x380C"; |
||
38 | const char msgTIFF [] PROGMEM = "TIFF"; |
||
39 | const char msgTIFF_IT [] PROGMEM = "TIFF_IT"; |
||
40 | const char msgJP2 [] PROGMEM = "JP2"; |
||
41 | const char msgJPX [] PROGMEM = "JPX"; |
||
42 | |||
43 | // MTP Object Formats |
||
44 | const char msgUndefined_Firmware [] PROGMEM = "Undefined_Firmware"; |
||
45 | const char msgWindows_Image_Format [] PROGMEM = "Windows_Image_Format"; |
||
46 | const char msgUndefined_Audio [] PROGMEM = "Undefined_Audio"; |
||
47 | const char msgWMA [] PROGMEM = "WMA"; |
||
48 | const char msgOGG [] PROGMEM = "OGG"; |
||
49 | const char msgAAC [] PROGMEM = "AAC"; |
||
50 | const char msgAudible [] PROGMEM = "Audible"; |
||
51 | const char msgFLAC [] PROGMEM = "FLAC"; |
||
52 | const char msgUndefined_Video [] PROGMEM = "Undefined_Video"; |
||
53 | const char msgWMV [] PROGMEM = "WMV"; |
||
54 | const char msgMP4_Container [] PROGMEM = "MP4_Container"; |
||
55 | const char msgMP2 [] PROGMEM = "MP2"; |
||
56 | const char msg3GP_Container [] PROGMEM = "3GP_Container"; |
||
57 | |||
58 | |||
59 | class PTPObjInfoParser : public PTPReadParser |
||
60 | { |
||
61 | static const char* acNames[]; |
||
62 | static const char* imNames[]; |
||
63 | |||
64 | MultiValueBuffer theBuffer; |
||
65 | uint32_t varBuffer; |
||
66 | uint8_t nStage; |
||
67 | |||
68 | MultiByteValueParser valueParser; |
||
69 | PTPListParser arrayParser; |
||
70 | |||
71 | static void PrintChar(MultiValueBuffer *p) |
||
72 | { |
||
73 | if (((unsigned char*)p->pValue)[0]) |
||
74 | Serial.print(((unsigned char*)p->pValue)[0]); |
||
75 | }; |
||
76 | void PrintFormat(uint16_t op); |
||
77 | |||
78 | public: |
||
79 | PTPObjInfoParser() : nStage(0) { theBuffer.pValue = (uint8_t*)&varBuffer; }; |
||
80 | virtual void Parse(const uint16_t len, const uint8_t *pbuf, const uint32_t &offset); |
||
81 | }; |
||
82 | |||
83 | #endif // __PTPOBJINFOPARSER_H__ |