1 /** 2 \file apps/obex_io.h 3 Some useful disk-IO functions. 4 OpenOBEX test applications and sample code. 5 6 */ 7 8 #ifndef OBEX_IO_H 9 #define OBEX_IO_H 10 11 /* Application defined headers */ 12 #define HEADER_CREATOR_ID 0xcf 13 14 #define ADDRESS_BOOK 0x61646472 /* "addr" *.vcf */ 15 #define MEMO_PAD 0x6d656d6f /* "memo" *.txt */ 16 #define TO_DO_LIST 0x746f646f /* "todo" *.vcs */ 17 #define DATE_BOOK 0x64617465 /* "date" *.vcs */ 18 #define PILOT_RESOURCE 0x6c6e6368 /* "Inch" *.prc */ 19 20 int get_filesize(const char *filename); 21 obex_object_t *build_object_from_file(obex_t *handle, const char *filename, uint32_t creator_id); 22 int safe_save_file(char *name, const uint8_t *buf, int len); 23 uint8_t* easy_readfile(const char *filename, int *file_size); 24 25 /* hack to distinguish between different obex protocols */ 26 extern int obex_protocol_type; 27 #define OBEX_PROTOCOL_GENERIC 0 28 #define OBEX_PROTOCOL_WIN95_IRXFER 1 29 /* win95 irxfer ( does not like palm creatorid header ) */ 30 31 int OBEX_UnicodeToChar(uint8_t *c, const uint8_t *uc, int size); 32 int OBEX_CharToUnicode(uint8_t *uc, const uint8_t *c, int size); 33 34 #endif 35