}
BT_EXPORT_API int bluetooth_gatt_server_send_indication(bluetooth_device_address_t *addr_hex,
- const bluetooth_gatt_server_indication_params_t *param,
+ bluetooth_gatt_server_indication_params_t *param,
const bluetooth_gatt_att_data_t *att_value)
{
BT_CHECK_PARAMETER(param, return);
_bt_convert_addr_type_to_string(addr, addr_hex->addr);
fd = bluetooth_get_characteristic_fd(param->atrribute_handle, addr);
- if (fd > -1)
+ if (fd > -1) {
result = bluetooth_gatt_write_characteristics_value_to_fd_(fd, att_value->data, att_value->length, NULL);
- else
+ param->fd = fd;
+ } else {
result = _bt_send_request(BT_BLUEZ_SERVICE, BT_GATT_SERVER_SEND_INDICATION,
in_param1, in_param2, in_param3, in_param4, &out_param);
+ }
BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
bluetooth_device_address_t device_address; /**< device address */
gboolean need_confirmation;
int instance_id;
+ int fd; /**< handle fd if existing */
} bluetooth_gatt_server_indication_params_t;
/**
int bluetooth_gatt_server_delete_service(int service_handle, int instance_id);
int bluetooth_gatt_server_send_indication(bluetooth_device_address_t *addr_hex,
- const bluetooth_gatt_server_indication_params_t *param,
+ bluetooth_gatt_server_indication_params_t *param,
const bluetooth_gatt_att_data_t *att_value);
int bluetooth_gatt_server_send_response(const bluetooth_gatt_server_response_params_t *param,