summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInjun Yang <injun.yang@samsung.com>2017-02-10 10:44:44 +0900
committerDoHyun Pyun <dh79.pyun@samsung.com>2017-02-13 13:28:07 +0900
commit7ce91efd058cbaaaad42d43743023b1053089064 (patch)
tree0d334093f07c394ea377ee3903eea42ae55e739b
parent1325fac9188cff5109db8f59ab3e355fbfaf0c5c (diff)
downloadbluez-7ce91efd058cbaaaad42d43743023b1053089064.tar.gz
bluez-7ce91efd058cbaaaad42d43743023b1053089064.tar.bz2
bluez-7ce91efd058cbaaaad42d43743023b1053089064.zip
Update white list properly
[Model] SM-R360 [BinType] AP [Customer] OPEN [Issue#] N/A [Request] Internal [Occurence Version] N/A [Problem] Unable BLE auto connection with remote device [Cause & Measure] Address type is wrong of white list. Set address type properly [Checking Method] BLE auto connection with remote device [Team] Basic Connection [Developer] Injun Yang [Solution company] Samsung [Change Type] Specification change Change-Id: I6ebb875bd9b552c4183296c3f1a88b98ad3f8948 Signed-off-by: Injun Yang <injun.yang@samsung.com>
-rw-r--r--src/adapter.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/src/adapter.c b/src/adapter.c
index 5b6b1a61..a2dd1141 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -4626,7 +4626,6 @@ static DBusMessage *adapter_add_device_white_list(DBusConnection *conn,
const gchar *address;
bdaddr_t bdaddr;
dbus_uint32_t address_type;
- uint8_t addr_type;
struct btd_device *dev;
DBG("Add device whie list");
@@ -4642,15 +4641,11 @@ static DBusMessage *adapter_add_device_white_list(DBusConnection *conn,
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");
@@ -4669,7 +4664,7 @@ static DBusMessage *adapter_add_device_white_list(DBusConnection *conn,
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,
@@ -4688,7 +4683,6 @@ static DBusMessage *adapter_remove_device_white_list(DBusConnection *conn,
const gchar *address;
bdaddr_t bdaddr;
dbus_uint32_t address_type;
- uint8_t addr_type;
struct btd_device *dev;
DBG("Remove device whie list");
@@ -4705,15 +4699,11 @@ static DBusMessage *adapter_remove_device_white_list(DBusConnection *conn,
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");
@@ -4731,7 +4721,7 @@ static DBusMessage *adapter_remove_device_white_list(DBusConnection *conn,
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,