From 5df642060edbf3c65693b914f327056d10fe457c Mon Sep 17 00:00:00 2001 From: "hyungjung0521.kim" Date: Wed, 5 Sep 2012 15:04:25 +0900 Subject: bluetooth: BT SIG - AVRCP - Response for invalid PDU fixed When PTS sends the invalid PDU to the IUT, due to AVRCP spec, it's supposed to response back to PTS with General Reject MSG and Error code. PTS test case : AVRCP TC_TG_INV_BI_01_C Change-Id: Ieba59503f0e3c156c639b37167d3a3a743016706 --- bta/av/bta_av_act.c | 12 +++++++++--- stack/include/avrc_defs.h | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/bta/av/bta_av_act.c b/bta/av/bta_av_act.c index 8181e57..4693a6e 100644 --- a/bta/av/bta_av_act.c +++ b/bta/av/bta_av_act.c @@ -887,9 +887,15 @@ void bta_av_rc_msg(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data) else if (!(p_cb->features & BTA_AV_FEAT_VENDOR) && p_data->rc_msg.msg.hdr.ctype <= AVRC_CMD_GEN_INQ) { - /* reject it */ - p_data->rc_msg.msg.hdr.ctype = BTA_AV_RSP_NOT_IMPL; - AVRC_VendorRsp(p_data->rc_msg.handle, p_data->rc_msg.label, &p_data->rc_msg.msg.vendor); + if(p_data->rc_msg.msg.vendor.p_vendor_data[0] == AVRC_PDU_INVALID) + { + /* reject it */ + p_data->rc_msg.msg.hdr.ctype = BTA_AV_RSP_REJ; + p_data->rc_msg.msg.vendor.p_vendor_data[4] = AVRC_STS_BAD_CMD; + } + else + p_data->rc_msg.msg.hdr.ctype = BTA_AV_RSP_NOT_IMPL; + AVRC_VendorRsp(p_data->rc_msg.handle, p_data->rc_msg.label, &p_data->rc_msg.msg.vendor); } } diff --git a/stack/include/avrc_defs.h b/stack/include/avrc_defs.h index b902bff..3f82948 100644 --- a/stack/include/avrc_defs.h +++ b/stack/include/avrc_defs.h @@ -208,7 +208,7 @@ * The len for vendor unique data is 5 */ #define AVRC_PASS_THRU_GROUP_LEN 5 - +#define AVRC_PDU_INVALID 0xff /* 6.15.3 error status code for general reject */ #define AVRC_STS_BAD_CMD 0x00 /* Invalid command, sent if TG received a PDU that it did not understand. */ #define AVRC_STS_BAD_PARAM 0x01 /* Invalid parameter, sent if the TG received a PDU with a parameter ID that it did not understand. Sent if there is only one parameter ID in the PDU. */ -- cgit v1.1