1
6
7
8
9
10
11
12
13
14
15
16
17
18
26
27
28
35
36
37
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
71
72
73
74
75
77
78
79
83
84
88
89
94
95
96
97
98
99
100
101
102
103
/* ... */
#pragma once
#include "common/bt_target.h"
#include "stack/obex_api.h"
#include "stack/goep_common.h"
#include "stack/goepc_api.h"
#if (GOEPC_INCLUDED == TRUE)
enum {
GOEPC_SM_EVENT_CONNECT = 0,
GOEPC_SM_EVENT_DISCONNECT,
GOEPC_SM_EVENT_REQ,
GOEPC_SM_EVENT_REQ_FB,
GOEPC_SM_EVENT_RSP,
GOEPC_SM_EVENT_RSP_FB,
}{...};
enum {
GOEPC_STATE_INIT = 0,
GOEPC_STATE_OPENING,
GOEPC_STATE_OPENED_IDLE,
GOEPC_STATE_OPENED_REQ,
GOEPC_STATE_OPENED_RSP,
}{...};
enum {
GOEPC_SRM_STATE_IDLE = 0,
GOEPC_SRM_STATE_REQ,
GOEPC_SRM_STATE_ENABLE_WAIT,
GOEPC_SRM_STATE_ENABLE,
GOEPC_SRM_STATE_DISABLE,
}{...};
typedef struct {
tGOEPC_EVT_CBACK *callback;
UINT16 obex_handle;
UINT16 peer_mtu;
UINT16 our_mtu;
BOOLEAN congest;
BT_HDR *pkt;
BOOLEAN pkt_srm_en;
BOOLEAN pkt_srm_wait;
UINT8 curr_pkt_opcode;
UINT8 last_pkt_opcode;
BOOLEAN srm_wait;
BOOLEAN srm_peer_wait;
UINT8 srm_state;
UINT8 state;
UINT8 allocated;
}{...} tGOEPC_CCB;
typedef struct {
tGOEPC_CCB ccb[GOEPC_MAX_CONNECTION];
UINT8 trace_level;
}{...} tGOEPC_CB;
#if GOEP_DYNAMIC_MEMORY == FALSE
extern tGOEPC_CB goepc_cb;
#else
extern tGOEPC_CB *goepc_cb_ptr;
#define goepc_cb (*goepc_cb_ptr)/* ... */
#endif
typedef struct {
UINT16 peer_mtu;
UINT16 our_mtu;
}{...} tGOEPC_CONNECTED;
typedef struct {
UINT16 peer_mtu;
UINT16 our_mtu;
}{...} tGOEPC_MTU_CHG;
typedef union {
tGOEPC_CONNECTED connected;
tGOEPC_MTU_CHG mtu_chg;
BT_HDR *pkt;
}{...} tGOEPC_DATA;
tGOEPC_CCB *goepc_allocate_ccb(void);
void goepc_free_ccb(tGOEPC_CCB *p_ccb);
void goepc_obex_callback(UINT16 handle, UINT8 event, tOBEX_MSG *msg);
BOOLEAN goepc_check_obex_req_allow(UINT8 state, BOOLEAN final);
BOOLEAN goepc_check_obex_req_param(tOBEX_PARSE_INFO *info);
void goepc_sm_execute(tGOEPC_CCB *p_ccb, UINT8 event, tGOEPC_DATA *p_data);
void goepc_srm_sm_execute(tGOEPC_CCB *p_ccb, BOOLEAN is_req, BOOLEAN srm_en, BOOLEAN srm_wait);
/* ... */
#endif