From: Santiago Carot Nemesio <sancane@xxxxxxxxx> --- mcap/mcap.c | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/mcap/mcap.c b/mcap/mcap.c index 75d3d58..34243df 100644 --- a/mcap/mcap.c +++ b/mcap/mcap.c @@ -518,6 +518,37 @@ void mcap_req_mdl_deletion(struct mcap_mdl *mdl, GError **err, g_free(con); } +void mcap_mdl_abort(struct mcap_mdl *mdl, GError **err, + mcap_mdl_del_cb abort_cb, gpointer user_data) +{ + struct mcap_mdl_op_cb *con; + struct mcap_mcl *mcl = mdl->mcl; + uint8_t *cmd; + + if (mdl->state != MDL_WAITING) { + g_set_error(err, MCAP_ERROR, MCAP_ERROR_FAILED, + "Mdl in invalid state"); + return; + } + + con = g_new0(struct mcap_mdl_op_cb, 1); + cmd = create_req(MCAP_MD_ABORT_MDL_REQ, mdl->mdlid); + mcap_send_std_opcode(mcl, cmd, sizeof(mcap_md_req), err); + if (*err) { + g_free(con); + g_free(cmd); + return; + } + + con->mdl = mdl; + con->cb.del = abort_cb; + con->user_data = user_data; + + mcl->priv_data = con; + + mcl->tid = g_timeout_add_seconds(RESPONSE_TIMER, wait_response_timer, mcl); +} + static void update_mcl_state(struct mcap_mcl *mcl) { GSList *l; -- 1.6.3.3 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html