kopia lustrzana https://github.com/espressif/esp-idf
Fixed incorrect parameters in switching to BTC context
rodzic
3268075231
commit
592675fd5b
|
@ -239,6 +239,7 @@ bt_status_t btc_transfer_context(btc_msg_t *msg, void *arg, int arg_len, btc_arg
|
|||
bt_status_t ret;
|
||||
// arg XOR arg_len
|
||||
if ((msg == NULL) || ((arg == NULL) == !(arg_len == 0))) {
|
||||
BTC_TRACE_WARNING("%s Invalid parameters\n", __func__);
|
||||
return BT_STATUS_PARM_INVALID;
|
||||
}
|
||||
|
||||
|
@ -246,6 +247,7 @@ bt_status_t btc_transfer_context(btc_msg_t *msg, void *arg, int arg_len, btc_arg
|
|||
|
||||
lmsg = (btc_msg_t *)osi_malloc(sizeof(btc_msg_t) + arg_len);
|
||||
if (lmsg == NULL) {
|
||||
BTC_TRACE_WARNING("%s No memory\n", __func__);
|
||||
return BT_STATUS_NOMEM;
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ esp_err_t esp_hf_ag_init(void)
|
|||
msg.act = BTC_HF_INIT_EVT;
|
||||
|
||||
/* Switch to BTC context */
|
||||
bt_status_t status = btc_transfer_context(&msg, NULL, sizeof(btc_hf_args_t), NULL, NULL);
|
||||
bt_status_t status = btc_transfer_context(&msg, NULL, 0, NULL, NULL);
|
||||
return (status == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@ esp_err_t esp_hf_ag_deinit(void)
|
|||
msg.act = BTC_HF_DEINIT_EVT;
|
||||
|
||||
/* Switch to BTC context */
|
||||
bt_status_t status = btc_transfer_context(&msg, NULL, sizeof(btc_hf_args_t), NULL, NULL);
|
||||
bt_status_t status = btc_transfer_context(&msg, NULL, 0, NULL, NULL);
|
||||
return (status == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue