~ubuntu-branches/ubuntu/raring/bluez/raring

« back to all changes in this revision

Viewing changes to lib/a2mp.h

  • Committer: Package Import Robot
  • Author(s): Iain Lane, Iain Lane, Steve Langasek
  • Date: 2012-05-01 15:42:57 UTC
  • mfrom: (6.3.24 sid)
  • Revision ID: package-import@ubuntu.com-20120501154257-h0pr1yf6xxjym52g
Tags: 4.99-2ubuntu1
[ Iain Lane ]

* Merge with Debian unstable, remaining changes:
  - Upstart support:
    o Add debian/bluez.bluetooth.upstart and drop
      debian/bluez.bluetooth.default.
    o debian/rules: Drop -DEB_UPDATE_RCD_PARAMS
    o Disable 07-fix-639356.patch and don't install 97-bluetooth.rules (in
      debian/bluez.install) and debian/bluez-udev (in debian/rules), we
      don't want to use the udev rules to start bluez. The upstart job does
      that already.
  - debian/bluez-alsa.install: Install ALSA bluetooth configuration into the
    right place for ALSA 1.0.25.
  - Add debian/source_bluez.py Apport package hook. Install in
    debian/bluez.install.
  - debian/control: Build against libnl3-dev, not libnl-dev.
  - debian/patches/socket_audio.patch: re-enable the socket API for the
    bluetooth audio manager. This reverts an upstream change that switches to
    the MediaEndpoint DBus API by default, but it looks like PulseAudio isn't
    quite ready to use that yet.
  - Add sbc_mmx.patch: Fix building with gcc 4.7.
  - debian/patches/10-unregister_interface_on_exit.patch: unregister the SAP
    interface on exit.
  - debian/patches/11-explicitly_close.patch: make sure the io channel for
    HFP is properly closed on exit.
  - debian/patches/enable_audio_profiles.patch: properly enable the Source
    profile, its state is checked twice, once in audio/a2dp.c again which was
    not taken into account in the previous upload.
  - Drop debian/bluez.preinst and debian/bluez-alsa.preinst: Obsolete
    conffile migrations, 10.04 LTS has a much newer version.
  - Transition the BLUETOOTH_ENABLED variable to an Upstart override
    variable if it's been changed. 
* debian/control: Continue depending on module-init-tools instead of kmod
  (reverts Debian change), as we do not have the latter yet.
* debian/patches/python3.diff: Some additional changes

[ Steve Langasek ]

* Switch to python3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *
 
3
 *  BlueZ - Bluetooth protocol stack for Linux
 
4
 *
 
5
 *  Copyright (C) 2012  Intel Corporation. All rights reserved.
 
6
 *  Copyright (c) 2012  Code Aurora Forum. All rights reserved.
 
7
 *
 
8
 *  This program is free software; you can redistribute it and/or modify
 
9
 *  it under the terms of the GNU General Public License as published by
 
10
 *  the Free Software Foundation; either version 2 of the License, or
 
11
 *  (at your option) any later version.
 
12
 *
 
13
 *  This program is distributed in the hope that it will be useful,
 
14
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
 *  GNU General Public License for more details.
 
17
 *
 
18
 *  You should have received a copy of the GNU General Public License
 
19
 *  along with this program; if not, write to the Free Software
 
20
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
21
 *
 
22
 */
 
23
 
 
24
#ifndef __A2MP_H
 
25
#define __A2MP_H
 
26
 
 
27
#ifdef __cplusplus
 
