fix(bt): Enable use of RESERVED bits in COD (GitHub PR)

This commit is contained in:
WebDust21 2024-07-31 21:40:03 -04:00 committed by chenqingqing
parent 25668990ad
commit 592e743dad
2 changed files with 3 additions and 1 deletions

View File

@ -586,6 +586,7 @@ static void btc_gap_bt_set_cod(btc_gap_bt_args_t *arg)
tBTA_UTL_COD p_cod;
esp_bt_cod_t *cod = &(arg->set_cod.cod);
p_cod.minor = cod->minor << 2;
p_cod.minor |= cod->reserved_2;
p_cod.major = cod->major;
p_cod.service = cod->service << 5;
bool ret = utl_set_device_class(&p_cod, arg->set_cod.mode);
@ -603,6 +604,7 @@ esp_err_t btc_gap_bt_get_cod(esp_bt_cod_t *cod)
return ESP_BT_STATUS_FAIL;
}
cod->minor = p_cod.minor >> 2;
cod->reserved_2 = p_cod.minor & 0x03;
cod->major = p_cod.major;
cod->service = p_cod.service >> 5;
return ESP_BT_STATUS_SUCCESS;

View File

@ -447,7 +447,7 @@ typedef void (tBTM_ADD_DEV_TO_RESOLVING_LIST_CMPL_CBACK) (UINT8 status);
/* the COD masks */
#define BTM_COD_FORMAT_TYPE_MASK 0x03
#define BTM_COD_MINOR_CLASS_MASK 0xFC
#define BTM_COD_MINOR_CLASS_MASK 0xFF
#define BTM_COD_MAJOR_CLASS_MASK 0x1F
#define BTM_COD_SERVICE_CLASS_LO_B 0x00E0
#define BTM_COD_SERVICE_CLASS_MASK 0xFFE0