1 /* 2 * 3 * BlueZ - Bluetooth protocol stack for Linux 4 * 5 * Copyright (C) 2006-2007 Nokia Corporation 6 * Copyright (C) 2004-2008 Marcel Holtmann <marcel@holtmann.org> 7 * 8 * 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. 13 * 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. 18 * 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 22 * 23 */ 24 25 #define AUDIO_DEVICE_INTERFACE "org.bluez.audio.Device" 26 27 #define GENERIC_AUDIO_UUID "00001203-0000-1000-8000-00805F9B34FB" 28 29 #define HSP_HS_UUID "00001108-0000-1000-8000-00805F9B34FB" 30 #define HSP_AG_UUID "00001112-0000-1000-8000-00805F9B34FB" 31 32 #define HFP_HS_UUID "0000111E-0000-1000-8000-00805F9B34FB" 33 #define HFP_AG_UUID "0000111F-0000-1000-8000-00805F9B34FB" 34 35 #define ADVANCED_AUDIO_UUID "0000110D-0000-1000-8000-00805F9B34FB" 36 37 #define A2DP_SOURCE_UUID "0000110A-0000-1000-8000-00805F9B34FB" 38 #define A2DP_SINK_UUID "0000110B-0000-1000-8000-00805F9B34FB" 39 40 #define AVRCP_REMOTE_UUID "0000110E-0000-1000-8000-00805F9B34FB" 41 #define AVRCP_TARGET_UUID "0000110C-0000-1000-8000-00805F9B34FB" 42 43 /* Move these to respective .h files once they exist */ 44 #define AUDIO_SOURCE_INTERFACE "org.bluez.audio.Source" 45 #define AUDIO_CONTROL_INTERFACE "org.bluez.audio.Control" 46 #define AUDIO_TARGET_INTERFACE "org.bluez.audio.Target" 47 48 struct source; 49 struct control; 50 struct target; 51 struct sink; 52 struct headset; 53 struct gateway; 54 55 struct audio_device { 56 DBusConnection *conn; 57 char *adapter_path; 58 char *path; 59 char *name; 60 bdaddr_t store; 61 bdaddr_t src; 62 bdaddr_t dst; 63 64 struct headset *headset; 65 struct gateway *gateway; 66 struct sink *sink; 67 struct source *source; 68 struct control *control; 69 struct target *target; 70 71 guint control_timer; 72 }; 73 74 gboolean device_set_control_timer(struct audio_device *dev); 75 void device_remove_control_timer(struct audio_device *dev); 76 77 struct audio_device *device_register(DBusConnection *conn, 78 const char *path, const bdaddr_t *bda); 79 80 int device_store(struct audio_device *device, gboolean is_default); 81 82 int device_remove_stored(struct audio_device *dev); 83 84 void device_finish_sdp_transaction(struct audio_device *device); 85 86 uint8_t device_get_state(struct audio_device *dev); 87 88 gboolean device_is_connected(struct audio_device *dev, const char *interface); 89