1 // Copyright 2018 Espressif Systems (Shanghai) PTE LTD
2 //
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 <string.h>
16 #include "btc_gap_bt.h"
17 #include "btc/btc_util.h"
18
19 #if (BTC_GAP_BT_INCLUDED == TRUE)
btc_gap_bt_config_eir_cmpl_callback(uint8_t status,uint8_t eir_type_num,uint8_t * eir_type)20 void btc_gap_bt_config_eir_cmpl_callback (uint8_t status, uint8_t eir_type_num, uint8_t *eir_type)
21 {
22 esp_bt_gap_cb_param_t param;
23 bt_status_t ret;
24 btc_msg_t msg;
25 msg.sig = BTC_SIG_API_CB;
26 msg.pid = BTC_PID_GAP_BT;
27 msg.act = BTC_GAP_BT_CONFIG_EIR_DATA_EVT;
28
29 param.config_eir_data.stat = btc_bta_status_to_esp_status(status);
30 param.config_eir_data.eir_type_num = eir_type_num;
31 memcpy(param.config_eir_data.eir_type, eir_type, eir_type_num);
32
33 ret = btc_transfer_context(&msg, ¶m,
34 sizeof(esp_bt_gap_cb_param_t), NULL);
35
36 if (ret != BT_STATUS_SUCCESS) {
37 BTC_TRACE_ERROR("%s btc_transfer_context failed\n", __func__);
38 }
39 }
40 #endif /// (BTC_GAP_BT_INCLUDED == TRUE)
41