For example, using the following on the command line will return the
current codec for a bluetooth device
pacmd send-message /card/bluez_card.4C_BC_98_80_01_9B/bluez get-codec
where 4C_BC_98_80_01_9B is the bluetooth device.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/440>
} else if (pa_streq(message, "list-codecs")) {
*response = list_codecs(u);
return PA_OK;
+ } else if (pa_streq(message, "get-codec")) {
+ pa_message_params *param;
+ param = pa_message_params_new();
+
+ if (u->a2dp_codec)
+ pa_message_params_write_string(param, u->a2dp_codec->name);
+ else
+ pa_message_params_write_string(param, "none");
+
+ *response = pa_message_params_to_string_free(param);
+
+ return PA_OK;
}