• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Chipsea Technologies (Shenzhen) Corp., Ltd. All rights reserved.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 /***
16  * ble_task_msg.h
17  */
18 
19 #ifndef BLE_TASK_MSG_H
20 #define BLE_TASK_MSG_H
21 
22 enum APP_BLE_HANDLER_REG_T {
23     BLE_HANDLER_REG_0 = 0,
24     BLE_HANDLER_REG_1,
25     BLE_HANDLER_REG_MAX
26 };
27 
28 typedef void (*APP_BLE_HANDLER)(void);
29 
30 typedef enum _ble_only_msg {
31         BLE_DEINIT_DONE                         = 0,
32         BLE_SET_LP_LEVEL                           ,
33         BLE_TIMER_NOTIFY                           ,
34         BLE_SCAN_START                             ,
35         BLE_SCAN_STOP                              ,
36         BLE_ADV_DATA_UPDATE                        ,
37         BLE_ADV_PARAM_UPDATE                       ,
38         BLE_ADV_STOP                               ,
39         BLE_ADV_START                              ,
40         BLE_DISCONNECT                             ,
41         BLE_CON_PARAM_UPDATE                       ,
42         BLE_DELETE_BOND                            ,
43         DUT_TEST                                   ,
44         DUT_NO_SCAN                                ,
45         DUT_ISCAN                                  ,
46         DUT_PSCAN                                  ,
47         DUT_BOTH_SCAN                              ,
48 }ble_only_msg;
49 
50 typedef struct {
51     uint32_t msg_id;
52     uint32_t param;
53 } APP_BLE_ONLY_MSG;
54 
55 int app_ble_only_msg_init(void);
56 int app_ble_only_msg_deinit(void);
57 int app_ble_lp_level_msg_send(uint8_t level);
58 
59 int app_ble_only_msg_send(APP_BLE_ONLY_MSG* msg);
60 int app_ble_only_msg_send_isr(APP_BLE_ONLY_MSG* msg);
61 
62 int app_ble_handler_register(enum APP_BLE_HANDLER_REG_T user, APP_BLE_HANDLER handler);
63 void ble_handler_reg_list_poll(void);
64 
65 
66 int app_ble_enter_dut_msg_send(void);
67 int app_ble_wr_scan_en(unsigned int scan_en);
68 int app_ble_scan_msg_start(void);
69 int app_ble_scan_msg_stop(void);
70 int app_ble_adv_data_update_msg_send(void);
71 int app_ble_adv_param_update_msg_send(void);
72 int app_ble_adv_stop_msg_send(void);
73 int app_ble_adv_start_msg_send(void);
74 int app_ble_disconnect_msg_send(void);
75 int app_ble_con_param_msg_send(void);
76 int app_ble_del_bond_msg_send(void);
77 
78 #endif /* BT_TASK_MSG_H */
79 
80