struct iso_hook {
bthost_cid_hook_func_t func;
void *user_data;
+ bthost_destroy_func_t destroy;
};
struct btconn {
free(hook);
}
+ if (conn->iso_hook && conn->iso_hook->destroy)
+ conn->iso_hook->destroy(conn->iso_hook->user_data);
+
free(conn->iso_hook);
free(conn->recv_data);
free(conn);
}
void bthost_add_iso_hook(struct bthost *bthost, uint16_t handle,
- bthost_cid_hook_func_t func, void *user_data)
+ bthost_iso_hook_func_t func, void *user_data,
+ bthost_destroy_func_t destroy)
{
struct iso_hook *hook;
struct btconn *conn;
hook->func = func;
hook->user_data = user_data;
+ hook->destroy = destroy;
conn->iso_hook = hook;
}
void *user_data);
void bthost_add_iso_hook(struct bthost *bthost, uint16_t handle,
- bthost_iso_hook_func_t func, void *user_data);
+ bthost_iso_hook_func_t func, void *user_data,
+ bthost_destroy_func_t destroy);
void bthost_send_cid(struct bthost *bthost, uint16_t handle, uint16_t cid,
const void *data, uint16_t len);
tester_print("Writing %zu bytes of data", isodata->send->iov_len);
host = hciemu_client_get_host(data->hciemu);
- bthost_add_iso_hook(host, data->handle, bthost_recv_data, data);
+ bthost_add_iso_hook(host, data->handle, bthost_recv_data, data, NULL);
ret = writev(sk, isodata->send, 1);
if (ret < 0 || isodata->send->iov_len != (size_t) ret) {