bluez/android/avrcp-lib.c

76 lines
1.8 KiB
C
Raw Normal View History

/*
*
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2014 Intel Corporation. All rights reserved.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdbool.h>
#include <glib.h>
#include "lib/bluetooth.h"
#include "src/log.h"
#include "avctp.h"
#include "avrcp-lib.h"
struct avrcp {
struct avctp *conn;
};
void avrcp_shutdown(struct avrcp *session)
{
if (session->conn)
avctp_shutdown(session->conn);
g_free(session);
}
struct avrcp *avrcp_new(int fd, size_t imtu, size_t omtu, uint16_t version)
{
struct avrcp *session;
session = g_new0(struct avrcp, 1);
session->conn = avctp_new(fd, imtu, omtu, version);
if (!session->conn) {
g_free(session);
return NULL;
}
return session;
}
void avrcp_set_destroy_cb(struct avrcp *session, avrcp_destroy_cb_t cb,
void *user_data)
{
avctp_set_destroy_cb(session->conn, cb, user_data);
}
int avrcp_init_uinput(struct avrcp *session, const char *name,
const char *address)
{
return avctp_init_uinput(session->conn, name, address);
}