3 * BlueZ - Bluetooth protocol stack for Linux
5 * Copyright (C) 2006-2010 Nokia Corporation
6 * Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 #define AVC_HEADER_LENGTH 3
31 #define AVC_CTYPE_CONTROL 0x0
32 #define AVC_CTYPE_STATUS 0x1
33 #define AVC_CTYPE_NOTIFY 0x3
34 #define AVC_CTYPE_NOT_IMPLEMENTED 0x8
35 #define AVC_CTYPE_ACCEPTED 0x9
36 #define AVC_CTYPE_REJECTED 0xA
37 #define AVC_CTYPE_STABLE 0xC
38 #define AVC_CTYPE_CHANGED 0xD
39 #define AVC_CTYPE_INTERIM 0xF
42 #define AVC_OP_VENDORDEP 0x00
43 #define AVC_OP_UNITINFO 0x30
44 #define AVC_OP_SUBUNITINFO 0x31
45 #define AVC_OP_PASSTHROUGH 0x7c
47 /* subunits of interest */
48 #define AVC_SUBUNIT_PANEL 0x09
50 /* operands in passthrough commands */
51 #define VOL_UP_OP 0x41
52 #define VOL_DOWN_OP 0x42
55 #define STAVC_OP_OP 0x45
57 #define RECORD_OP 0x47
58 #define REWIND_OP 0x48
59 #define FAST_FORWARD_OP 0x49
61 #define FORWARD_OP 0x4b
62 #define BACKWARD_OP 0x4c
67 AVCTP_STATE_DISCONNECTED = 0,
68 AVCTP_STATE_CONNECTING,
72 typedef void (*avctp_state_cb) (struct audio_device *dev,
73 avctp_state_t old_state,
74 avctp_state_t new_state,
77 typedef size_t (*avctp_pdu_cb) (struct avctp *session, uint8_t transaction,
78 uint8_t *code, uint8_t *subunit,
79 uint8_t *operands, size_t operand_count,
82 unsigned int avctp_add_state_cb(avctp_state_cb cb, void *user_data);
83 gboolean avctp_remove_state_cb(unsigned int id);
85 int avctp_register(const bdaddr_t *src, gboolean master);
86 void avctp_unregister(const bdaddr_t *src);
88 struct avctp *avctp_connect(const bdaddr_t *src, const bdaddr_t *dst);
89 struct avctp *avctp_get(const bdaddr_t *src, const bdaddr_t *dst);
90 void avctp_disconnect(struct avctp *session);
92 unsigned int avctp_register_pdu_handler(uint8_t opcode, avctp_pdu_cb cb,
94 gboolean avctp_unregister_pdu_handler(unsigned int id);
96 int avctp_send_passthrough(struct avctp *session, uint8_t op);
97 int avctp_send_vendordep(struct avctp *session, uint8_t transaction,
98 uint8_t code, uint8_t subunit,
99 uint8_t *operands, size_t operand_count);