28
extern "C" {
 
29
#endif
 
30
 
 
31
/* A2MP Protocol */
 
32
 
 
33
/* A2MP command codes */
 
34
 
 
35
#define A2MP_COMMAND_REJ        0x01
 
36
#define A2MP_DISCOVER_REQ       0x02
 
37
#define A2MP_DISCOVER_RSP       0x03
 
38
#define A2MP_CHANGE_NOTIFY      0x04
 
39
#define A2MP_CHANGE_RSP         0x05
 
40
#define A2MP_INFO_REQ           0x06
 
41
#define A2MP_INFO_RSP           0x07
 
42
#define A2MP_ASSOC_REQ          0x08
 
43
#define A2MP_ASSOC_RSP          0x09
 
44
#define A2MP_CREATE_REQ         0x0a
 
45
#define A2MP_CREATE_RSP         0x0b
 
46
#define A2MP_DISCONN_REQ        0x0c
 
47
#define A2MP_DISCONN_RSP        0x0d
 
48
 
 
49
struct a2mp_hdr {
 
50
        uint8_t         code;
 
51
        uint8_t         ident;
 
52
        uint16_t        len;
 
53
} __attribute__ ((packed));
 
54
#define A2MP_HDR_SIZE 4
 
55
 
 
56
struct a2mp_command_rej {
 
57
        uint16_t        reason;
 
58
} __attribute__ ((packed));
 
59
 
 
60
struct a2mp_discover_req {
 
61
        uint16_t        mtu;
 
62
        uint16_t        mask;
 
63
} __attribute__ ((packed));
 
64
 
 
65
struct a2mp_ctrl {
 
66
        uint8_t         id;
 
67
        uint8_t         type;
 
68
        uint8_t         status;
 
69
} __attribute__ ((packed));
 
70
 
 
71
struct a2mp_discover_rsp {
 
72
        uint16_t        mtu;
 
73
        uint16_t        mask;
 
74
        struct a2mp_ctrl ctrl_list[0];
 
75
} __attribute__ ((packed));
 
76
 
 
77
struct a2mp_info_req {
 
78
        uint8_t         id;
 
79
} __attribute__ ((packed));
 
80
 
 
81
struct a2mp_info_rsp {
 
82
        uint8_t         id;
 
83
        uint8_t         status;
 
84
        uint32_t        total_bw;
 
85
        uint32_t        max_bw;
 
86
        uint32_t        min_latency;
 
87
        uint16_t        pal_caps;
 
88
        uint16_t        assoc_size;
 
89
} __attribute__ ((packed));
 
90
 
 
91
struct a2mp_assoc_req {
 
92
        uint8_t         id;
 
93
} __attribute__ ((packed));
 
94
 
 
95
struct a2mp_assoc_rsp {
 
96
        uint8_t         id;
 
97
        uint8_t         status;
 
98
        uint8_t         assoc_data[0];
 
99
} __attribute__ ((packed));
 
100
 
 
101
struct a2mp_create_req {
 
102
        uint8_t         local_id;
 
103
        uint8_t         remote_id;
 
104
        uint8_t         assoc_data[0];
 
105
} __attribute__ ((packed));
 
106
 
 
107
struct a2mp_create_rsp {
 
108
        uint8_t         local_id;
 
109
        uint8_t         remote_id;
 
110
        uint8_t         status;
 
111
} __attribute__ ((packed));
 
112
 
 
113
struct a2mp_disconn_req {
 
114
        uint8_t         local_id;
 
115
        uint8_t         remote_id;
 
116
} __attribute__ ((packed));
 
117
 
 
118
struct a2mp_disconn_rsp {
 
119
        uint8_t         local_id;
 
120
        uint8_t         remote_id;
 
121
        uint8_t         status;
 
122
} __attribute__ ((packed));
 
123
 
 
124
#define A2MP_COMMAND_NOT_RECOGNIZED 0x0000
 
125
 
 
126
/* AMP controller status */
 
127
#define AMP_CTRL_POWERED_DOWN           0x00
 
128
#define AMP_CTRL_BLUETOOTH_ONLY         0x01
 
129
#define AMP_CTRL_NO_CAPACITY            0x02
 
130
#define AMP_CTRL_LOW_CAPACITY           0x03
 
131
#define AMP_CTRL_MEDIUM_CAPACITY        0x04
 
132
#define AMP_CTRL_HIGH_CAPACITY          0x05
 
133
#define AMP_CTRL_FULL_CAPACITY          0x06
 
134
 
 
135
/* A2MP response status */
 
136
#define A2MP_STATUS_SUCCESS                             0x00
 
137
#define A2MP_STATUS_INVALID_CTRL_ID                     0x01
 
138
#define A2MP_STATUS_UNABLE_START_LINK_CREATION          0x02
 
139
#define A2MP_STATUS_NO_PHYSICAL_LINK_EXISTS             0x02
 
140
#define A2MP_STATUS_COLLISION_OCCURED                   0x03
 
141
#define A2MP_STATUS_DISCONN_REQ_RECVD                   0x04
 
142
#define A2MP_STATUS_PHYS_LINK_EXISTS                    0x05
 
143
#define A2MP_STATUS_SECURITY_VIOLATION                  0x06
 
144
 
 
145
#ifdef __cplusplus
 
146
}
 
147
#endif
 
148
 
 
149
#endif /* __A2MP_H */