diff --git a/unit/test-avrcp.c b/unit/test-avrcp.c
index b26c553..4314def 100644
--- a/unit/test-avrcp.c
+++ b/unit/test-avrcp.c
context_quit(context);
}
+static bool register_notification_rsp(struct avrcp *session, int err,
+ uint8_t code, uint8_t event,
+ uint8_t *params, void *user_data)
+{
+ struct context *context = user_data;
+
+ DBG("");
+
+ g_assert_cmpint(err, ==, 0);
+
+ switch (event) {
+ case AVRCP_EVENT_VOLUME_CHANGED:
+ g_assert_cmpint(params[0], ==, 0);
+ break;
+ }
+
+ context_quit(context);
+
+ return false;
+}
+
static const struct avrcp_control_cfm control_cfm = {
+ .register_notification = register_notification_rsp,
.get_folder_items = get_folder_items_rsp,
};
if (g_str_equal(context->data->test_name, "/TP/VLH/BV-01-C"))
avrcp_set_volume(context->session, 0x00);
+ if (g_str_equal(context->data->test_name, "/TP/VLH/BV-03-C"))
+ avrcp_register_notification(context->session,
+ AVRCP_EVENT_VOLUME_CHANGED, 0);
+
execute_context(context);
}
0x00, 0x19, 0x58, AVRCP_SET_ABSOLUTE_VOLUME,
0x00, 0x00, 0x01, 0x00));
+ /* NotifyVolumeChange - CT */
+ define_test("/TP/VLH/BV-03-C", test_client,
+ raw_pdu(0x00, 0x11, 0x0e, 0x03, 0x48, 0x00,
+ 0x00, 0x19, 0x58, AVRCP_REGISTER_NOTIFICATION,
+ 0x00, 0x00, 0x05, 0x0d,
+ 0x00, 0x00, 0x00, 0x00),
+ raw_pdu(0x02, 0x11, 0x0e, AVC_CTYPE_INTERIM, 0x48, 0x00,
+ 0x00, 0x19, 0x58, AVRCP_REGISTER_NOTIFICATION,
+ 0x00, 0x00, 0x02, 0x0d,
+ 0x00));
+
/* Set absolute volume – TG */
define_test("/TP/VLH/BI-01-C", test_server,
raw_pdu(0x00, 0x11, 0x0e, 0x00, 0x48, 0x00,