diff options
author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2013-01-28 18:11:01 -0300 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2013-01-29 08:39:31 -0600 |
commit | a2376f6c77fca082f94ae0f88faa823bb1d0457c (patch) | |
tree | c586c139839bb49c99459b4439da84e6e50996ec | |
parent | 3a3e31eef296c1cf7fe2a197b6696a3c93c85d52 (diff) | |
download | ofono-a2376f6c77fca082f94ae0f88faa823bb1d0457c.tar.bz2 |
bluez5: Add SCO socket declarations
Adds local copy of SCO Bluetooth sockets declarations, since the
objective to avoid including BlueZ library headers.
-rw-r--r-- | plugins/bluez5.c | 3 | ||||
-rw-r--r-- | plugins/bluez5.h | 28 | ||||
-rw-r--r-- | plugins/hfp_hf_bluez5.c | 2 |
3 files changed, 33 insertions, 0 deletions
diff --git a/plugins/bluez5.c b/plugins/bluez5.c index 8d8b5653..d471454d 100644 --- a/plugins/bluez5.c +++ b/plugins/bluez5.c @@ -24,6 +24,9 @@ #endif #include <errno.h> +#include <stdint.h> +#include <sys/socket.h> + #include <glib.h> #define OFONO_API_SUBJECT_TO_CHANGE diff --git a/plugins/bluez5.h b/plugins/bluez5.h index 3aa8ffeb..fd0704e5 100644 --- a/plugins/bluez5.h +++ b/plugins/bluez5.h @@ -28,6 +28,34 @@ #define HFP_HS_UUID "0000111e-0000-1000-8000-00805f9b34fb" #define HFP_AG_UUID "0000111f-0000-1000-8000-00805f9b34fb" +#ifndef AF_BLUETOOTH +#define AF_BLUETOOTH 31 +#define PF_BLUETOOTH AF_BLUETOOTH +#endif + +#define BTPROTO_SCO 2 + +#define SOL_SCO 17 + +#ifndef SOL_BLUETOOTH +#define SOL_BLUETOOTH 274 +#endif + +#define BT_DEFER_SETUP 7 + +/* BD Address */ +typedef struct { + uint8_t b[6]; +} __attribute__((packed)) bdaddr_t; + +#define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}}) + +/* SCO socket address */ +struct sockaddr_sco { + sa_family_t sco_family; + bdaddr_t sco_bdaddr; +}; + int bluetooth_register_profile(DBusConnection *conn, const char *uuid, const char *name, const char *object); diff --git a/plugins/hfp_hf_bluez5.c b/plugins/hfp_hf_bluez5.c index f6ceb768..0e496ee4 100644 --- a/plugins/hfp_hf_bluez5.c +++ b/plugins/hfp_hf_bluez5.c @@ -24,9 +24,11 @@ #endif #include <errno.h> +#include <stdint.h> #include <stdlib.h> #include <unistd.h> #include <string.h> +#include <sys/socket.h> #include <glib.h> |