3 * BlueZ - Bluetooth protocol stack for Linux
5 * Copyright (C) 2010 GSyC/LibreSoft, Universidad Rey Juan Carlos.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 #ifndef __HDP_TYPES_H__
24 #define __HDP_TYPES_H__
26 #define MANAGER_PATH "/org/bluez"
28 #define HEALTH_MANAGER "org.bluez.HealthManager"
29 #define HEALTH_DEVICE "org.bluez.HealthDevice"
30 #define HEALTH_CHANNEL "org.bluez.HealthChannel"
32 #define HDP_VERSION 0x0100
34 #define HDP_SERVICE_NAME "Bluez HDP"
35 #define HDP_SERVICE_DSC "A Bluez health device profile implementation"
36 #define HDP_SERVICE_PROVIDER "Bluez"
38 #define HDP_MDEP_ECHO 0x00
39 #define HDP_MDEP_INITIAL 0x01
40 #define HDP_MDEP_FINAL 0x7F
42 #define HDP_ERROR g_quark_from_static_string("hdp-error-quark")
44 #define HDP_NO_PREFERENCE_DC 0x00
45 #define HDP_RELIABLE_DC 0x01
46 #define HDP_STREAMING_DC 0x02
48 #define HDP_SINK_ROLE_AS_STRING "sink"
49 #define HDP_SOURCE_ROLE_AS_STRING "source"
58 HDP_DIC_ENTRY_PARSE_ERROR,
60 HDP_UNSPECIFIED_ERROR,
65 DATA_EXCHANGE_SPEC_11073 = 0x01
68 struct hdp_application {
69 DBusConnection *conn; /* For dbus watcher */
70 char *path; /* The path of the application */
71 uint16_t data_type; /* Data type handled for this application */
72 gboolean data_type_set; /* Flag for dictionary parsing */
73 uint8_t role; /* Role of this application */
74 gboolean role_set; /* Flag for dictionary parsing */
75 uint8_t chan_type; /* QoS preferred by source applications */
76 gboolean chan_type_set; /* Flag for dictionary parsing */
77 char *description; /* Options description for SDP record */
78 uint8_t id; /* The identification is also the mdepid */
79 char *oname; /* Name of the owner application */
80 guint dbus_watcher; /* Watch for clients disconnection */
81 gint ref; /* Reference counter */
85 struct btd_adapter *btd_adapter; /* Bluetooth adapter */
86 struct mcap_instance *mi; /* Mcap instance in */
87 uint16_t ccpsm; /* Control channel psm */
88 uint16_t dcpsm; /* Data channel psm */
89 uint32_t sdp_handler; /* SDP record handler */
90 uint32_t record_state; /* Service record state */
94 DBusConnection *conn; /* For name listener handling */
95 struct btd_device *dev; /* Device reference */
96 struct hdp_adapter *hdp_adapter; /* hdp_adapater */
97 struct mcap_mcl *mcl; /* The mcap control channel */
98 gboolean mcl_conn; /* Mcl status */
99 gboolean sdp_present; /* Has an sdp record */
100 GSList *channels; /* Data Channel list */
101 struct hdp_channel *ndc; /* Data channel being negotiated */
102 struct hdp_channel *fr; /* First reliable data channel */
103 gint ref; /* Reference counting */
106 struct hdp_echo_data;
109 struct hdp_device *dev; /* Device where this channel belongs */
110 struct hdp_application *app; /* Application */
111 struct mcap_mdl *mdl; /* The data channel reference */
112 char *path; /* The path of the channel */
113 uint8_t config; /* Channel configuration */
114 uint8_t mdep; /* Remote MDEP */
115 uint16_t mdlid; /* Data channel Id */
116 uint16_t imtu; /* Channel incoming MTU */
117 uint16_t omtu; /* Channel outgoing MTU */
118 struct hdp_echo_data *edata; /* private data used by echo channels */
119 gint ref; /* Reference counter */
122 #endif /* __HDP_TYPES_H__ */