if (data_len == 0) {
BT_ERR("No data");
- if (var)
- g_variant_unref(var);
+ g_variant_unref(var);
return;
}
g_free(info->data);
g_free(info);
}
- if (var)
- g_variant_unref(var);
+ g_variant_unref(var);
} else if (strcasecmp(signal_name, BT_TDS_ACTIVATION_RESULT) == 0) {
BT_DBG("TDS Control point Activation result");
const char *address = NULL;
_bt_common_event_cb(BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION,
BLUETOOTH_ERROR_NONE, &ind_res,
event_info->cb, event_info->user_data);
- if (byte_var)
- g_variant_unref(byte_var);
+ g_variant_unref(byte_var);
} else if (strcasecmp(signal_name, BT_TDS_CONTROL_POINT_ENABLED) == 0) {
BT_DBG("TDS Control point Enabled event");
const char *address = NULL;
* tds block in single adv pkt. So for each supported orgId, add only 1 tds blocks with
* incomplte tds flag bit set, in adv data.
*/
-static int __bt_tds_provider_get_tds_adv_data(bt_tds_provider_t *provider, guint8 *adv_data)
+static int __bt_tds_provider_get_tds_adv_data(guint8 *adv_data)
{
GSList *l;
GSList *l1;
unsigned int max_adv_len = BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX - BT_ADV_FLAG_LEN;
int transport;
- retv_if(NULL == provider, -1);
retv_if(NULL == adv_data, -1);
adv_data[1] = 0x26;
return BLUETOOTH_ERROR_NONE;
/* Get updated TDS advertising data */
- length = __bt_tds_provider_get_tds_adv_data(provider, adv.data);
+ length = __bt_tds_provider_get_tds_adv_data(adv.data);
if (0 == length)
BT_INFO("No adv data found, return");
}
* advertising will be enabled again with updated advertising data.
*/
if (_bt_is_multi_adv_supported())
- __bt_tds_disable_advertising(provider);
+ ret = __bt_tds_disable_advertising(provider);
else
- __bt_tds_disable_advertising(NULL);
+ ret = __bt_tds_disable_advertising(NULL);
if (ret != BLUETOOTH_ERROR_NONE) {
BT_ERR("Failed to enable advertising with error: %d", ret);
return ret;
int i;
retv_if(NULL == address, BLUETOOTH_ERROR_INVALID_PARAM);
- retv_if(0 > len && NULL == data, BLUETOOTH_ERROR_INVALID_PARAM);
+ retv_if(len > 0 && NULL == data, BLUETOOTH_ERROR_INVALID_PARAM);
BT_DBG("+");
conn = _bt_gdbus_get_system_gconn();
retv_if(NULL == sender, BLUETOOTH_ERROR_INVALID_PARAM);
retv_if(NULL == address, BLUETOOTH_ERROR_INVALID_PARAM);
- retv_if(0 > len && NULL == data, BLUETOOTH_ERROR_INVALID_PARAM);
+ retv_if(len > 0 && NULL == data, BLUETOOTH_ERROR_INVALID_PARAM);
BT_DBG("+");
/* Send Indication & info removed internally */
__bt_tds_send_indication_event(info, buffer, len);
-
- if (value)
- g_variant_unref(value);
+ g_variant_unref(value);
}
BT_DBG("-");
}