mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-24 06:02:43 +00:00
add hci_set_sco_voice_setting
This commit is contained in:
parent
8940f8737c
commit
d950d659ec
21
src/hci.c
21
src/hci.c
@ -1793,6 +1793,9 @@ void hci_init(hci_transport_t *transport, void *config, bt_control_t *control, r
|
|||||||
hci_stack->ssp_authentication_requirement = SSP_IO_AUTHREQ_MITM_PROTECTION_NOT_REQUIRED_GENERAL_BONDING;
|
hci_stack->ssp_authentication_requirement = SSP_IO_AUTHREQ_MITM_PROTECTION_NOT_REQUIRED_GENERAL_BONDING;
|
||||||
hci_stack->ssp_auto_accept = 1;
|
hci_stack->ssp_auto_accept = 1;
|
||||||
|
|
||||||
|
// voice setting - signed 8 bit pcm data with CVSD over the air
|
||||||
|
hci_stack->sco_voice_setting = 0x40;
|
||||||
|
|
||||||
hci_state_reset();
|
hci_state_reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2307,8 +2310,7 @@ void hci_run(void){
|
|||||||
if (connection->address_type == BD_ADDR_TYPE_CLASSIC){
|
if (connection->address_type == BD_ADDR_TYPE_CLASSIC){
|
||||||
hci_send_cmd(&hci_accept_connection_request, connection->address, 1);
|
hci_send_cmd(&hci_accept_connection_request, connection->address, 1);
|
||||||
} else {
|
} else {
|
||||||
// TODO: allows to customize synchronous connection parameters
|
hci_send_cmd(&hci_accept_synchronous_connection, connection->address, 8000, 8000, 0xFFFF, hci_stack->sco_voice_setting, 0xFF, 0x003F);
|
||||||
hci_send_cmd(&hci_accept_synchronous_connection, connection->address, 8000, 8000, 0xFFFF, 0x0040, 0xFF, 0x003F);
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -3319,6 +3321,21 @@ void gap_auto_connection_stop_all(void){
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Configure Voice Setting for use with SCO data in HSP/HFP
|
||||||
|
*/
|
||||||
|
void hci_set_sco_voice_setting(uint16_t voice_setting){
|
||||||
|
hci_stack->sco_voice_setting = voice_setting;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get SCO Voice Setting
|
||||||
|
* @return current voice setting
|
||||||
|
*/
|
||||||
|
uint16_t hci_get_sco_voice_setting(){
|
||||||
|
return hci_stack->sco_voice_setting;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set callback for Bluetooth Hardware Error
|
* @brief Set callback for Bluetooth Hardware Error
|
||||||
*/
|
*/
|
||||||
|
13
src/hci.h
13
src/hci.h
@ -715,6 +715,8 @@ typedef struct {
|
|||||||
/* buffer for scan enable cmd - 0xff no change */
|
/* buffer for scan enable cmd - 0xff no change */
|
||||||
uint8_t new_scan_enable_value;
|
uint8_t new_scan_enable_value;
|
||||||
|
|
||||||
|
uint16_t sco_voice_setting;
|
||||||
|
|
||||||
// buffer for single connection decline
|
// buffer for single connection decline
|
||||||
uint8_t decline_reason;
|
uint8_t decline_reason;
|
||||||
bd_addr_t decline_addr;
|
bd_addr_t decline_addr;
|
||||||
@ -945,6 +947,17 @@ void hci_le_advertisement_address(uint8_t * addr_type, bd_addr_t addr);
|
|||||||
*/
|
*/
|
||||||
void hci_set_hardware_error_callback(void (*fn)(void));
|
void hci_set_hardware_error_callback(void (*fn)(void));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Configure Voice Setting for use with SCO data in HSP/HFP
|
||||||
|
*/
|
||||||
|
void hci_set_sco_voice_setting(uint16_t voice_setting);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get SCO Voice Setting
|
||||||
|
* @return current voice setting
|
||||||
|
*/
|
||||||
|
uint16_t hci_get_sco_voice_setting(void);
|
||||||
|
|
||||||
/* API_END */
|
/* API_END */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user