mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-06-05 21:04:49 +00:00
fix(nimble): Fixed incorrect parameter updation in duplication ext list
This commit is contained in:
@@ -24,6 +24,10 @@ enum gap_status {
|
||||
|
||||
typedef enum gap_status gap_status_t;
|
||||
|
||||
#define BLE_DUPLICATE_SCAN_EXCEPTIONAL_LIST_SUBCODE_ADD 0
|
||||
#define BLE_DUPLICATE_SCAN_EXCEPTIONAL_LIST_SUBCODE_REMOVE 1
|
||||
#define BLE_DUPLICATE_SCAN_EXCEPTIONAL_LIST_SUBCODE_CLEAN 2
|
||||
|
||||
#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
|
||||
@@ -246,7 +250,7 @@ int ble_gap_set_auto_pcl_param(struct ble_gap_set_auto_pcl_params *params);
|
||||
*
|
||||
* @return 0 on success; nonzero on failure.
|
||||
*/
|
||||
int ble_gap_duplicate_exception_list(uint8_t subcode, uint8_t type, uint8_t *value, void *cb);
|
||||
int ble_gap_duplicate_exception_list(uint8_t subcode, uint32_t type, uint8_t *value, void *cb);
|
||||
|
||||
/**
|
||||
* This API is used to clean up residue memory in controller for legacy advertisement
|
||||
|
||||
@@ -10766,10 +10766,14 @@ 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)
|
||||
ble_gap_duplicate_exception_list(uint8_t subcode, uint32_t type, uint8_t *value, void *cb)
|
||||
{
|
||||
uint8_t device_info_array[1 + 4 + BLE_DEV_ADDR_LEN] = {0};
|
||||
|
||||
if (!value) {
|
||||
return BLE_HS_EINVAL;
|
||||
}
|
||||
|
||||
device_info_array[0] = subcode;
|
||||
device_info_array[1] = type & 0xff;
|
||||
device_info_array[2] = (type >> 8) & 0xff;
|
||||
@@ -10778,8 +10782,7 @@ ble_gap_duplicate_exception_list(uint8_t subcode, uint8_t type, uint8_t *value,
|
||||
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);
|
||||
swap_buf(&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);
|
||||
|
||||
Reference in New Issue
Block a user