static int bluetooth_get_characteristic_fd(int att_handle , char *address)
{
GSList *l;
+ int ret = -1;
BT_DBG("Find FD for address [%s] att_handle [ %d]", address, att_handle);
/* Check for NULL address */
if (g_strcmp0(address, "00:00:00:00:00:00") != 0) {
BT_INFO("Unicast address: Use DBUS send indication");
- return -1;
+ return ret;
}
for (l = gatt_characteristic_server_notify_list; l != NULL; l = l->next) {
return info->write_fd;
}
}
- return -2;
+ return ret;
}
static bluetooth_gatt_acquire_notify_info_t * bluetooth_get_characteristic_info_from_path(int att_handle)
fd = bluetooth_get_characteristic_fd(param->atrribute_handle, addr);
if (fd > -1) {
- BT_INFO("Send Multicast");
+ BT_INFO("Acquire Notify FD found: Send Multicast Indication over Socket");
result = bluetooth_gatt_write_characteristics_value_to_fd_(fd, att_value->data, att_value->length, NULL);
param->fd = fd;
- } else if (fd == -2) {
- BT_ERR("Acquire Notify FD not found for charatcristic handle");
- BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
- return BLUETOOTH_ERROR_INVALID_PARAM;
- } else if (fd == -1) {
+ } else {
+ BT_ERR("Acquire Notify FD not found for charatcristic handle: Send DBUS indication");
result = _bt_send_request(BT_BLUEZ_SERVICE, BT_GATT_SERVER_SEND_INDICATION,
in_param1, in_param2, in_param3, in_param4, &out_param);
}