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 #include "bt_task_msg.h" 16 #include "cs_adp_api.h" 17 #ifdef CFG_BLE_STACK 18 #include "csble.h" 19 #endif 20 21 #include "app_bt.h" 22 23 APP_BT_HANDLER handler_register_list[HANDLER_REG_MAX] = {0}; 24 app_bt_handler_register(enum APP_BT_HANDLER_REG_T user,APP_BT_HANDLER handler)25int app_bt_handler_register(enum APP_BT_HANDLER_REG_T user, APP_BT_HANDLER handler) 26 { 27 handler_register_list[user]= handler; 28 return 0; 29 } 30 handler_reg_list_poll(void)31void handler_reg_list_poll(void) 32 { 33 uint8_t i; 34 for (i=0; i<HANDLER_REG_MAX; i++){ 35 if (handler_register_list[i]){ 36 handler_register_list[i](); 37 } 38 } 39 } 40 41