38#ifndef BTA_FS_CO_MAX_SSN_ENTRIES
39#define BTA_FS_CO_MAX_SSN_ENTRIES 10
43#ifndef BTA_FS_CO_PATH_LEN
44#define BTA_FS_CO_PATH_LEN 294
47#ifndef BTA_FS_CO_TEST_ROOT
48#define BTA_FS_CO_TEST_ROOT "test_files"
51#define BTA_FS_CO_TEST_TYPE_NONE 0
52#define BTA_FS_CO_TEST_TYPE_REJECT 1
53#define BTA_FS_CO_TEST_TYPE_SUSPEND 2
55#ifndef BTA_FS_CO_TEST_AB_END
56#define BTA_FS_CO_TEST_AB_END BTA_FS_CO_TEST_TYPE_NONE
64#define BTA_FS_CO_OK GOEP_OK
65#define BTA_FS_CO_FAIL GOEP_FAIL
66#define BTA_FS_CO_EACCES GOEP_EACCES
67#define BTA_FS_CO_ENOTEMPTY GOEP_ENOTEMPTY
68#define BTA_FS_CO_EOF GOEP_EOF
69#define BTA_FS_CO_EODIR GOEP_EODIR
70#define BTA_FS_CO_ENOSPACE GOEP_ENOSPACE
71#define BTA_FS_CO_EIS_DIR GOEP_EIS_DIR
72#define BTA_FS_CO_RESUME GOEP_RESUME
73#define BTA_FS_CO_NONE GOEP_NONE
75typedef UINT16 tBTA_FS_CO_STATUS;
78#define BTA_FS_PERM_USER 0
79#define BTA_FS_PERM_GROUP 1
80#define BTA_FS_PERM_OTHER 2
82#define BTA_FS_PERM_SIZE 3
88#define BTA_FS_O_RDONLY GOEP_O_RDONLY
89#define BTA_FS_O_WRONLY GOEP_O_WRONLY
90#define BTA_FS_O_RDWR GOEP_O_RDWR
92#define BTA_FS_O_CREAT GOEP_O_CREAT
93#define BTA_FS_O_EXCL GOEP_O_EXCL
94#define BTA_FS_O_TRUNC GOEP_O_TRUNC
96#define BTA_FS_O_MODE_MASK(x) (((UINT16)(x)) & 0x0003)
99#define BTA_FS_SEEK_SET GOEP_SEEK_SET
100#define BTA_FS_SEEK_CUR GOEP_SEEK_CUR
101#define BTA_FS_SEEK_END GOEP_SEEK_END
104#define BTA_FS_ACC_EXIST GOEP_ACC_EXIST
105#define BTA_FS_ACC_READ GOEP_ACC_READ
106#define BTA_FS_ACC_RDWR GOEP_ACC_RDWR
108#define BTA_FS_LEN_UNKNOWN GOEP_LEN_UNKNOWN
109#define BTA_FS_INVALID_FD GOEP_INVALID_FD
110#define BTA_FS_INVALID_APP_ID (0xFF)
113#define BTA_FS_A_RDONLY GOEP_A_RDONLY
114#define BTA_FS_A_DIR GOEP_A_DIR
116#define BTA_FS_CTIME_LEN GOEP_CTIME_LEN
123 char crtime[BTA_FS_CTIME_LEN];
131 BTA_FS_CO_SESS_ST_NONE,
132 BTA_FS_CO_SESS_ST_ACTIVE,
133 BTA_FS_CO_SESS_ST_SUSPEND,
134 BTA_FS_CO_SESS_ST_RESUMING
136typedef UINT8 tBTA_FS_CO_SESS_ST;
143 char path[BTA_FS_CO_PATH_LEN + 1];
144 char file[BTA_FS_CO_PATH_LEN + 1];
147 UINT8 sess_info[OBX_SESSION_INFO_SIZE];
155 tBTA_FS_CO_SESS_ST sess_st;
177BTA_API
extern void bta_fs_co_init(
void);
202BTA_API
extern void bta_fs_co_open(
const char *p_path,
int oflags, UINT32 size,
203 UINT16 evt, UINT8 app_id);
221BTA_API
extern void bta_fs_co_session_info(BD_ADDR bd_addr, UINT8 *p_sess_info, UINT8 ssn,
222 tBTA_FS_CO_SESS_ST new_st,
char *p_path, UINT8 *p_info, UINT8 app_id);
240BTA_API
extern void bta_fs_co_resume_op(UINT32 offset, UINT16 evt, UINT8 app_id);
260BTA_API
extern void bta_fs_co_suspend(BD_ADDR bd_addr, UINT8 *p_sess_info, UINT8 ssn,
261 UINT32 *p_timeout, UINT32 *p_offset, UINT8 info, UINT8 app_id);
282BTA_API
extern void bta_fs_co_resume(UINT16 evt, UINT8 app_id);
301BTA_API
extern void bta_fs_co_sess_ssn(
int fd, UINT8 ssn, UINT8 app_id);
318BTA_API
extern void bta_fs_co_setdir(
const char *p_path, UINT8 app_id);
337BTA_API
extern tBTA_FS_CO_STATUS bta_fs_co_close(
int fd, UINT8 app_id);
366BTA_API
extern void bta_fs_co_read(
int fd, UINT8 *p_buf, UINT16 nbytes, UINT16 evt,
367 UINT8 ssn, UINT8 app_id);
394BTA_API
extern void bta_fs_co_write(
int fd,
const UINT8 *p_buf, UINT16 nbytes, UINT16 evt,
395 UINT8 ssn, UINT8 app_id);
413BTA_API
extern void bta_fs_co_seek (
int fd, INT32 offset, INT16 origin, UINT8 app_id);
435BTA_API
extern tBTA_FS_CO_STATUS bta_fs_co_access(
const char *p_path,
int mode,
436 BOOLEAN *p_is_dir, UINT8 app_id);
456BTA_API
extern tBTA_FS_CO_STATUS bta_fs_co_mkdir(
const char *p_path, UINT8 app_id);
477BTA_API
extern tBTA_FS_CO_STATUS bta_fs_co_rmdir(
const char *p_path, UINT8 app_id);
497BTA_API
extern tBTA_FS_CO_STATUS bta_fs_co_unlink(
const char *p_path, UINT8 app_id);
526BTA_API
extern void bta_fs_co_getdirentry(
const char *p_path, BOOLEAN first_item,
553BTA_API
extern void bta_fs_co_copy(
const char *p_src_path,
const char *p_dest_path, UINT8 *p_perms, UINT16 evt, UINT8 app_id);
576BTA_API
extern void bta_fs_co_rename(
const char *p_src_path,
const char *p_dest_path, UINT8 *p_perms, UINT16 evt, UINT8 app_id);
598BTA_API
extern void bta_fs_co_set_perms(
const char *p_src_path, UINT8 *p_perms, UINT16 evt, UINT8 app_id);
616BTA_API
extern void bta_fs_co_sess_fopen(
const char *p_path,
int oflags, UINT8 app_id);
631BTA_API
extern void bta_fs_co_sess_fclose(UINT8 app_id);
644BTA_API
extern void bta_fs_co_sess_offset(UINT8 ssn, INT32 pos, UINT16 nbytes, UINT8 app_id);
656BTA_API
extern UINT8 *bta_fs_co_suspended_addr(UINT8 app_id);
668BTA_API
extern UINT8 bta_fs_co_num_suspended_session(UINT8 app_id);
701BTA_API
extern int bta_fs_convert_bta_oflags(
int bta_oflags);