if ((seeker_s)->control_point_act_cb)
((bt_tds_control_point_activation_indication_cb)((seeker_s)->control_point_act_cb))(result,
address, info->tds_data.data, info->tds_data.length, (seeker_s)->control_point_act_user_data);
- if (seeker_s->activation_data) {
- g_free(seeker_s->activation_data);
- seeker_s->activation_data = NULL;
- }
+ g_free(seeker_s->activation_data);
+ seeker_s->activation_data = NULL;
}
}
}
if ((seeker_s)->control_point_act_cb)
((bt_tds_control_point_activation_indication_cb)((seeker_s)->control_point_act_cb))(BT_ERROR_OPERATION_FAILED,
remote_address, NULL, 0, (seeker_s)->control_point_act_user_data);
- if (seeker_s->activation_data) {
- g_free(seeker_s->activation_data);
- seeker_s->activation_data = NULL;
- }
+ g_free(seeker_s->activation_data);
+ seeker_s->activation_data = NULL;
return;
} else
BT_DBG("TDS Activation request successfully accepted by Provider, wait for Indication");
((bt_tds_control_point_activation_indication_cb)((seeker_s)->control_point_act_cb))(BT_ERROR_OPERATION_FAILED,
remote_address, NULL, 0, (seeker_s)->control_point_act_user_data);
- if (seeker_s->activation_data) {
- g_free(seeker_s->activation_data);
- seeker_s->activation_data = NULL;
- }
+ g_free(seeker_s->activation_data);
+ seeker_s->activation_data = NULL;
return;
} else {
BT_DBG("TDS Control Point enabled successfully!!");
static void __bt_tds_reset_seeker_data(bt_tds_seeker_s *seeker)
{
- if ((seeker)->tds_control_point) {
- g_free((seeker)->tds_control_point);
- (seeker)->tds_control_point = NULL;
- }
+ g_free((seeker)->tds_control_point);
+ (seeker)->tds_control_point = NULL;
- if ((seeker)->tds_control_point_cccd) {
- g_free((seeker)->tds_control_point_cccd);
- (seeker)->tds_control_point_cccd = NULL;
- }
+ g_free((seeker)->tds_control_point_cccd);
+ (seeker)->tds_control_point_cccd = NULL;
- if ((seeker)->tds_user_data_desciptor) {
- g_free((seeker)->tds_user_data_desciptor);
- (seeker)->tds_user_data_desciptor = NULL;
- }
+ g_free((seeker)->tds_user_data_desciptor);
+ (seeker)->tds_user_data_desciptor = NULL;
- if ((seeker)->tds_service_handle) {
- g_free((seeker)->tds_service_handle);
- (seeker)->tds_service_handle = NULL;
- }
+ g_free((seeker)->tds_service_handle);
+ (seeker)->tds_service_handle = NULL;
- if ((seeker)->activation_data) {
- g_free((seeker)->activation_data);
- (seeker)->activation_data = NULL;
- }
+ g_free((seeker)->activation_data);
+ (seeker)->activation_data = NULL;
/* Reset CCCD */
(seeker)->cccd_enabled = false;
bluetooth_gatt_free_desc_property(&desc_property);
goto fail;
}
- if ((seeker_s)->tds_control_point)
- g_free((seeker_s)->tds_control_point);
+ g_free((seeker_s)->tds_control_point);
(seeker_s)->tds_control_point = g_strdup(characteristic.handle);
- if ((seeker_s)->tds_control_point_cccd)
- g_free((seeker_s)->tds_control_point_cccd);
+ g_free((seeker_s)->tds_control_point_cccd);
(seeker_s)->tds_control_point_cccd = g_strdup(desc_property.handle);
BT_DBG("TDS Control point handle [%s]", (seeker_s)->tds_control_point);
if (g_strstr_len(desc_property.uuid, -1, BT_TDS_USER_DATA_DESCRIPTOR)) {
BT_DBG("User data descriptor handle discovered");
- if ((seeker_s)->tds_user_data_desciptor)
- g_free((seeker_s)->tds_user_data_desciptor);
+ g_free((seeker_s)->tds_user_data_desciptor);
(seeker_s)->tds_user_data_desciptor = g_strdup(desc_property.handle);
}
bluetooth_gatt_free_char_property(&characteristic);
} /* Next Charatceristic */
- if ((seeker_s)->tds_service_handle)
- g_free((seeker_s)->tds_service_handle);
+ g_free((seeker_s)->tds_service_handle);
(seeker_s)->tds_service_handle = g_strdup(service.handle);
bluetooth_gatt_free_service_property(&service);