From d9907d09f462943141b7b8bb2e97156e678ae3a8 Mon Sep 17 00:00:00 2001 From: Chris Manton Date: Mon, 7 Sep 2020 09:53:56 -0700 Subject: [PATCH] Move tBTM_INQUIRY_VAR_ST stack/btm:: Structure is not part of security record From: stack/btm/security_device_record.h Into: stack/btm/btm_int_types.h Towards readable code Bug: 163134718 Tag: #refactor Test: compile & verify basic functions working Change-Id: I6a72bcaeb25793a147f6ac131d653c5a96ad02fa --- stack/btm/btm_int_types.h | 48 ++++++++++++++++++++++++++++++++++++++ stack/btm/security_device_record.h | 48 -------------------------------------- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/stack/btm/btm_int_types.h b/stack/btm/btm_int_types.h index 32e689be0..9efa180a5 100644 --- a/stack/btm/btm_int_types.h +++ b/stack/btm/btm_int_types.h @@ -120,6 +120,54 @@ typedef void(tBTM_BT_QUALITY_REPORT_RECEIVER)(uint8_t len, uint8_t* p_stream); /* Define a structure to hold all the BTM data */ +typedef struct { + tBTM_CMPL_CB* p_remname_cmpl_cb; + +#define BTM_EXT_RMT_NAME_TIMEOUT_MS (40 * 1000) /* 40 seconds */ + + alarm_t* remote_name_timer; + + uint16_t discoverable_mode; + uint16_t connectable_mode; + uint16_t page_scan_window; + uint16_t page_scan_period; + uint16_t inq_scan_window; + uint16_t inq_scan_period; + uint16_t inq_scan_type; + uint16_t page_scan_type; /* current page scan type */ + + RawAddress remname_bda; /* Name of bd addr for active remote name request */ +#define BTM_RMT_NAME_EXT 0x1 /* Initiated through API */ + bool remname_active; /* State of a remote name request by external API */ + + tBTM_CMPL_CB* p_inq_cmpl_cb; + tBTM_INQ_RESULTS_CB* p_inq_results_cb; + uint32_t inq_counter; /* Counter incremented each time an inquiry completes */ + /* Used for determining whether or not duplicate devices */ + /* have responded to the same inquiry */ + tINQ_BDADDR* p_bd_db; /* Pointer to memory that holds bdaddrs */ + uint16_t num_bd_entries; /* Number of entries in database */ + uint16_t max_bd_entries; /* Maximum number of entries that can be stored */ + tINQ_DB_ENT inq_db[BTM_INQ_DB_SIZE]; + tBTM_INQ_PARMS inqparms; /* Contains the parameters for the current inquiry */ + tBTM_INQUIRY_CMPL + inq_cmpl_info; /* Status and number of responses from the last inquiry */ + + uint16_t per_min_delay; /* Current periodic minimum delay */ + uint16_t per_max_delay; /* Current periodic maximum delay */ + /* inquiry that has been cancelled*/ + uint8_t inqfilt_type; /* Contains the inquiry filter type (BD ADDR, COD, or + Clear) */ + +#define BTM_INQ_INACTIVE_STATE 0 +#define BTM_INQ_ACTIVE_STATE \ + 3 /* Actual inquiry or periodic inquiry is in progress */ + + uint8_t state; /* Current state that the inquiry process is in */ + uint8_t inq_active; /* Bit Mask indicating type of inquiry is active */ + bool no_inc_ssp; /* true, to stop inquiry on incoming SSP */ +} tBTM_INQUIRY_VAR_ST; + #define BTM_STATE_BUFFER_SIZE 5 /* size of state buffer */ typedef struct { diff --git a/stack/btm/security_device_record.h b/stack/btm/security_device_record.h index a069f8431..fa19fb35d 100644 --- a/stack/btm/security_device_record.h +++ b/stack/btm/security_device_record.h @@ -145,54 +145,6 @@ typedef struct { enum { INQ_NONE, INQ_GENERAL }; typedef uint8_t tBTM_INQ_TYPE; -typedef struct { - tBTM_CMPL_CB* p_remname_cmpl_cb; - -#define BTM_EXT_RMT_NAME_TIMEOUT_MS (40 * 1000) /* 40 seconds */ - - alarm_t* remote_name_timer; - - uint16_t discoverable_mode; - uint16_t connectable_mode; - uint16_t page_scan_window; - uint16_t page_scan_period; - uint16_t inq_scan_window; - uint16_t inq_scan_period; - uint16_t inq_scan_type; - uint16_t page_scan_type; /* current page scan type */ - - RawAddress remname_bda; /* Name of bd addr for active remote name request */ -#define BTM_RMT_NAME_EXT 0x1 /* Initiated through API */ - bool remname_active; /* State of a remote name request by external API */ - - tBTM_CMPL_CB* p_inq_cmpl_cb; - tBTM_INQ_RESULTS_CB* p_inq_results_cb; - uint32_t inq_counter; /* Counter incremented each time an inquiry completes */ - /* Used for determining whether or not duplicate devices */ - /* have responded to the same inquiry */ - tINQ_BDADDR* p_bd_db; /* Pointer to memory that holds bdaddrs */ - uint16_t num_bd_entries; /* Number of entries in database */ - uint16_t max_bd_entries; /* Maximum number of entries that can be stored */ - tINQ_DB_ENT inq_db[BTM_INQ_DB_SIZE]; - tBTM_INQ_PARMS inqparms; /* Contains the parameters for the current inquiry */ - tBTM_INQUIRY_CMPL - inq_cmpl_info; /* Status and number of responses from the last inquiry */ - - uint16_t per_min_delay; /* Current periodic minimum delay */ - uint16_t per_max_delay; /* Current periodic maximum delay */ - /* inquiry that has been cancelled*/ - uint8_t inqfilt_type; /* Contains the inquiry filter type (BD ADDR, COD, or - Clear) */ - -#define BTM_INQ_INACTIVE_STATE 0 -#define BTM_INQ_ACTIVE_STATE \ - 3 /* Actual inquiry or periodic inquiry is in progress */ - - uint8_t state; /* Current state that the inquiry process is in */ - uint8_t inq_active; /* Bit Mask indicating type of inquiry is active */ - bool no_inc_ssp; /* true, to stop inquiry on incoming SSP */ -} tBTM_INQUIRY_VAR_ST; - /* The MSB of the clock offset field indicates whether the offset is valid. */ #define BTM_CLOCK_OFFSET_VALID 0x8000 -- 2.11.0