mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
Merge branch 'feature/esp32c2_add_hci_buf_get_checking' into 'release/v5.0'
Feature/esp32c2 add hci buf get checking See merge request espressif/esp-idf!22692
This commit is contained in:
commit
16b2071a4d
@ -321,7 +321,7 @@ void esp_vhci_host_send_packet(uint8_t *data, uint16_t len)
|
||||
if (*(data) == DATA_TYPE_ACL) {
|
||||
struct os_mbuf *om = os_msys_get_pkthdr(len, ACL_DATA_MBUF_LEADINGSPCAE);
|
||||
assert(om);
|
||||
os_mbuf_append(om, &data[1], len - 1);
|
||||
assert(os_mbuf_append(om, &data[1], len - 1) == 0);
|
||||
ble_hci_trans_hs_acl_tx(om);
|
||||
}
|
||||
|
||||
|
@ -325,7 +325,7 @@ void esp_vhci_host_send_packet(uint8_t *data, uint16_t len)
|
||||
if (*(data) == DATA_TYPE_ACL) {
|
||||
struct os_mbuf *om = os_msys_get_pkthdr(len, ACL_DATA_MBUF_LEADINGSPCAE);
|
||||
assert(om);
|
||||
os_mbuf_append(om, &data[1], len - 1);
|
||||
assert(os_mbuf_append(om, &data[1], len - 1) == 0);
|
||||
ble_hci_trans_hs_acl_tx(om);
|
||||
}
|
||||
|
||||
|
@ -84,6 +84,16 @@ void hci_uart_start_tx(int port_num);
|
||||
*/
|
||||
void hci_uart_start_rx(int port_num);
|
||||
|
||||
/**
|
||||
* @brief reconfig hci uart pin
|
||||
*
|
||||
* @param tx_pin The Tx pin
|
||||
* @param rx_pin The Rx pin
|
||||
* @param cts_pin The CTS pin
|
||||
* @param rts_pin The RTS pin
|
||||
* @return int 0 on success, non-zero error code on failure
|
||||
*/
|
||||
int hci_uart_reconfig_pin(int tx_pin, int rx_pin, int cts_pin, int rts_pin);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -191,4 +191,17 @@ int hci_uart_close(int port_num)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int hci_uart_reconfig_pin(int tx_pin, int rx_pin, int cts_pin, int rts_pin)
|
||||
{
|
||||
int port_num = hci_uart.port;
|
||||
int32_t baud_rate = hci_uart.cfg.baud_rate;
|
||||
uint8_t data_bits = hci_uart.cfg.data_bits;
|
||||
uint8_t stop_bits = hci_uart.cfg.stop_bits;
|
||||
uart_parity_t parity = hci_uart.cfg.parity;
|
||||
uart_hw_flowcontrol_t flow_ctl = hci_uart.cfg.flow_ctrl;
|
||||
hci_uart_close(port_num);
|
||||
hci_uart_config(port_num, baud_rate, data_bits, stop_bits, parity, flow_ctl);
|
||||
ESP_ERROR_CHECK(uart_set_pin(port_num, tx_pin, rx_pin, rts_pin, cts_pin));
|
||||
return 0;
|
||||
}
|
||||
#endif //CONFIG_BT_LE_HCI_INTERFACE_USE_UART
|
||||
|
Loading…
x
Reference in New Issue
Block a user