/* Bonding from remote device */
address = g_malloc0(BT_ADDRESS_STRING_SIZE);
- if (address == NULL)
- return;
g_variant_get(msg, "(&o)", &object_path);
char *value = NULL;
GVariantIter *iter = NULL;
g_variant_get(val, "as", &iter);
+
+ ret_if(iter == NULL);
+
while (g_variant_iter_loop(iter, "s", &name)) {
BT_DBG("name = %s", name);
g_variant_iter_loop(iter, "s", &value);
if (FALSE == _bt_update_le_feature_support(name, value))
BT_INFO("Fail to update LE feature info");
}
- if (iter)
- g_variant_iter_free(iter);
+
+ g_variant_iter_free(iter);
} else if (strcasecmp(property, "IpspInitStateChanged") == 0) {
gboolean ipsp_initialized = FALSE;
GVariant *param = NULL;
bt_remote_dev_info_t *remote_dev_info;
g_variant_iter_init(&value_iter, msg);
+#ifdef TIZEN_FEATURE_BT_DPM
+ int desktop_state = DPM_BT_ERROR;
+#endif
while ((g_variant_iter_loop(&value_iter, "{sv}", &property, &val))) {
BT_DBG("Property %s", property);
if (strcasecmp(property, "Connected") == 0) {
BT_DBG("Name %s", remote_dev_info->name);
#ifdef TIZEN_FEATURE_BT_DPM
- if (_bt_dpm_get_bluetooth_desktop_connectivity_state() ==
- DPM_RESTRICTED) {
+ _bt_dpm_get_bluetooth_desktop_connectivity_state(&desktop_state);
+ if (desktop_state == DPM_RESTRICTED) {
bluetooth_device_class_t device_class;
_bt_divide_device_class(&device_class, remote_dev_info->class);
BT_DBG("BT_PROXIMITY_REPORTER_INTERFACE");
_bt_handle_pxp_property_changed_event(val,
object_path, BT_PXP_REPORTER_ROLE);
- } else if (strcasecmp(interface_name, BT_PROXIMITY_MONITOR_INTERFACE) == 0) {
- BT_DBG("BT_PROXIMITY_MONITOR_INTERFACE");
- _bt_handle_pxp_property_changed_event(val,
- object_path, BT_PXP_MONITOR_ROLE);
}
g_variant_unref(val);
}
gboolean connected = FALSE;
char *address;
address = g_malloc0(BT_ADDRESS_STRING_SIZE);
- ret_if(address == NULL);
_bt_convert_device_path_to_address(path, address);
g_variant_get(msg, "(b)", &connected);
}
address = g_malloc0(BT_ADDRESS_STRING_SIZE);
- ret_if(address == NULL);
_bt_convert_device_path_to_address(path, address);
ret_if(_bt_is_device_creating() == TRUE);
address = g_malloc0(BT_ADDRESS_STRING_SIZE);
- ret_if(address == NULL);
_bt_convert_device_path_to_address(path, address);
g_variant_get(msg, "(y)", &addr_type);
address = g_malloc0(BT_ADDRESS_STRING_SIZE);
- ret_if(address == NULL);
_bt_convert_device_path_to_address(path, address);
dev_name = _bt_get_bonded_device_name(address);
result = disc_reason;
address = g_malloc0(BT_ADDRESS_STRING_SIZE);
- ret_if(address == NULL);
_bt_convert_device_path_to_address(path, address);
g_variant_get(msg, "(si)", &profile_uuid, &state);
address = g_malloc0(BT_ADDRESS_STRING_SIZE);
- ret_if(address == NULL);
_bt_convert_device_path_to_address(path, address);
_bt_convert_addr_string_to_type(bd_addr.addr, address);
ret_if(_bt_is_le_scanning() == FALSE);
le_dev_info = g_malloc0(sizeof(bt_remote_le_dev_info_t));
- if (le_dev_info == NULL)
- return;
g_variant_get(msg, "(syyii@ay)", &le_dev_info->address,
&le_dev_info->addr_type,
&le_dev_info->rssi,
&le_dev_info->adv_data_len,
&value);
+
+ ret_if(value == NULL);
+
_bt_convert_device_path_to_address(path, le_dev_info->address);
buffer_len = g_variant_get_size(value);
if (le_dev_info->adv_type != BT_LE_ADV_SCAN_RSP) { /* ADV_IND */
adv_info = g_malloc0(sizeof(bt_le_adv_info_t));
- if (adv_info == NULL) {
- _bt_free_le_device_info(le_dev_info);
- g_variant_unref(value);
- return;
- }
adv_info->addr = g_strdup(le_dev_info->address);
adv_info->addr_type = le_dev_info->addr_type;
adv_info->rssi = le_dev_info->rssi;
adv_info->data_len = le_dev_info->adv_data_len;
adv_info->data = g_malloc0(le_dev_info->adv_data_len);
- if (adv_info->data) {
- memcpy(adv_info->data, le_dev_info->adv_data,
- le_dev_info->adv_data_len);
- }
if (__bt_add_adv_ind_info(adv_info) == 0) {
adv_info->timer_id = g_timeout_add(1000,
g_variant_get(value, "b", &property_flag);
address = g_malloc0(BT_ADDRESS_STRING_SIZE);
- if (address == NULL)
- return;
_bt_convert_device_path_to_address(path, address);
_bt_convert_addr_string_to_type(bd_addr.addr, address);
if (bt_event == BT_DEVICE_EVENT) {
bt_cache_info_t *cache_info;
bt_remote_dev_info_t *dev_info;
-
+#ifdef TIZEN_FEATURE_BT_DPM
+ int desktop_state = DPM_BT_ERROR;
+#endif
ret_if(_bt_is_discovering() == FALSE &&
_bt_is_le_scanning() == FALSE);
cache_info = g_malloc0(sizeof(bt_cache_info_t));
- ret_if(cache_info == NULL);
dev_info = g_malloc0(sizeof(bt_remote_dev_info_t));
- if (dev_info == NULL) {
- __bt_free_cache_info(cache_info);
- return;
- }
cache_info->dev_info = dev_info;
dev_info->name = g_strdup(dev_info->address);
#ifdef TIZEN_FEATURE_BT_DPM
- if (_bt_dpm_get_bluetooth_desktop_connectivity_state() ==
- DPM_RESTRICTED) {
+ _bt_dpm_get_bluetooth_desktop_connectivity_state(&desktop_state);
+ if (desktop_state == DPM_RESTRICTED) {
bluetooth_device_class_t device_class;
_bt_divide_device_class(&device_class, dev_info->class);
BT_DBG("[%s]device_class.major_class : %d", dev_info->name, device_class.major_class);
_bt_stop_advertising_by_terminated_process(name);
/* Stop LE Scan */
_bt_stop_le_scan(name);
+
+ /* Stop the Proximity reporter service */
+ _bt_proximity_reporter_stop_by_terminated_process(name);
+
g_free(name);
g_free(previous);
g_free(current);