OSDN Git Service

Fix a bug when responding to AVRCP UNIT_INFO and SUBUNIT_INFO
authorPavlin Radoslavov <pavlin@google.com>
Fri, 10 Jul 2015 00:57:20 +0000 (17:57 -0700)
committerAndre Eisenbach <eisenbach@google.com>
Fri, 10 Jul 2015 09:41:05 +0000 (09:41 +0000)
Assign appropriately the p_rsp_data pointer to point in the
buffer with the response.

Bug: 22307858
Change-Id: I2f77f290ff2c62c09b3be18ff047167a48c7c9d4

stack/avrc/avrc_api.c

index ab3707e..efed520 100644 (file)
@@ -598,7 +598,7 @@ static void avrc_msg_cback(UINT8 handle, UINT8 label, UINT8 cr,
             {
                 /* send the response to the peer */
                 p_rsp = avrc_copy_packet(p_pkt);
-                p_rsp_data = avrc_get_data_ptr(p_pkt);
+                p_rsp_data = avrc_get_data_ptr(p_rsp);
                 *p_rsp_data = AVRC_RSP_IMPL_STBL;
                 /* check & set the offset. set response code, set subunit_type & subunit_id,
                    set AVRC_OP_UNIT_INFO */
@@ -630,7 +630,7 @@ static void avrc_msg_cback(UINT8 handle, UINT8 label, UINT8 cr,
             {
                 /* send the response to the peer */
                 p_rsp = avrc_copy_packet(p_pkt);
-                p_rsp_data = avrc_get_data_ptr(p_pkt);
+                p_rsp_data = avrc_get_data_ptr(p_rsp);
                 *p_rsp_data = AVRC_RSP_IMPL_STBL;
                 /* check & set the offset. set response code, set (subunit_type & subunit_id),
                    set AVRC_OP_SUB_INFO, set (page & extention code) */
@@ -768,7 +768,7 @@ static void avrc_msg_cback(UINT8 handle, UINT8 label, UINT8 cr,
     {
         /* reject unsupported opcode */
         p_rsp = avrc_copy_packet(p_pkt);
-        p_rsp_data = avrc_get_data_ptr(p_pkt);
+        p_rsp_data = avrc_get_data_ptr(p_rsp);
         *p_rsp_data = AVRC_RSP_REJ;
 #if (BT_USE_TRACES == TRUE)
         p_drop_msg = "rejected";