Diff between 46cdc5401647de197f6e9d68e803e754bdb5eb89 and e8daf2fd3fa1ccb3e51ca69a4b64337b49008d7a

Changed Files

File Additions Deletions Status
unit/test-avrcp.c +38 -0 modified

Full Patch

diff --git a/unit/test-avrcp.c b/unit/test-avrcp.c
index 4314def..a48e085 100644
--- a/unit/test-avrcp.c
+++ b/unit/test-avrcp.c
@@ -648,6 +648,26 @@ static int now_playing_content_changed(struct avrcp *session,
 	return 0;
 }
 
+static int volume_changed(struct avrcp *session, uint8_t transaction,
+					uint32_t interval, void *user_data)
+{
+	uint8_t volume = 0x00;
+
+	DBG("");
+
+	avrcp_register_notification_rsp(session, transaction, AVC_CTYPE_INTERIM,
+					AVRCP_EVENT_VOLUME_CHANGED,
+					&volume, sizeof(volume));
+
+	volume = 0x01;
+
+	avrcp_register_notification_rsp(session, transaction, AVC_CTYPE_CHANGED,
+					AVRCP_EVENT_VOLUME_CHANGED,
+					&volume, sizeof(volume));
+
+	return 0;
+}
+
 static int register_notification(struct avrcp *session, uint8_t transaction,
 					uint8_t event, uint32_t interval,
 					void *user_data)
@@ -671,6 +691,9 @@ static int register_notification(struct avrcp *session, uint8_t transaction,
 	case AVRCP_EVENT_NOW_PLAYING_CONTENT_CHANGED:
 		return now_playing_content_changed(session, transaction,
 							interval, user_data);
+	case AVRCP_EVENT_VOLUME_CHANGED:
+		return volume_changed(session, transaction,
+							interval, user_data);
 	default:
 		return -EINVAL;
 	}
@@ -2003,6 +2026,21 @@ int main(int argc, char *argv[])
 				0x00, 0x00, 0x02, 0x0d,
 				0x00));
 
+	/* NotifyVolumeChange - TG */
+	define_test("/TP/VLH/BV-04-C", test_server,
+			raw_pdu(0x00, 0x11, 0x0e, 0x03, 0x48, 0x00,
+				0x00, 0x19, 0x58, AVRCP_REGISTER_NOTIFICATION,
+				0x00, 0x00, 0x05, 0x0d,
+				0x00, 0x00, 0x00, 0x00),
+			frg_pdu(0x02, 0x11, 0x0e, AVC_CTYPE_INTERIM, 0x48, 0x00,
+				0x00, 0x19, 0x58, AVRCP_REGISTER_NOTIFICATION,
+				0x00, 0x00, 0x02, 0x0d,
+				0x00),
+			raw_pdu(0x02, 0x11, 0x0e, AVC_CTYPE_CHANGED, 0x48, 0x00,
+				0x00, 0x19, 0x58, AVRCP_REGISTER_NOTIFICATION,
+				0x00, 0x00, 0x02, 0x0d,
+				0x01));
+
 	/* Set absolute volume – TG */
 	define_test("/TP/VLH/BI-01-C", test_server,
 			raw_pdu(0x00, 0x11, 0x0e, 0x00, 0x48, 0x00,