1
0
mirror of https://github.com/bluekitchen/btstack.git synced 2025-03-27 05:37:05 +00:00

hci: add hci_set_inquiry_mode to set inquiry mode during init

This commit is contained in:
Matthias Ringwald 2016-09-29 15:52:13 +02:00
parent e9a7c22d24
commit f6858d14c8
3 changed files with 31 additions and 1 deletions

@ -95,6 +95,15 @@ typedef enum {
AUTHENTICATED_COMBINATION_KEY_GENERATED_FROM_P256, // SSP Passkey, Number confirm, OOB
} link_key_type_t;
/**
* @brief Inquiry modes
*/
typedef enum {
INQUIRY_MODE_STANDARD = 0,
INQUIRY_MODE_RSSI,
INQUIRY_MODE_RSSI_AND_EIR,
} inquiry_mode_t;
/**
* HCI Transport
*/

@ -1082,6 +1082,10 @@ static void hci_initializing_run(void){
hci_send_cmd(&hci_write_local_name, local_name);
}
break;
case HCI_INIT_WRITE_INQUIRY_MODE:
hci_send_cmd(&hci_write_inquiry_mode, (int) hci_stack->inquiry_mode);
hci_stack->substate = HCI_INIT_W4_WRITE_INQUIRY_MODE;
break;
case HCI_INIT_WRITE_SCAN_ENABLE:
hci_send_cmd(&hci_write_scan_enable, (hci_stack->connectable << 1) | hci_stack->discoverable); // page scan
hci_stack->substate = HCI_INIT_W4_WRITE_SCAN_ENABLE;
@ -3586,6 +3590,14 @@ void gap_auto_connection_stop_all(void){
#endif
/**
* @brief Set inquiry mode: standard, with RSSI, with RSSI + Extended Inquiry Results. Has to be called before power on.
* @param inquriy_mode see bluetooth_defines.h
*/
void hci_set_inquiry_mode(inquiry_mode_t mode){
hci_stack->inquiry_mode = mode;
}
/**
* @brief Configure Voice Setting for use with SCO data in HSP/HFP
*/

@ -488,6 +488,8 @@ typedef enum hci_init_state{
HCI_INIT_W4_WRITE_CLASS_OF_DEVICE,
HCI_INIT_WRITE_LOCAL_NAME,
HCI_INIT_W4_WRITE_LOCAL_NAME,
HCI_INIT_WRITE_INQUIRY_MODE,
HCI_INIT_W4_WRITE_INQUIRY_MODE,
HCI_INIT_WRITE_SCAN_ENABLE,
HCI_INIT_W4_WRITE_SCAN_ENABLE,
@ -580,7 +582,8 @@ typedef struct {
uint8_t ssp_io_capability;
uint8_t ssp_authentication_requirement;
uint8_t ssp_auto_accept;
inquiry_mode_t inquiry_mode;
// single buffer for HCI packet assembly + additional prebuffer for H4 drivers
uint8_t * hci_packet_buffer;
uint8_t hci_packet_buffer_data[HCI_OUTGOING_PRE_BUFFER_SIZE + HCI_PACKET_BUFFER_SIZE];
@ -737,6 +740,12 @@ void hci_set_sco_voice_setting(uint16_t voice_setting);
*/
uint16_t hci_get_sco_voice_setting(void);
/**
* @brief Set inquiry mode: standard, with RSSI, with RSSI + Extended Inquiry Results. Has to be called before power on.
* @param inquriy_mode see bluetooth_defines.h
*/
void hci_set_inquiry_mode(inquiry_mode_t mode);
/**
* @brief Requests the change of BTstack power mode.
*/