From 1cd86d2abbbc10c1148719e5323f92589924592f Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 8 Jun 2020 09:25:28 -0700 Subject: [PATCH] health: Fix use of L2CAP modes with bt_io bt_io modes are no longer compatible with L2CAP modes so the later shall not used with bt_io APIs. Signed-off-by: Anuj Jain Signed-off-by: Ayush Garg --- profiles/health/hdp.c | 14 +++++++------- profiles/health/mcap.c | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/profiles/health/hdp.c b/profiles/health/hdp.c index a6de97f..9fb77f7 100755 --- a/profiles/health/hdp.c +++ b/profiles/health/hdp.c @@ -542,9 +542,9 @@ static void hdp_get_dcpsm_cb(uint16_t dcpsm, gpointer user_data, GError *err) } if (hdp_chann->config == HDP_RELIABLE_DC) - mode = L2CAP_MODE_ERTM; + mode = BT_IO_MODE_ERTM; else - mode = L2CAP_MODE_STREAMING; + mode = BT_IO_MODE_STREAMING; if (mcap_connect_mdl(hdp_chann->mdl, mode, dcpsm, hdp_conn->cb, hdp_tmp_dc_data_ref(hdp_conn), @@ -913,11 +913,11 @@ static gboolean check_channel_conf(struct hdp_channel *chan) switch (chan->config) { case HDP_RELIABLE_DC: - if (mode != L2CAP_MODE_ERTM) + if (mode != BT_IO_MODE_ERTM) return FALSE; break; case HDP_STREAMING_DC: - if (mode != L2CAP_MODE_STREAMING) + if (mode != BT_IO_MODE_STREAMING) return FALSE; break; default: @@ -1056,8 +1056,8 @@ static void hdp_mcap_mdl_aborted_cb(struct mcap_mdl *mdl, void *data) static uint8_t hdp2l2cap_mode(uint8_t hdp_mode) { - return hdp_mode == HDP_STREAMING_DC ? L2CAP_MODE_STREAMING : - L2CAP_MODE_ERTM; + return hdp_mode == HDP_STREAMING_DC ? BT_IO_MODE_STREAMING : + BT_IO_MODE_ERTM; } static uint8_t hdp_mcap_mdl_conn_req_cb(struct mcap_mcl *mcl, uint8_t mdepid, @@ -1088,7 +1088,7 @@ static uint8_t hdp_mcap_mdl_conn_req_cb(struct mcap_mcl *mcl, uint8_t mdepid, } if (!mcap_set_data_chan_mode(dev->hdp_adapter->mi, - L2CAP_MODE_ERTM, &err)) { + BT_IO_MODE_ERTM, &err)) { error("Error: %s", err->message); g_error_free(err); return MCAP_MDL_BUSY; diff --git a/profiles/health/mcap.c b/profiles/health/mcap.c index b8522c2..677980a 100755 --- a/profiles/health/mcap.c +++ b/profiles/health/mcap.c @@ -1739,7 +1739,7 @@ gboolean mcap_connect_mdl(struct mcap_mdl *mdl, uint8_t mode, return FALSE; } - if ((mode != L2CAP_MODE_ERTM) && (mode != L2CAP_MODE_STREAMING)) { + if ((mode != BT_IO_MODE_ERTM) && (mode != BT_IO_MODE_STREAMING)) { g_set_error(err, MCAP_ERROR, MCAP_ERROR_INVALID_ARGS, "Invalid MDL configuration"); return FALSE; @@ -1931,7 +1931,7 @@ gboolean mcap_create_mcl(struct mcap_instance *mi, BT_IO_OPT_PSM, ccpsm, BT_IO_OPT_MTU, MCAP_CC_MTU, BT_IO_OPT_SEC_LEVEL, mi->sec, - BT_IO_OPT_MODE, L2CAP_MODE_ERTM, + BT_IO_OPT_MODE, BT_IO_MODE_ERTM, BT_IO_OPT_INVALID); if (!mcl->cc) { mcl->ctrl &= ~MCAP_CTRL_CONN; @@ -2109,7 +2109,7 @@ struct mcap_instance *mcap_create_instance(const bdaddr_t *src, BT_IO_OPT_PSM, ccpsm, BT_IO_OPT_MTU, MCAP_CC_MTU, BT_IO_OPT_SEC_LEVEL, sec, - BT_IO_OPT_MODE, L2CAP_MODE_ERTM, + BT_IO_OPT_MODE, BT_IO_MODE_ERTM, BT_IO_OPT_INVALID); if (!mi->ccio) { error("%s", (*gerr)->message); -- 2.7.4