a2dp sink demo: add register track changed event

This commit is contained in:
Milanka Ringwald 2018-04-24 14:39:58 +02:00
parent 19af95b439
commit 8177fff398

View File

@ -765,7 +765,10 @@ static void avrcp_controller_packet_handler(uint8_t packet_type, uint16_t channe
if (!avrcp_cid) return;
// ignore INTERIM status
if (status == AVRCP_CTYPE_RESPONSE_INTERIM) return;
if (status == AVRCP_CTYPE_RESPONSE_INTERIM){
printf(" INTERIM response \n");
return;
}
printf("AVRCP demo: command status: %s, ", avrcp_ctype2str(status));
switch (packet[2]){
@ -982,6 +985,9 @@ static void show_usage(void){
printf("X - disable repeat mode\n");
printf("z - shuffle all tracks\n");
printf("Z - disable shuffle mode\n");
printf("a/A - register/deregister TRACK_CHANGED\n");
printf("---\n");
}
#endif
@ -1112,6 +1118,15 @@ static void stdin_process(char cmd){
printf(" - disable shuffle mode\n");
status = avrcp_controller_set_shuffle_mode(avrcp_cid, AVRCP_SHUFFLE_MODE_OFF);
break;
case 'a':
printf("AVRCP: enable notification TRACK_CHANGED\n");
avrcp_controller_enable_notification(avrcp_cid, AVRCP_NOTIFICATION_EVENT_TRACK_CHANGED);
break;
case 'A':
printf("AVRCP: disable notification TRACK_CHANGED\n");
avrcp_controller_disable_notification(avrcp_cid, AVRCP_NOTIFICATION_EVENT_TRACK_CHANGED);
break;
default:
show_usage();
return;