1 #ifndef AI_IF_H_
2 #define AI_IF_H_
3 
4 /*
5  * INCLUDE FILES
6  ****************************************************************************************
7  */
8 
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 //the ai type now use
15 typedef enum {
16     AI_SPEC_INIT,
17     AI_SPEC_GSOUND,
18     AI_SPEC_AMA,
19     AI_SPEC_BES,
20     AI_SPEC_BAIDU,
21     AI_SPEC_TENCENT,
22     AI_SPEC_ALI,
23     AI_SPEC_COUNT,
24 } AI_SPEC_TYPE_E;
25 
26 typedef struct{
27     uint8_t connPathType;
28     uint8_t connPathState;
29     uint8_t connBtState;
30     uint8_t connBdAddr[6];
31 }AI_CONNECTION_STATE_T;
32 
33 const char *ai_spec_type2str(AI_SPEC_TYPE_E ai_spec);
34 
35 /*---------------------------------------------------------------------------
36  *            ai_if_tws_role_switch_prepare
37  *---------------------------------------------------------------------------
38  *
39  *Synopsis:
40  *    AI interface controlled tws role switch API
41  *
42  * Parameters:
43  *    wait_ms - time delay before role switch started for AI module
44  *
45  * Return:
46  *    true - need delay
47  *    false - not need delay
48  */
49 uint32_t ai_if_tws_role_switch_prepare(uint32_t *wait_ms);
50 
51 /*---------------------------------------------------------------------------
52  *            ai_if_slave_reuqest_master_do_roleswitch
53  *---------------------------------------------------------------------------
54  *
55  *Synopsis:
56  *    slave request master to role switch API for AI module
57  *
58  * Parameters:
59  *    void
60  *
61  * Return:
62  *    void
63  */
64 void ai_if_slave_reuqest_master_do_roleswitch(void);
65 
66 /*---------------------------------------------------------------------------
67  *            ai_if_master_role_switch_prepare
68  *---------------------------------------------------------------------------
69  *
70  *Synopsis:
71  *    master role switch API for AI module
72  *
73  * Parameters:
74  *    void
75  *
76  * Return:
77  *    void
78  */
79 void ai_if_master_role_switch_prepare(void);
80 
81 /*---------------------------------------------------------------------------
82  *            ai_if_role_switch_prepare_done
83  *---------------------------------------------------------------------------
84  *
85  *Synopsis:
86  *    master role switch prepare done, slave receive a masegge from master
87  *
88  * Parameters:
89  *    void
90  *
91  * Return:
92  *    void
93  */
94 void ai_if_role_switch_prepare_done(void);
95 
96 /*---------------------------------------------------------------------------
97  *            ai_if_tws_role_switch
98  *---------------------------------------------------------------------------
99  *
100  *Synopsis:
101  *    role switch API for AI module
102  *
103  * Parameters:
104  *    void
105  *
106  * Return:
107  *    void
108  */
109 void ai_if_tws_role_swtich(void);
110 
111 /*---------------------------------------------------------------------------
112  *            ai_if_tws_sync_init
113  *---------------------------------------------------------------------------
114  *
115  *Synopsis:
116  *    tws related environment initialization for AI interface
117  *
118  * Parameters:
119  *    void
120  *
121  * Return:
122  *    void
123  */
124 void ai_if_tws_sync_init(void);
125 
126 /*---------------------------------------------------------------------------
127  *            app_ai_key_event_handle
128  *---------------------------------------------------------------------------
129  *
130  *Synopsis:
131  *    for AI handle key event
132  *
133  * Parameters:
134  *    void *param1
135  *    uint32_t param2
136  *
137  * Return:
138  *    void
139  */
140 void app_ai_key_event_handle(void *param1, uint32_t param2);
141 
142 
143 void ai_if_send_cmd_to_peer(uint8_t *p_buff, uint16_t length);
144 void ai_if_rev_peer_cmd_hanlder(uint16_t rsp_seq, uint8_t *p_buff, uint16_t length);
145 bool ai_if_is_ai_stream_mic_open(void);
146 
147 #ifdef __cplusplus
148     }
149 #endif
150 
151 
152 #endif //AI_IF_H_
153 
154