#include "avdtp.h"
#include "sink.h"
#include "player.h"
+#include "transport.h"
/* Company IDs for vendor dependent commands */
#define IEEEID_BTSIG 0x001958
uint8_t transaction)
{
struct avrcp_player *player = session->player;
+ struct audio_device *dev = session->dev;
uint16_t len = ntohs(pdu->params_len);
uint64_t uid;
GList *settings;
}
break;
+ case AVRCP_EVENT_VOLUME_CHANGED:
+ if (session->version < 0x0104)
+ goto err;
+
+ pdu->params[1] = media_transport_get_device_volume(dev);
+ if (pdu->params[1] > 127)
+ goto err;
+
+ len = 2;
+
+ break;
default:
/* All other events are not supported yet */
goto err;
static const struct control_pdu_handler ct_control_handlers[] = {
{ AVRCP_GET_CAPABILITIES, AVC_CTYPE_STATUS,
avrcp_handle_get_capabilities },
+ { AVRCP_REGISTER_NOTIFICATION, AVC_CTYPE_NOTIFY,
+ avrcp_handle_register_notification },
{ },
};
if (transport != NULL)
return FALSE;
- transport = media_transport_create(endpoint, device,
- configuration, size);
+ transport = media_transport_create(device, configuration, size,
+ endpoint);
if (transport == NULL)
return FALSE;
transport_update_playing(transport, FALSE);
}
-struct media_transport *media_transport_create(struct media_endpoint *endpoint,
- struct audio_device *device,
+struct media_transport *media_transport_create(struct audio_device *device,
uint8_t *configuration,
- size_t size)
+ size_t size, void *data)
{
+ struct media_endpoint *endpoint = data;
struct media_transport *transport;
const char *uuid;
static int fd = 0;
struct media_transport;
-struct media_transport *media_transport_create(struct media_endpoint *endpoint,
- struct audio_device *device,
+struct media_transport *media_transport_create(struct audio_device *device,
uint8_t *configuration,
- size_t size);
+ size_t size, void *data);
void media_transport_destroy(struct media_transport *transport);
const char *media_transport_get_path(struct media_transport *transport);