Skip to content

Commit

Permalink
Bluetooth: AVDTP: Add AVDTP_Timer & Handler
Browse files Browse the repository at this point in the history
Added AVDTP_TIMER = 6secs for tracking sent
Singalling Request.
Timeout handler function added.

Change-Id: I76ddcdcfba2b5e9317f66f9815e0d9d3f4cc87e7
Signed-off-by: Arun Jagadish <[email protected]>
  • Loading branch information
arunjagadish authored and Johan Hedberg committed Dec 24, 2016
1 parent 129a844 commit 71fdc90
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion subsys/bluetooth/host/avdtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,36 @@ static struct bt_avdtp_seid_lsep *lseps;

#define AVDTP_CHAN(_ch) CONTAINER_OF(_ch, struct bt_avdtp, br_chan.chan)

#define AVDTP_KWORK(_work) CONTAINER_OF(_work, struct bt_avdtp,\
req.timeout_work)

#define AVDTP_TIMEOUT K_SECONDS(6)

/* Timeout handler */
static void avdtp_timeout(struct k_work *work)
{
BT_DBG("Failed Signal_id = %d", (AVDTP_KWORK(work))->req.signal_id);

/* Gracefully Disconnect the Signalling and streaming L2cap chann*/

}

/* L2CAP Interface callbacks */
void bt_avdtp_l2cap_connected(struct bt_l2cap_chan *chan)
{
struct bt_avdtp *session;

if (!chan) {
BT_ERR("Invalid AVDTP chan");
return;
}

BT_DBG("chan %p session %p", chan, AVDTP_CHAN(chan));
session = AVDTP_CHAN(chan);
BT_DBG("chan %p session %p", chan, session);

/* Init the timer */
k_delayed_work_init(&session->req.timeout_work, avdtp_timeout);

}

void bt_avdtp_l2cap_disconnected(struct bt_l2cap_chan *chan)
Expand Down

0 comments on commit 71fdc90

Please sign in to comment.