const gchar *address;
bdaddr_t bdaddr;
dbus_uint32_t address_type;
- uint8_t addr_type;
struct btd_device *dev;
DBG("Add device whie list");
if (!(adapter->current_settings & MGMT_SETTING_POWERED))
return btd_error_not_ready(msg);
- if (address_type == 0)
- addr_type = BDADDR_LE_PUBLIC;
- else
- addr_type = BDADDR_LE_RANDOM;
-
- DBG("addr %s, type %d", address, addr_type);
+ DBG("addr %s, type %d", address, address_type);
str2ba(address, &bdaddr);
- dev = btd_adapter_find_device(adapter, &bdaddr, addr_type);
+ dev = btd_adapter_find_device(adapter, &bdaddr,
+ address_type ? BDADDR_LE_RANDOM : BDADDR_LE_PUBLIC);
if (dev && device_get_rpa_exist(dev) == true) {
if (adapter_le_is_supported_offloading() == FALSE) {
error("Spec based command is not supported yet");
memset(&cp, 0, sizeof(cp));
- cp.bdaddr_type = addr_type;
+ cp.bdaddr_type = address_type;
memcpy(&cp.bdaddr, &bdaddr, sizeof(bdaddr_t));
if (mgmt_send(adapter->mgmt, MGMT_OP_ADD_DEV_WHITE_LIST,
const gchar *address;
bdaddr_t bdaddr;
dbus_uint32_t address_type;
- uint8_t addr_type;
struct btd_device *dev;
DBG("Remove device whie list");
if (bachk(address) < 0)
return btd_error_invalid_args(msg);
- if (address_type == 0)
- addr_type = BDADDR_LE_PUBLIC;
- else
- addr_type = BDADDR_LE_RANDOM;
-
- DBG("addr %s, type %d", address, addr_type);
+ DBG("addr %s, type %d", address, address_type);
str2ba(address, &bdaddr);
- dev = btd_adapter_find_device(adapter, &bdaddr, addr_type);
+ dev = btd_adapter_find_device(adapter, &bdaddr,
+ address_type ? BDADDR_LE_RANDOM : BDADDR_LE_PUBLIC);
if (dev && device_get_rpa_exist(dev) == true) {
if (adapter_le_is_supported_offloading() == FALSE) {
error("Spec based command is not supported yet");
memset(&cp, 0, sizeof(cp));
- cp.bdaddr_type = addr_type;
+ cp.bdaddr_type = address_type;
memcpy(&cp.bdaddr, &bdaddr, sizeof(bdaddr_t));
if (mgmt_send(adapter->mgmt, MGMT_OP_REMOVE_DEV_FROM_WHITE_LIST,