* @param[in] request_id The identification of this request. It will be used to send a response.
* @param[in] server The GATT server handle
* @param[in] gatt_handle The characteristic or descriptor's GATT handle which has an old value
+ * @param[in] response_needed Indicates whether a response is required by the remote device - @c true if required, @c false if not
* @param[in] offset The requested offset from where the @a gatt_handle value will be updated
* @param[in] value The new value
* @param[in] len The length of @a value
*/
typedef void (*bt_gatt_server_write_value_requested_cb) (const char *remote_address,
int request_id, bt_gatt_server_h server,
- bt_gatt_h gatt_handle, int offset,
+ bt_gatt_h gatt_handle, bool response_needed, int offset,
const char *value, int len, void *user_data);
/**
* @param[in] request_id The identification of this request. It will be used to send a response.
* @param[in] server The GATT server handle
* @param[in] gatt_handle The characteristic or descriptor's GATT handle which has an old value
+ * @param[in] response_needed Indicates whether a response is required by the remote device - @c true if required, @c false if not
* @param[in] offset The requested offset from where the @a gatt_handle value will be updated
* @param[in] value The new value
* @param[in] len The length of @a value
*/
typedef void (*bt_gatt_server_write_value_requested_cb) (const char *remote_address,
int request_id, bt_gatt_server_h server,
- bt_gatt_h gatt_handle, int offset,
+ bt_gatt_h gatt_handle, bool response_needed, int offset,
const char *value, int len, void *user_data);
/**
* @param[in] request_id The identification of this request. It will be used to send a response.
* @param[in] server The GATT server handle
* @param[in] gatt_handle The characteristic or descriptor's GATT handle which has an old value
+ * @param[in] response_needed Indicates whether a response is required by the remote device - @c true if required, @c false if not
* @param[in] offset The requested offset from where the @a gatt_handle value will be updated
* @param[in] value The new value
* @param[in] len The length of @a value
*/
typedef void (*bt_gatt_server_write_value_requested_cb) (const char *remote_address,
int request_id, bt_gatt_server_h server,
- bt_gatt_h gatt_handle, int offset,
+ bt_gatt_h gatt_handle, bool response_needed, int offset,
const char *value, int len, void *user_data);
/**
BT_INFO("BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGE");
if (cb == NULL) {
+ if (value_change->response_needed == FALSE)
+ return;
+
bluetooth_gatt_send_response(value_change->req_id,
BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE,
BLUETOOTH_ERROR_INTERNAL, 0, NULL, 0);
}
cb(value_change->address, value_change->req_id, value_change->service_handle,
- gatt_handle, value_change->offset,
+ gatt_handle, value_change->offset, value_change->response_needed,
(char *)value_change->att_value, value_change->val_len, user_data);
break;
}
/* TODO : Fix build error temporary */
if (chr->write_value_requested_cb)
chr->write_value_requested_cb(NULL, 0, (bt_gatt_server_h)serv, (bt_gatt_h)chr,
- 0, (char*)char_val->char_value, char_val->val_len,
+ 0, TRUE, (char*)char_val->char_value, char_val->val_len,
chr->write_value_requested_user_data);
}
}
void __bt_gatt_server_write_value_requested_cb(const char *remote_address,
int request_id, bt_gatt_server_h server,
- bt_gatt_h gatt_handle, int offset,
+ bt_gatt_h gatt_handle, bool response_needed, int offset,
const char *value, int len, void *user_data)
{
int i, resp_status = BT_ERROR_NONE;
TC_PRT("remote_address : %s", remote_address);
+ TC_PRT("Response needed : %d", response_needed);
TC_PRT("offset : %d", offset);
TC_PRT("len [%d] : ", len);
for (i = 0; i < len; i++)