Fix the parameters in duplicate exception list vsc command

This commit is contained in:
Rahul Tank
2024-02-20 12:22:49 +05:30
committed by Abhinav Kudnar
parent c5f9a60972
commit 611511d3b6
2 changed files with 62 additions and 2 deletions
+22 -1
View File
@@ -11,6 +11,11 @@
extern "C" {
#endif
#define BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_ADV_ADDR 0
#define BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_LINK_ID 1
#define BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_BEACON_TYPE 2
#define BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_PROV_SRV_ADV 3
#define BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_PROXY_SRV_ADV 4
/**
* Configure LE Data Length in controller (OGF = 0x08, OCF = 0x0022).
@@ -86,8 +91,8 @@ int ble_gap_wl_tx_clear(void);
*/
int ble_gap_wl_read_size(uint8_t *size);
#if MYNEWT_VAL(BLE_POWER_CONTROL)
#if MYNEWT_VAL(BLE_HCI_VS)
#if MYNEWT_VAL(BLE_POWER_CONTROL)
#define ESP_1M_LOW (-70)
#define ESP_1M_HIGH (-60)
@@ -160,6 +165,22 @@ struct ble_gap_set_auto_pcl_params {
*/
int ble_gap_set_auto_pcl_param(struct ble_gap_set_auto_pcl_params *params);
#endif
/**
* This API is used to send the Duplicate Exception list VSC to controller
*
* @param subcode The operation to be done (add/remove/clean)
*
* @param type Exception list type
*
* @param value Device address
*
* @cb Registered callback
*
* @return 0 on success; nonzero on failure.
*/
int ble_gap_duplicate_exception_list(uint8_t subcode, uint8_t type, uint8_t *value, void *cb);
#endif
#ifdef __cplusplus
+40 -1
View File
@@ -7374,7 +7374,8 @@ ble_gap_set_transmit_power_reporting_enable(uint16_t conn_handle,
#endif
}
#if MYNEWT_VAL(BLE_POWER_CONTROL) && MYNEWT_VAL(BLE_HCI_VS)
#if MYNEWT_VAL(BLE_HCI_VS)
#if MYNEWT_VAL(BLE_POWER_CONTROL)
static int
ble_gap_pcl_param_validate(struct ble_gap_set_auto_pcl_params *params)
{
@@ -7443,6 +7444,44 @@ ble_gap_set_auto_pcl_param(struct ble_gap_set_auto_pcl_params *params)
}
#endif
int
ble_gap_duplicate_exception_list(uint8_t subcode, uint8_t type, uint8_t *value, void *cb)
{
uint8_t device_info_array[1 + 4 + BLE_DEV_ADDR_LEN] = {0};
device_info_array[0] = subcode;
device_info_array[1] = type & 0xff;
device_info_array[2] = (type >> 8) & 0xff;
device_info_array[3] = (type >> 16) & 0xff;
device_info_array[4] = (type >> 24) & 0xff;
switch (type)
{
case BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_ADV_ADDR:
swap_in_place(value, BLE_DEV_ADDR_LEN);
memcpy(&device_info_array[5], value, BLE_DEV_ADDR_LEN);
break;
case BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_LINK_ID:
memcpy(&device_info_array[5], value, 4);
break;
case BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_BEACON_TYPE:
//do nothing
break;
case BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_PROV_SRV_ADV:
//do nothing
break;
case BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_PROXY_SRV_ADV:
//do nothing
break;
default:
//do nothing
break;
}
return ble_hs_hci_send_vs_cmd(BLE_HCI_OCF_VS_DUPLICATE_EXCEPTION_LIST,
&device_info_array, sizeof(device_info_array), NULL, 0);
}
#endif
int
ble_gap_set_data_related_addr_change_param(uint8_t adv_handle, uint8_t change_reason)
{