From a48d8b4639f36e6fc2d7e87cac92e178674caaa1 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Fri, 8 Mar 2002 21:10:06 +0000 Subject: Initial revision --- include/Makefile.am | 9 + include/Makefile.in | 194 +++++++++++++ include/bluetooth.h | 111 ++++++++ include/hci.h | 768 ++++++++++++++++++++++++++++++++++++++++++++++++++++ include/hci_lib.h | 115 ++++++++ include/hci_uart.h | 45 +++ include/hci_vhci.h | 35 +++ include/l2cap.h | 200 ++++++++++++++ include/sco.h | 65 +++++ 9 files changed, 1542 insertions(+) create mode 100644 include/Makefile.am create mode 100644 include/Makefile.in create mode 100644 include/bluetooth.h create mode 100644 include/hci.h create mode 100644 include/hci_lib.h create mode 100644 include/hci_uart.h create mode 100644 include/hci_vhci.h create mode 100644 include/l2cap.h create mode 100644 include/sco.h (limited to 'include') diff --git a/include/Makefile.am b/include/Makefile.am new file mode 100644 index 00000000..dceb3447 --- /dev/null +++ b/include/Makefile.am @@ -0,0 +1,9 @@ +# +# $Id$ +# + +hdrdir = $(prefix)/include/bluetooth + +install-data-local: + $(mkinstalldirs) $(DESTDIR)$(hdrdir) + $(INSTALL) -m 644 $(srcdir)/*.h $(DESTDIR)$(hdrdir) diff --git a/include/Makefile.in b/include/Makefile.in new file mode 100644 index 00000000..5a8de87a --- /dev/null +++ b/include/Makefile.in @@ -0,0 +1,194 @@ +# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# +# $Id$ +# + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +DLLTOOL = @DLLTOOL@ +ECHO = @ECHO@ +EXEEXT = @EXEEXT@ +LD = @LD@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAKEINFO = @MAKEINFO@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +STRIP = @STRIP@ +VERSION = @VERSION@ + +hdrdir = $(prefix)/include/bluetooth +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_CLEAN_FILES = +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = include + +distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu include/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-data-local +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am + -rm -f libtool + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: tags distdir info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-local install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +install-data-local: + $(mkinstalldirs) $(DESTDIR)$(hdrdir) + $(INSTALL) -m 644 $(srcdir)/*.h $(DESTDIR)$(hdrdir) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/include/bluetooth.h b/include/bluetooth.h new file mode 100644 index 00000000..441e1d3a --- /dev/null +++ b/include/bluetooth.h @@ -0,0 +1,111 @@ +/* + BlueZ - Bluetooth protocol stack for Linux + Copyright (C) 2000-2001 Qualcomm Incorporated + + Written 2000,2001 by Maxim Krasnyansky + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + SOFTWARE IS DISCLAIMED. +*/ + +/* + * $Id$ + */ + +#ifndef __BLUETOOTH_H +#define __BLUETOOTH_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +#ifndef AF_BLUETOOTH +#define AF_BLUETOOTH 31 +#define PF_BLUETOOTH AF_BLUETOOTH +#endif + +#define BTPROTO_L2CAP 0 +#define BTPROTO_HCI 1 +#define BTPROTO_SCO 2 +#define BTPROTO_RFCOMM 3 + +#define SOL_HCI 0 +#define SOL_L2CAP 6 +#define SOL_SCO 17 +#define SOL_RFCOMM 18 + +/* Connection and socket states */ +enum { + BT_CONNECTED = 1, /* Equal to TCP_ESTABLISHED to make net code happy */ + BT_OPEN, + BT_BOUND, + BT_LISTEN, + BT_CONNECT, + BT_CONNECT2, + BT_CONFIG, + BT_DISCONN, + BT_CLOSED +}; + +/* Byte order conversions */ +#if __BYTE_ORDER == __LITTLE_ENDIAN +#define htobs(d) (d) +#define htobl(d) (d) +#define btohs(d) (d) +#define btohl(d) (d) +#elif __BYTE_ORDER == __BIG_ENDIAN +#define htobs(d) bswap_16(d) +#define htobl(d) bswap_32(d) +#define btohs(d) bswap_16(d) +#define btohl(d) bswap_32(d) +#else +#error "Unknown byte order" +#endif + +/* BD Address */ +typedef struct { + uint8_t b[6]; +} __attribute__((packed)) bdaddr_t; + +#define BDADDR_ANY ((bdaddr_t *)"\000\000\000\000\000") + +/* Copy, swap, convert BD Address */ +static inline int bacmp(bdaddr_t *ba1, bdaddr_t *ba2) +{ + return memcmp(ba1, ba2, sizeof(bdaddr_t)); +} +static inline void bacpy(bdaddr_t *dst, bdaddr_t *src) +{ + memcpy(dst, src, sizeof(bdaddr_t)); +} + +void baswap(bdaddr_t *dst, bdaddr_t *src); +bdaddr_t *strtoba(char *str); +char *batostr(bdaddr_t *ba); +int ba2str(bdaddr_t *ba, char *str); +int str2ba(char *str, bdaddr_t *ba); + +int bterr(uint16_t code); + +#ifdef __cplusplus +} +#endif + +#endif /* __BLUETOOTH_H */ diff --git a/include/hci.h b/include/hci.h new file mode 100644 index 00000000..3f98ab1d --- /dev/null +++ b/include/hci.h @@ -0,0 +1,768 @@ +/* + BlueZ - Bluetooth protocol stack for Linux + Copyright (C) 2000-2001 Qualcomm Incorporated + + Written 2000,2001 by Maxim Krasnyansky + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + SOFTWARE IS DISCLAIMED. +*/ + +/* + * $Id$ + */ + +#ifndef __HCI_H +#define __HCI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define HCI_MAX_DEV 4 + +#define HCI_MAX_ACL_SIZE 1024 +#define HCI_MAX_SCO_SIZE 255 +#define HCI_MAX_EVENT_SIZE 260 +#define HCI_MAX_FRAME_SIZE (HCI_MAX_ACL_SIZE + 4) + +/* HCI dev events */ +#define HCI_DEV_REG 1 +#define HCI_DEV_UNREG 2 +#define HCI_DEV_UP 3 +#define HCI_DEV_DOWN 4 + +/* HCI device types */ +#define HCI_VHCI 0 +#define HCI_USB 1 +#define HCI_PCCARD 2 +#define HCI_UART 3 +#define HCI_RS232 4 + +/* HCI device flags */ +enum { + HCI_UP, + HCI_INIT, + HCI_RUNNING, + + HCI_PSCAN, + HCI_ISCAN, + HCI_AUTH, + HCI_ENCRYPT, + HCI_INQUIRY, + + HCI_RAW +}; + +/* HCI ioctl defines */ +#define HCIDEVUP _IOW('H', 201, int) +#define HCIDEVDOWN _IOW('H', 202, int) +#define HCIDEVRESET _IOW('H', 203, int) +#define HCIDEVRESTAT _IOW('H', 204, int) + +#define HCIGETDEVLIST _IOR('H', 210, int) +#define HCIGETDEVINFO _IOR('H', 211, int) +#define HCIGETCONNLIST _IOR('H', 212, int) +#define HCIGETCONNINFO _IOR('H', 213, int) + +#define HCISETRAW _IOW('H', 220, int) +#define HCISETSCAN _IOW('H', 221, int) +#define HCISETAUTH _IOW('H', 222, int) +#define HCISETENCRYPT _IOW('H', 223, int) +#define HCISETPTYPE _IOW('H', 224, int) +#define HCISETLINKPOL _IOW('H', 225, int) +#define HCISETLINKMODE _IOW('H', 226, int) + +#define HCIINQUIRY _IOR('H', 240, int) + +/* HCI timeouts */ + +#define HCI_CONN_TIMEOUT (HZ * 40) +#define HCI_DISCONN_TIMEOUT (HZ * 2) +#define HCI_CONN_IDLE_TIMEOUT (HZ * 60) + +#ifndef __NO_HCI_DEFS + +/* HCI Packet types */ +#define HCI_COMMAND_PKT 0x01 +#define HCI_ACLDATA_PKT 0x02 +#define HCI_SCODATA_PKT 0x03 +#define HCI_EVENT_PKT 0x04 +#define HCI_UNKNOWN_PKT 0xff + +/* HCI Packet types */ +#define HCI_DM1 0x0008 +#define HCI_DM3 0x0400 +#define HCI_DM5 0x4000 +#define HCI_DH1 0x0010 +#define HCI_DH3 0x0800 +#define HCI_DH5 0x8000 + +#define HCI_HV1 0x0020 +#define HCI_HV2 0x0040 +#define HCI_HV3 0x0080 + +#define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3) +#define ACL_PTYPE_MASK (~SCO_PTYPE_MASK) + +/* ACL flags */ +#define ACL_CONT 0x0001 +#define ACL_START 0x0002 +#define ACL_ACTIVE_BCAST 0x0010 +#define ACL_PICO_BCAST 0x0020 + +/* Baseband links */ +#define SCO_LINK 0x00 +#define ACL_LINK 0x01 + +/* LMP features */ +#define LMP_3SLOT 0x01 +#define LMP_5SLOT 0x02 +#define LMP_ENCRYPT 0x04 +#define LMP_SOFFSET 0x08 +#define LMP_TACCURACY 0x10 +#define LMP_RSWITCH 0x20 +#define LMP_HOLD 0x40 +#define LMP_SNIF 0x80 + +#define LMP_PARK 0x01 +#define LMP_RSSI 0x02 +#define LMP_QUALITY 0x04 +#define LMP_SCO 0x08 +#define LMP_HV2 0x10 +#define LMP_HV3 0x20 +#define LMP_ULAW 0x40 +#define LMP_ALAW 0x80 + +#define LMP_CVSD 0x01 +#define LMP_PSCHEME 0x02 +#define LMP_PCONTROL 0x04 + +/* Link policies */ +#define HCI_LP_RSWITCH 0x0001 +#define HCI_LP_HOLD 0x0002 +#define HCI_LP_SNIFF 0x0004 +#define HCI_LP_PARK 0x0008 + +/* Link mode */ +#define HCI_LM_ACCEPT 0x8000 +#define HCI_LM_MASTER 0x0001 +#define HCI_LM_AUTH 0x0002 +#define HCI_LM_ENCRYPT 0x0004 +#define HCI_LM_TRUSTED 0x0008 + +/* ----- HCI Commands ----- */ +/* OGF & OCF values */ + +/* Informational Parameters */ +#define OGF_INFO_PARAM 0x04 + +#define OCF_READ_LOCAL_VERSION 0x0001 +typedef struct { + uint8_t status; + uint8_t hci_ver; + uint16_t hci_rev; + uint8_t lmp_ver; + uint16_t manufacturer; + uint16_t lmp_subver; +} __attribute__ ((packed)) read_local_version_rp; +#define READ_LOCAL_VERSION_RP_SIZE 9 + +#define OCF_READ_LOCAL_FEATURES 0x0003 +typedef struct { + uint8_t status; + uint8_t features[8]; +} __attribute__ ((packed)) read_local_features_rp; + +#define OCF_READ_BUFFER_SIZE 0x0005 +typedef struct { + uint8_t status; + uint16_t acl_mtu; + uint8_t sco_mtu; + uint16_t acl_max_pkt; + uint16_t sco_max_pkt; +} __attribute__ ((packed)) read_buffer_size_rp; + +#define OCF_READ_BD_ADDR 0x0009 +typedef struct { + uint8_t status; + bdaddr_t bdaddr; +} __attribute__ ((packed)) read_bd_addr_rp; + +/* Host Controller and Baseband */ +#define OGF_HOST_CTL 0x03 +#define OCF_RESET 0x0003 +#define OCF_READ_AUTH_ENABLE 0x001F +#define OCF_WRITE_AUTH_ENABLE 0x0020 + #define AUTH_DISABLED 0x00 + #define AUTH_ENABLED 0x01 + +#define OCF_READ_ENCRYPT_MODE 0x0021 +#define OCF_WRITE_ENCRYPT_MODE 0x0022 + #define ENCRYPT_DISABLED 0x00 + #define ENCRYPT_P2P 0x01 + #define ENCRYPT_BOTH 0x02 + +#define OCF_WRITE_CA_TIMEOUT 0x0016 +#define OCF_WRITE_PG_TIMEOUT 0x0018 + +#define OCF_WRITE_SCAN_ENABLE 0x001A + #define SCAN_DISABLED 0x00 + #define SCAN_INQUIRY 0x01 + #define SCAN_PAGE 0x02 + +#define OCF_SET_EVENT_FLT 0x0005 +typedef struct { + uint8_t flt_type; + uint8_t cond_type; + uint8_t condition[0]; +} __attribute__ ((packed)) set_event_flt_cp; +#define SET_EVENT_FLT_CP_SIZE 2 + +/* Filter types */ +#define FLT_CLEAR_ALL 0x00 +#define FLT_INQ_RESULT 0x01 +#define FLT_CONN_SETUP 0x02 + +/* CONN_SETUP Condition types */ +#define CONN_SETUP_ALLOW_ALL 0x00 +#define CONN_SETUP_ALLOW_CLASS 0x01 +#define CONN_SETUP_ALLOW_BDADDR 0x02 + +/* CONN_SETUP Conditions */ +#define CONN_SETUP_AUTO_OFF 0x01 +#define CONN_SETUP_AUTO_ON 0x02 + +#define OCF_CHANGE_LOCAL_NAME 0x0013 +typedef struct { + uint8_t name[248]; +} __attribute__ ((packed)) change_local_name_cp; +#define CHANGE_LOCAL_NAME_CP_SIZE 248 + +#define OCF_READ_LOCAL_NAME 0x0014 +typedef struct { + uint8_t status; + uint8_t name[248]; +} __attribute__ ((packed)) read_local_name_rp; +#define READ_LOCAL_NAME_RP_SIZE 249 + +#define OCF_READ_CLASS_OF_DEV 0x0023 +typedef struct { + uint8_t status; + uint8_t dev_class[3]; +} __attribute__ ((packed)) read_class_of_dev_rp; +#define READ_CLASS_OF_DEV_RP_SIZE 4 + +#define OCF_WRITE_CLASS_OF_DEV 0x0024 +typedef struct { + uint8_t dev_class[3]; +} __attribute__ ((packed)) write_class_of_dev_cp; +#define WRITE_CLASS_OF_DEV_CP_SIZE 3 + +#define OCF_HOST_BUFFER_SIZE 0x0033 +typedef struct { + uint16_t acl_mtu; + uint8_t sco_mtu; + uint16_t acl_max_pkt; + uint16_t sco_max_pkt; +} __attribute__ ((packed)) host_buffer_size_cp; +#define HOST_BUFFER_SIZE_CP_SIZE 7 + +/* Link Control */ +#define OGF_LINK_CTL 0x01 +#define OCF_CREATE_CONN 0x0005 +typedef struct { + bdaddr_t bdaddr; + uint16_t pkt_type; + uint8_t pscan_rep_mode; + uint8_t pscan_mode; + uint16_t clock_offset; + uint8_t role_switch; +} __attribute__ ((packed)) create_conn_cp; +#define CREATE_CONN_CP_SIZE 13 + +#define OCF_ACCEPT_CONN_REQ 0x0009 +typedef struct { + bdaddr_t bdaddr; + uint8_t role; +} __attribute__ ((packed)) accept_conn_req_cp; +#define ACCEPT_CONN_REQ_CP_SIZE 7 + +#define OCF_REJECT_CONN_REQ 0x000a +typedef struct { + bdaddr_t bdaddr; + uint8_t reason; +} __attribute__ ((packed)) reject_conn_req_cp; +#define REJECT_CONN_REQ_CP_SIZE 7 + +#define OCF_DISCONNECT 0x0006 +typedef struct { + uint16_t handle; + uint8_t reason; +} __attribute__ ((packed)) disconnect_cp; +#define DISCONNECT_CP_SIZE 3 + +#define OCF_ADD_SCO 0x0007 +typedef struct { + uint16_t handle; + uint16_t pkt_type; +} __attribute__ ((packed)) add_sco_cp; +#define ADD_SCO_CP_SIZE 4 + +#define OCF_INQUIRY 0x0001 +typedef struct { + uint8_t lap[3]; + uint8_t lenght; + uint8_t num_rsp; +} __attribute__ ((packed)) inquiry_cp; +#define INQUIRY_CP_SIZE 5 + +typedef struct { + uint8_t status; + bdaddr_t bdaddr; +} __attribute__ ((packed)) status_bdaddr_rp; +#define STATUS_BDADDR_RP_SIZE 7 + +#define OCF_LINK_KEY_REPLY 0x000B +#define OCF_LINK_KEY_NEG_REPLY 0x000C +typedef struct { + bdaddr_t bdaddr; + uint8_t link_key[16]; +} __attribute__ ((packed)) link_key_reply_cp; +#define LINK_KEY_REPLY_CP_SIZE 22 + +#define OCF_PIN_CODE_REPLY 0x000D +#define OCF_PIN_CODE_NEG_REPLY 0x000E +typedef struct { + bdaddr_t bdaddr; + uint8_t pin_len; + uint8_t pin_code[16]; +} __attribute__ ((packed)) pin_code_reply_cp; +#define PIN_CODE_REPLY_CP_SIZE 23 + +#define OCF_SET_CONN_PTYPE 0x000F +typedef struct { + uint16_t handle; + uint16_t pkt_type; +} __attribute__ ((packed)) set_conn_ptype_cp; +#define SET_CONN_PKT_TYPE_CP_SIZE 4 + +#define OCF_AUTH_REQUESTED 0x0011 +typedef struct { + uint16_t handle; +} __attribute__ ((packed)) auth_requested_cp; +#define AUTH_REQUESTED_CP_SIZE 2 + +#define OCF_SET_CONN_ENCRYPT 0x0013 +typedef struct { + uint16_t handle; + uint8_t encrypt; +} __attribute__ ((packed)) set_conn_encrypt_cp; +#define SET_CONN_ENCRYPT_CP_SIZE 3 + +#define OCF_REMOTE_NAME_REQ 0x0019 +typedef struct { + bdaddr_t bdaddr; + uint8_t pscan_rep_mode; + uint8_t pscan_mode; + uint16_t clock_offset; +} __attribute__ ((packed)) remote_name_req_cp; +#define REMOTE_NAME_REQ_CP_SIZE 10 + +#define OCF_READ_REMOTE_FEATURES 0x001B +typedef struct { + uint16_t handle; +} __attribute__ ((packed)) read_remote_features_cp; +#define READ_REMOTE_FEATURES_CP_SIZE 2 + +#define OCF_READ_REMOTE_VERSION 0x001D +typedef struct { + uint16_t handle; +} __attribute__ ((packed)) read_remote_version_cp; +#define READ_REMOTE_VERSION_CP_SIZE 2 + +/* Link Policy */ +#define OGF_LINK_POLICY 0x02 +#define OCF_ROLE_DISCOVERY 0x0009 +typedef struct { + uint16_t handle; +} __attribute__ ((packed)) role_discovery_cp; +#define ROLE_DISCOVERY_CP_SIZE 2 +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t role; +} __attribute__ ((packed)) role_discovery_rp; +#define ROLE_DISCOVERY_RP_SIZE 4 + +#define OCF_READ_LINK_POLICY 0x000C +typedef struct { + uint16_t handle; +} __attribute__ ((packed)) read_link_policy_cp; +#define READ_LINK_POLICY_CP_SIZE 2 +typedef struct { + uint8_t status; + uint16_t handle; + uint16_t policy; +} __attribute__ ((packed)) read_link_policy_rp; +#define READ_LINK_POLICY_RP_SIZE 5 + +#define OCF_SWITCH_ROLE 0x000B +typedef struct { + bdaddr_t bdaddr; + uint8_t role; +} __attribute__ ((packed)) switch_role_cp; +#define SWITCH_ROLE_CP_SIZE 7 + +#define OCF_WRITE_LINK_POLICY 0x000D +typedef struct { + uint16_t handle; + uint16_t policy; +} __attribute__ ((packed)) write_link_policy_cp; +#define WRITE_LINK_POLICY_CP_SIZE 4 +typedef struct { + uint8_t status; + uint16_t handle; +} __attribute__ ((packed)) write_link_policy_rp; +#define WRITE_LINK_POLICY_RP_SIZE 3 + +/* Status params */ +#define OGF_STATUS_PARAM 0x05 + +/* ---- HCI Events ---- */ +#define EVT_INQUIRY_COMPLETE 0x01 + +#define EVT_INQUIRY_RESULT 0x02 +typedef struct { + bdaddr_t bdaddr; + uint8_t pscan_rep_mode; + uint8_t pscan_period_mode; + uint8_t pscan_mode; + uint8_t dev_class[3]; + uint16_t clock_offset; +} __attribute__ ((packed)) inquiry_info; +#define INQUIRY_INFO_SIZE 14 + +#define EVT_CONN_COMPLETE 0x03 +typedef struct { + uint8_t status; + uint16_t handle; + bdaddr_t bdaddr; + uint8_t link_type; + uint8_t encr_mode; +} __attribute__ ((packed)) evt_conn_complete; +#define EVT_CONN_COMPLETE_SIZE 13 + +#define EVT_CONN_REQUEST 0x04 +typedef struct { + bdaddr_t bdaddr; + uint8_t dev_class[3]; + uint8_t link_type; +} __attribute__ ((packed)) evt_conn_request; +#define EVT_CONN_REQUEST_SIZE 10 + +#define EVT_DISCONN_COMPLETE 0x05 +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t reason; +} __attribute__ ((packed)) evt_disconn_complete; +#define EVT_DISCONN_COMPLETE_SIZE 4 + +#define EVT_AUTH_COMPLETE 0x06 +typedef struct { + uint8_t status; + uint16_t handle; +} __attribute__ ((packed)) evt_auth_complete; +#define EVT_AUTH_COMPLETE_SIZE 3 + +#define EVT_REMOTE_NAME_REQ_COMPLETE 0x07 +typedef struct { + uint8_t status; + bdaddr_t bdaddr; + uint8_t name[248]; +} __attribute__ ((packed)) evt_remote_name_req_complete; +#define EVT_REMOTE_NAME_REQ_COMPLETE_SIZE 255 + +#define EVT_ENCRYPT_CHANGE 0x08 +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t encrypt; +} __attribute__ ((packed)) evt_encrypt_change; +#define EVT_ENCRYPT_CHANGE_SIZE 5 + +#define EVT_QOS_SETUP_COMPLETE 0x0D +typedef struct { + uint8_t service_type; + uint32_t token_rate; + uint32_t peak_bandwidth; + uint32_t latency; + uint32_t delay_variation; +} __attribute__ ((packed)) hci_qos; +typedef struct { + uint8_t status; + uint16_t handle; + hci_qos qos; +} __attribute__ ((packed)) evt_qos_setup_complete; +#define EVT_QOS_SETUP_COMPLETE_SIZE 20 + +#define EVT_CMD_COMPLETE 0x0e +typedef struct { + uint8_t ncmd; + uint16_t opcode; +} __attribute__ ((packed)) evt_cmd_complete; +#define EVT_CMD_COMPLETE_SIZE 3 + +#define EVT_CMD_STATUS 0x0f +typedef struct { + uint8_t status; + uint8_t ncmd; + uint16_t opcode; +} __attribute__ ((packed)) evt_cmd_status; +#define EVT_CMD_STATUS_SIZE 4 + +#define EVT_NUM_COMP_PKTS 0x13 +typedef struct { + uint8_t num_hndl; + /* variable lenght part */ +} __attribute__ ((packed)) evt_num_comp_pkts; +#define EVT_NUM_COMP_PKTS_SIZE 1 + +#define EVT_ROLE_CHANGE 0x12 +typedef struct { + uint8_t status; + bdaddr_t bdaddr; + uint8_t role; +} __attribute__ ((packed)) evt_role_change; +#define EVT_ROLE_CHANGE_SIZE 1 + +#define EVT_PIN_CODE_REQ 0x16 +typedef struct { + bdaddr_t bdaddr; +} __attribute__ ((packed)) evt_pin_code_req; +#define EVT_PIN_CODE_REQ_SIZE 6 + +#define EVT_LINK_KEY_REQ 0x17 +typedef struct { + bdaddr_t bdaddr; +} __attribute__ ((packed)) evt_link_key_req; +#define EVT_LINK_KEY_REQ_SIZE 6 + +#define EVT_LINK_KEY_NOTIFY 0x18 +typedef struct { + bdaddr_t bdaddr; + uint8_t link_key[16]; + uint8_t key_type; +} __attribute__ ((packed)) evt_link_key_notify; +#define EVT_LINK_KEY_NOTIFY_SIZE 23 + +#define EVT_READ_REMOTE_FEATURES_COMPLETE 0x0B +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t features[8]; +} __attribute__ ((packed)) evt_read_remote_features_complete; +#define EVT_READ_REMOTE_FEATURES_COMPLETE_SIZE 11 + +#define EVT_READ_REMOTE_VERSION_COMPLETE 0x0C +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t lmp_ver; + uint16_t manufacturer; + uint16_t lmp_subver; +} __attribute__ ((packed)) evt_read_remote_version_complete; +#define EVT_READ_REMOTE_VERSION_COMPLETE_SIZE 8 + +/* Internal events generated by BlueZ stack */ +#define EVT_STACK_INTERNAL 0xfd +typedef struct { + uint16_t type; + uint8_t data[0]; +} __attribute__ ((packed)) evt_stack_internal; +#define EVT_STACK_INTERNAL_SIZE 2 + +#define EVT_SI_DEVICE 0x01 +typedef struct { + uint16_t event; + uint16_t dev_id; +} __attribute__ ((packed)) evt_si_device; +#define EVT_SI_DEVICE_SIZE 4 + +#define EVT_SI_SECURITY 0x02 +typedef struct { + uint16_t event; + uint16_t proto; + uint16_t subproto; + uint8_t incomming; +} __attribute__ ((packed)) evt_si_security; + +/* -------- HCI Packet structures -------- */ +#define HCI_TYPE_LEN 1 + +typedef struct { + uint16_t opcode; /* OCF & OGF */ + uint8_t plen; +} __attribute__ ((packed)) hci_command_hdr; +#define HCI_COMMAND_HDR_SIZE 3 + +typedef struct { + uint8_t evt; + uint8_t plen; +} __attribute__ ((packed)) hci_event_hdr; +#define HCI_EVENT_HDR_SIZE 2 + +typedef struct { + uint16_t handle; /* Handle & Flags(PB, BC) */ + uint16_t dlen; +} __attribute__ ((packed)) hci_acl_hdr; +#define HCI_ACL_HDR_SIZE 4 + +typedef struct { + uint16_t handle; + uint8_t dlen; +} __attribute__ ((packed)) hci_sco_hdr; +#define HCI_SCO_HDR_SIZE 3 + +/* Command opcode pack/unpack */ +#define cmd_opcode_pack(ogf, ocf) (uint16_t)((ocf & 0x03ff)|(ogf << 10)) +#define cmd_opcode_ogf(op) (op >> 10) +#define cmd_opcode_ocf(op) (op & 0x03ff) + +/* ACL handle and flags pack/unpack */ +#define acl_handle_pack(h, f) (uint16_t)((h & 0x0fff)|(f << 12)) +#define acl_handle(h) (h & 0x0fff) +#define acl_flags(h) (h >> 12) + +#endif /* _NO_HCI_DEFS */ + +/* HCI Socket options */ +#define HCI_DATA_DIR 1 +#define HCI_FILTER 2 +#define HCI_TIME_STAMP 3 + +/* HCI CMSG flags */ +#define HCI_CMSG_DIR 0x0001 +#define HCI_CMSG_TSTAMP 0x0002 + +struct sockaddr_hci { + sa_family_t hci_family; + unsigned short hci_dev; +}; +#define HCI_DEV_NONE 0xffff + +struct hci_filter { + uint32_t type_mask; + uint32_t event_mask[2]; + uint16_t opcode; +}; + +#define HCI_FLT_TYPE_BITS 31 +#define HCI_FLT_EVENT_BITS 63 +#define HCI_FLT_OGF_BITS 63 +#define HCI_FLT_OCF_BITS 127 + +/* Ioctl requests structures */ +struct hci_dev_stats { + uint32_t err_rx; + uint32_t err_tx; + uint32_t cmd_tx; + uint32_t evt_rx; + uint32_t acl_tx; + uint32_t acl_rx; + uint32_t sco_tx; + uint32_t sco_rx; + uint32_t byte_rx; + uint32_t byte_tx; +}; + +struct hci_dev_info { + uint16_t dev_id; + char name[8]; + + bdaddr_t bdaddr; + + uint32_t flags; + uint8_t type; + + uint8_t features[8]; + + uint32_t pkt_type; + uint32_t link_policy; + uint32_t link_mode; + + uint16_t acl_mtu; + uint16_t acl_max; + uint16_t sco_mtu; + uint16_t sco_max; + + struct hci_dev_stats stat; +}; + +struct hci_conn_info { + uint16_t handle; + bdaddr_t bdaddr; + uint8_t type; + uint8_t out; + uint16_t state; + uint32_t link_mode; +}; + +struct hci_dev_req { + uint16_t dev_id; + uint32_t dev_opt; +}; + +struct hci_dev_list_req { + uint16_t dev_num; + struct hci_dev_req dev_req[0]; /* hci_dev_req structures */ +}; + +struct hci_conn_list_req { + uint16_t dev_id; + uint16_t conn_num; + struct hci_conn_info conn_info[0]; +}; + +struct hci_conn_info_req { + bdaddr_t bdaddr; + uint8_t type; + struct hci_conn_info conn_info[0]; +}; + +struct hci_inquiry_req { + uint16_t dev_id; + uint16_t flags; + uint8_t lap[3]; + uint8_t length; + uint8_t num_rsp; +}; +#define IREQ_CACHE_FLUSH 0x0001 + +struct hci_remotename_req { + uint16_t dev_id; + uint16_t flags; + bdaddr_t bdaddr; + uint8_t name[248]; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* __HCI_H */ diff --git a/include/hci_lib.h b/include/hci_lib.h new file mode 100644 index 00000000..0776e1ba --- /dev/null +++ b/include/hci_lib.h @@ -0,0 +1,115 @@ +/* + BlueZ - Bluetooth protocol stack for Linux + Copyright (C) 2000-2001 Qualcomm Incorporated + + Written 2000,2001 by Maxim Krasnyansky + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + SOFTWARE IS DISCLAIMED. +*/ + +/* + * $Id$ + */ + +#ifndef __HCI_LIB_H +#define __HCI_LIB_H + +#ifdef __cplusplus +extern "C" { +#endif + +struct hci_request { + uint16_t ogf; + uint16_t ocf; + int event; + void *cparam; + int clen; + void *rparam; + int rlen; +}; + +struct hci_version { + uint16_t manufacturer; + uint8_t hci_ver; + uint16_t hci_rev; + uint8_t lmp_ver; + uint16_t lmp_subver; +}; + +int hci_open_dev(int dev_id); +int hci_close_dev(int dd); +int hci_send_cmd(int dd, uint16_t ogf, uint16_t ocf, uint8_t plen, void *param); +int hci_send_req(int dd, struct hci_request *req, int timeout); + +int hci_create_connection(int dd, bdaddr_t *ba, int ptype, int rswitch, int to); +int hci_disconnect(int dd, int hndl, int res, int to); + +inquiry_info *hci_inquiry(int dev_id, int len, int *num_rsp, uint8_t *lap, long flags); +int hci_devinfo(int dev_id, struct hci_dev_info *di); + +int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); +int hci_read_remote_features(int dd, int hndl, uint8_t *features, int to); +int hci_read_remote_version(int dd, int hndl, struct hci_version *ver, int to); +int hci_read_local_version(int dd, struct hci_version *ver, int to); + +char *hci_dtypetostr(int type); +char *hci_dflagstostr(uint32_t flags); +char *hci_ptypetostr(unsigned int ptype); +int hci_strtoptype(char *str, unsigned int *val); +char *hci_lptostr(unsigned int ptype); +int hci_strtolp(char *str, unsigned int *val); +char *hci_lmtostr(unsigned int ptype); +int hci_strtolm(char *str, unsigned int *val); + +static inline void hci_set_bit(int nr, void *addr) +{ + *((uint32_t *) addr + (nr >> 5)) |= (1 << (nr & 31)); +} + +static inline int hci_test_bit(int nr, void *addr) +{ + return *((uint32_t *) addr + (nr >> 5)) & (1 << (nr & 31)); +} + +/* HCI filter tools */ +static inline void hci_filter_clear(struct hci_filter *f) +{ + memset(f, 0, sizeof(*f)); +} +static inline void hci_filter_set_ptype(int t, struct hci_filter *f) +{ + hci_set_bit((t & HCI_FLT_TYPE_BITS), &f->type_mask); +} +static inline void hci_filter_set_event(int e, struct hci_filter *f) +{ + hci_set_bit((e & HCI_FLT_EVENT_BITS), &f->event_mask); +} +static inline void hci_filter_all_events(struct hci_filter *f) +{ + memset((void *)f->event_mask, 0xff, sizeof(f->event_mask)); +} +static inline void hci_filter_set_opcode(int opcode, struct hci_filter *f) +{ + f->opcode = opcode; +} + +#ifdef __cplusplus +} +#endif + +#endif /* __HCI_LIB_H */ diff --git a/include/hci_uart.h b/include/hci_uart.h new file mode 100644 index 00000000..e609ed47 --- /dev/null +++ b/include/hci_uart.h @@ -0,0 +1,45 @@ +/* + BlueZ - Bluetooth protocol stack for Linux + Copyright (C) 2000-2001 Qualcomm Incorporated + + Written 2000,2001 by Maxim Krasnyansky + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + SOFTWARE IS DISCLAIMED. +*/ + +/* + * $Id$ + */ + +#ifndef __HCI_UART_H +#define __HCI_UART_H + +#ifndef N_HCI +#define N_HCI 15 +#endif + +/* Ioctls */ +#define HCIUARTSETPROTO _IOW('U', 200, int) +#define HCIUARTGETPROTO _IOR('U', 201, int) + +/* UART protocols */ +#define HCI_UART_H4 0 +#define HCI_UART_BCSP 1 +#define HCI_UART_NCSP 2 + +#endif /* __HCI_UART_H */ diff --git a/include/hci_vhci.h b/include/hci_vhci.h new file mode 100644 index 00000000..4eee6656 --- /dev/null +++ b/include/hci_vhci.h @@ -0,0 +1,35 @@ +/* + BlueZ - Bluetooth protocol stack for Linux + Copyright (C) 2000-2001 Qualcomm Incorporated + + Written 2000,2001 by Maxim Krasnyansky + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + SOFTWARE IS DISCLAIMED. +*/ + +/* + * $Id$ + */ + +#ifndef __HCI_VHCI_H +#define __HCI_VHCI_H + +#define VHCI_DEV "/dev/vhci" +#define VHCI_MINOR 250 + +#endif /* __HCI_VHCI_H */ diff --git a/include/l2cap.h b/include/l2cap.h new file mode 100644 index 00000000..25178401 --- /dev/null +++ b/include/l2cap.h @@ -0,0 +1,200 @@ +/* + BlueZ - Bluetooth protocol stack for Linux + Copyright (C) 2000-2001 Qualcomm Incorporated + + Written 2000,2001 by Maxim Krasnyansky + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + SOFTWARE IS DISCLAIMED. +*/ + +/* + * $Id$ + */ + +#ifndef __L2CAP_H +#define __L2CAP_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* L2CAP defaults */ +#define L2CAP_DEFAULT_MTU 672 +#define L2CAP_DEFAULT_FLUSH_TO 0xFFFF + +#define L2CAP_CONN_TIMEOUT (HZ * 40) + +/* L2CAP socket address */ +struct sockaddr_l2 { + sa_family_t l2_family; + unsigned short l2_psm; + bdaddr_t l2_bdaddr; +}; + +/* Socket options */ +#define L2CAP_OPTIONS 0x01 +struct l2cap_options { + uint16_t omtu; + uint16_t imtu; + uint16_t flush_to; +}; + +#define L2CAP_CONNINFO 0x02 +struct l2cap_conninfo { + uint16_t hci_handle; +}; + +#define L2CAP_LM 0x03 +#define L2CAP_LM_MASTER 0x0001 +#define L2CAP_LM_AUTH 0x0002 +#define L2CAP_LM_ENCRYPT 0x0004 +#define L2CAP_LM_TRUSTED 0x0008 + +#define L2CAP_QOS 0x04 +struct l2cap_qos { + uint16_t service_type; + uint32_t token_rate; + uint32_t token_bucket_size; + uint32_t peak_bandwidth; + uint32_t latency; + uint32_t delay_variation; +}; + +#define L2CAP_SERV_NO_TRAFFIC 0x00 +#define L2CAP_SERV_BEST_EFFORT 0x01 +#define L2CAP_SERV_GUARANTEED 0x02 + +/* L2CAP command codes */ +#define L2CAP_COMMAND_REJ 0x01 +#define L2CAP_CONN_REQ 0x02 +#define L2CAP_CONN_RSP 0x03 +#define L2CAP_CONF_REQ 0x04 +#define L2CAP_CONF_RSP 0x05 +#define L2CAP_DISCONN_REQ 0x06 +#define L2CAP_DISCONN_RSP 0x07 +#define L2CAP_ECHO_REQ 0x08 +#define L2CAP_ECHO_RSP 0x09 +#define L2CAP_INFO_REQ 0x0a +#define L2CAP_INFO_RSP 0x0b + +/* L2CAP structures */ +typedef struct { + uint16_t len; + uint16_t cid; +} __attribute__ ((packed)) l2cap_hdr; +#define L2CAP_HDR_SIZE 4 + +typedef struct { + uint8_t code; + uint8_t ident; + uint16_t len; +} __attribute__ ((packed)) l2cap_cmd_hdr; +#define L2CAP_CMD_HDR_SIZE 4 + +typedef struct { + uint16_t reason; +} __attribute__ ((packed)) l2cap_cmd_rej; +#define L2CAP_CMD_REJ_SIZE 2 + +typedef struct { + uint16_t psm; + uint16_t scid; +} __attribute__ ((packed)) l2cap_conn_req; +#define L2CAP_CONN_REQ_SIZE 4 + +typedef struct { + uint16_t dcid; + uint16_t scid; + uint16_t result; + uint16_t status; +} __attribute__ ((packed)) l2cap_conn_rsp; +#define L2CAP_CONN_RSP_SIZE 8 + +/* connect result */ +#define L2CAP_CR_SUCCESS 0x0000 +#define L2CAP_CR_PEND 0x0001 +#define L2CAP_CR_BAD_PSM 0x0002 +#define L2CAP_CR_SEC_BLOCK 0x0003 +#define L2CAP_CR_NO_MEM 0x0004 + +/* connect status */ +#define L2CAP_CS_NO_INFO 0x0000 +#define L2CAP_CS_AUTHEN_PEND 0x0001 +#define L2CAP_CS_AUTHOR_PEND 0x0002 + +typedef struct { + uint16_t dcid; + uint16_t flags; + uint8_t data[0]; +} __attribute__ ((packed)) l2cap_conf_req; +#define L2CAP_CONF_REQ_SIZE 4 + +typedef struct { + uint16_t scid; + uint16_t flags; + uint16_t result; + uint8_t data[0]; +} __attribute__ ((packed)) l2cap_conf_rsp; +#define L2CAP_CONF_RSP_SIZE 6 + +#define L2CAP_CONF_SUCCESS 0x00 +#define L2CAP_CONF_UNACCEPT 0x01 + +typedef struct { + uint8_t type; + uint8_t len; + uint8_t val[0]; +} __attribute__ ((packed)) l2cap_conf_opt; +#define L2CAP_CONF_OPT_SIZE 2 + +#define L2CAP_CONF_MTU 0x01 +#define L2CAP_CONF_FLUSH_TO 0x02 +#define L2CAP_CONF_QOS 0x03 + +#define L2CAP_CONF_MAX_SIZE 22 + +typedef struct { + uint16_t dcid; + uint16_t scid; +} __attribute__ ((packed)) l2cap_disconn_req; +#define L2CAP_DISCONN_REQ_SIZE 4 + +typedef struct { + uint16_t dcid; + uint16_t scid; +} __attribute__ ((packed)) l2cap_disconn_rsp; +#define L2CAP_DISCONN_RSP_SIZE 4 + +typedef struct { + uint16_t type; + uint8_t data[0]; +} __attribute__ ((packed)) l2cap_info_req; +#define L2CAP_INFO_REQ_SIZE 2 + +typedef struct { + uint16_t type; + uint16_t result; + uint8_t data[0]; +} __attribute__ ((packed)) l2cap_info_rsp; +#define L2CAP_INFO_RSP_SIZE 4 + +#ifdef __cplusplus +} +#endif + +#endif /* __L2CAP_H */ diff --git a/include/sco.h b/include/sco.h new file mode 100644 index 00000000..c02bd7ae --- /dev/null +++ b/include/sco.h @@ -0,0 +1,65 @@ +/* + BlueZ - Bluetooth protocol stack for Linux + Copyright (C) 2000-2001 Qualcomm Incorporated + + Written 2000,2001 by Maxim Krasnyansky + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + SOFTWARE IS DISCLAIMED. +*/ + +/* + * $Id$ + */ + +#ifndef __SCO_H +#define __SCO_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* SCO defaults */ +#define SCO_DEFAULT_MTU 500 +#define SCO_DEFAULT_FLUSH_TO 0xFFFF + +#define SCO_CONN_TIMEOUT (HZ * 40) +#define SCO_DISCONN_TIMEOUT (HZ * 2) +#define SCO_CONN_IDLE_TIMEOUT (HZ * 60) + +/* SCO socket address */ +struct sockaddr_sco { + sa_family_t sco_family; + bdaddr_t sco_bdaddr; +}; + +/* set/get sockopt defines */ +#define SCO_OPTIONS 0x01 +struct sco_options { + uint16_t mtu; +}; + +#define SCO_CONNINFO 0x02 +struct sco_conninfo { + uint16_t hci_handle; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* __SCO_H */ -- cgit From 2c4532ba9feb08d1e37ca785bde83330d9cb4b71 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 12 Mar 2002 18:58:39 +0000 Subject: Missing includes. Cleanup. --- include/bluetooth.h | 1 + include/hci.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index 441e1d3a..5dd4085f 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -35,6 +35,7 @@ extern "C" { #include #include +#include #ifndef AF_BLUETOOTH #define AF_BLUETOOTH 31 diff --git a/include/hci.h b/include/hci.h index 3f98ab1d..38060fb8 100644 --- a/include/hci.h +++ b/include/hci.h @@ -33,7 +33,7 @@ extern "C" { #endif -#define HCI_MAX_DEV 4 +#define HCI_MAX_DEV 16 #define HCI_MAX_ACL_SIZE 1024 #define HCI_MAX_SCO_SIZE 255 -- cgit From 9ff2c721bb4ff84ad15e4593404bf47941315337 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 19 Mar 2002 17:35:54 +0000 Subject: Added hci_local_name function. --- include/hci_lib.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index 0776e1ba..5a5d2ae7 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -62,6 +62,7 @@ int hci_disconnect(int dd, int hndl, int res, int to); inquiry_info *hci_inquiry(int dev_id, int len, int *num_rsp, uint8_t *lap, long flags); int hci_devinfo(int dev_id, struct hci_dev_info *di); +int hci_local_name(int dd, int len, char *name, int to); int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); int hci_read_remote_features(int dd, int hndl, uint8_t *features, int to); int hci_read_remote_version(int dd, int hndl, struct hci_version *ver, int to); -- cgit From 54e7db35ec328da8e131a70d757904f2bbaa2083 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 19 Mar 2002 18:07:03 +0000 Subject: Inquiry activity defines. --- include/hci.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 38060fb8..5fcc8c1e 100644 --- a/include/hci.h +++ b/include/hci.h @@ -206,6 +206,22 @@ typedef struct { /* Host Controller and Baseband */ #define OGF_HOST_CTL 0x03 #define OCF_RESET 0x0003 + +#define OCF_READ_INQ_ACTIVITY 0x001D +typedef struct { + uint8_t status; + uint16_t interval; + uint16_t window; +} __attribute__ ((packed)) read_inq_activity_rp; +#define READ_INQ_ACTIVITY_RP_SIZE 5 + +#define OCF_WRITE_INQ_ACTIVITY 0x001E +typedef struct { + uint16_t interval; + uint16_t window; +} __attribute__ ((packed)) write_inq_activity_cp; +#define WRITE_INQ_ACTIVITY_CP_SIZE 4 + #define OCF_READ_AUTH_ENABLE 0x001F #define OCF_WRITE_AUTH_ENABLE 0x0020 #define AUTH_DISABLED 0x00 -- cgit From be6ddaecae3cb232e79c2f7bbcc2c9277ec4494b Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 19 Mar 2002 18:19:12 +0000 Subject: HCI filter additions. --- include/hci_lib.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index 5a5d2ae7..28a32993 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -96,6 +96,10 @@ static inline void hci_filter_set_ptype(int t, struct hci_filter *f) { hci_set_bit((t & HCI_FLT_TYPE_BITS), &f->type_mask); } +static inline void hci_filter_all_ptypes(struct hci_filter *f) +{ + memset((void *)&f->type_mask, 0xff, sizeof(f->type_mask)); +} static inline void hci_filter_set_event(int e, struct hci_filter *f) { hci_set_bit((e & HCI_FLT_EVENT_BITS), &f->event_mask); -- cgit From e5049f81cd29f935a2465c430f5db8f15765d46d Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Wed, 20 Mar 2002 17:59:04 +0000 Subject: Typo correction. --- include/hci.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 5fcc8c1e..a9b23ffd 100644 --- a/include/hci.h +++ b/include/hci.h @@ -342,7 +342,7 @@ typedef struct { #define OCF_INQUIRY 0x0001 typedef struct { uint8_t lap[3]; - uint8_t lenght; + uint8_t length; uint8_t num_rsp; } __attribute__ ((packed)) inquiry_cp; #define INQUIRY_CP_SIZE 5 @@ -555,7 +555,7 @@ typedef struct { #define EVT_NUM_COMP_PKTS 0x13 typedef struct { uint8_t num_hndl; - /* variable lenght part */ + /* variable length part */ } __attribute__ ((packed)) evt_num_comp_pkts; #define EVT_NUM_COMP_PKTS_SIZE 1 -- cgit From a51747b602f9cd03c7431788f80431c1710f5827 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Thu, 21 Mar 2002 23:20:32 +0000 Subject: Additional strtoXX and XXtostr functions. --- include/bluetooth.h | 3 ++- include/hci_lib.h | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index 5dd4085f..ee345616 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -103,7 +103,8 @@ char *batostr(bdaddr_t *ba); int ba2str(bdaddr_t *ba, char *str); int str2ba(char *str, bdaddr_t *ba); -int bterr(uint16_t code); +int bt_error(uint16_t code); +char *bt_compidtostr(int id); #ifdef __cplusplus } diff --git a/include/hci_lib.h b/include/hci_lib.h index 28a32993..c590150d 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -77,6 +77,11 @@ int hci_strtolp(char *str, unsigned int *val); char *hci_lmtostr(unsigned int ptype); int hci_strtolm(char *str, unsigned int *val); +char *hci_vertostr(unsigned int ver); +int hci_strtover(char *str, unsigned int *ver); +char *lmp_vertostr(unsigned int ver); +int lmp_strtover(char *str, unsigned int *ver); + static inline void hci_set_bit(int nr, void *addr) { *((uint32_t *) addr + (nr >> 5)) |= (1 << (nr & 31)); -- cgit From 0a6472fe170438016c23c71d9129e627f26cd398 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Fri, 22 Mar 2002 19:45:46 +0000 Subject: Fixed compiler options and warnings. Proper parameter types. Cleanup. --- include/hci_lib.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index c590150d..ed3306ab 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -56,16 +56,16 @@ int hci_close_dev(int dd); int hci_send_cmd(int dd, uint16_t ogf, uint16_t ocf, uint8_t plen, void *param); int hci_send_req(int dd, struct hci_request *req, int timeout); -int hci_create_connection(int dd, bdaddr_t *ba, int ptype, int rswitch, int to); -int hci_disconnect(int dd, int hndl, int res, int to); +int hci_create_connection(int dd, bdaddr_t *ba, uint16_t ptype, uint16_t clkoffset, uint8_t rswitch, uint16_t *handle, int to); +int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to); inquiry_info *hci_inquiry(int dev_id, int len, int *num_rsp, uint8_t *lap, long flags); int hci_devinfo(int dev_id, struct hci_dev_info *di); int hci_local_name(int dd, int len, char *name, int to); int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); -int hci_read_remote_features(int dd, int hndl, uint8_t *features, int to); -int hci_read_remote_version(int dd, int hndl, struct hci_version *ver, int to); +int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); +int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); int hci_read_local_version(int dd, struct hci_version *ver, int to); char *hci_dtypetostr(int type); -- cgit From 1247cae735e039a593f42ce9867f8cf8e68effee Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 26 Mar 2002 17:59:19 +0000 Subject: New ioctls. Minor cleanups. --- include/hci.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index a9b23ffd..ef07bc06 100644 --- a/include/hci.h +++ b/include/hci.h @@ -86,6 +86,8 @@ enum { #define HCISETPTYPE _IOW('H', 224, int) #define HCISETLINKPOL _IOW('H', 225, int) #define HCISETLINKMODE _IOW('H', 226, int) +#define HCISETACLMTU _IOW('H', 227, int) +#define HCISETSCOMTU _IOW('H', 228, int) #define HCIINQUIRY _IOR('H', 240, int) @@ -723,11 +725,11 @@ struct hci_dev_info { uint32_t link_mode; uint16_t acl_mtu; - uint16_t acl_max; + uint16_t acl_pkts; uint16_t sco_mtu; - uint16_t sco_max; + uint16_t sco_pkts; - struct hci_dev_stats stat; + struct hci_dev_stats stat; }; struct hci_conn_info { -- cgit From 59fa39d1686237493fce068472e195a709134a39 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Thu, 28 Mar 2002 20:48:45 +0000 Subject: Fix compiler warnings. --- include/bluetooth.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index ee345616..8d1c7c51 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -36,6 +36,7 @@ extern "C" { #include #include #include +#include #ifndef AF_BLUETOOTH #define AF_BLUETOOTH 31 -- cgit From dac18f34e1080e84d779496232a838c5bc570ddd Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Sun, 31 Mar 2002 05:14:51 +0000 Subject: Added BDADDR_LOCAL --- include/bluetooth.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index 8d1c7c51..8026832b 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -86,7 +86,8 @@ typedef struct { uint8_t b[6]; } __attribute__((packed)) bdaddr_t; -#define BDADDR_ANY ((bdaddr_t *)"\000\000\000\000\000") +#define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}}) +#define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}}) /* Copy, swap, convert BD Address */ static inline int bacmp(bdaddr_t *ba1, bdaddr_t *ba2) -- cgit From cf7340b7aa8fc1a5cae9bc55b368ef4b110cebc0 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Wed, 3 Apr 2002 17:45:50 +0000 Subject: Added status commands --- include/hci.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index ef07bc06..65eabc62 100644 --- a/include/hci.h +++ b/include/hci.h @@ -461,6 +461,37 @@ typedef struct { /* Status params */ #define OGF_STATUS_PARAM 0x05 +#define OCF_READ_FAILED_CONTACT_COUNTER 0x0001 +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t counter; +} __attribute__ ((packed)) read_failed_contact_counter_rp; +#define READ_FAILED_CONTACT_COUNTER_RP_SIZE 4 + +#define OCF_RESET_FAILED_CONTACT_COUNTER 0x0002 +typedef struct { + uint8_t status; + uint16_t handle; +} __attribute__ ((packed)) reset_failed_contact_counter_rp; +#define OCF_RESET_FAILED_CONTACT_COUNTER_RP_SIZE 4 + +#define OCF_GET_LINK_QUALITY 0x0003 +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t link_quality; +} __attribute__ ((packed)) get_link_quality_rp; +#define GET_LINK_QUALITY_RP_SIZE 4 + +#define OCF_READ_RSSI 0x0005 +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t rssi; +} __attribute__ ((packed)) read_rssi_rp; +#define READ_RSSI_RP_SIZE 4 + /* ---- HCI Events ---- */ #define EVT_INQUIRY_COMPLETE 0x01 -- cgit From 8dab9b0bcab616bde55a3a137bd6fb8818ced4a5 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Thu, 11 Apr 2002 16:56:10 +0000 Subject: Added LMP features to sting translation function and table. --- include/hci.h | 3 ++- include/hci_lib.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 65eabc62..4610ac00 100644 --- a/include/hci.h +++ b/include/hci.h @@ -139,7 +139,7 @@ enum { #define LMP_TACCURACY 0x10 #define LMP_RSWITCH 0x20 #define LMP_HOLD 0x40 -#define LMP_SNIF 0x80 +#define LMP_SNIFF 0x80 #define LMP_PARK 0x01 #define LMP_RSSI 0x02 @@ -153,6 +153,7 @@ enum { #define LMP_CVSD 0x01 #define LMP_PSCHEME 0x02 #define LMP_PCONTROL 0x04 +#define LMP_TRSP_SCO 0x08 /* Link policies */ #define HCI_LP_RSWITCH 0x0001 diff --git a/include/hci_lib.h b/include/hci_lib.h index ed3306ab..10374a30 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -82,6 +82,8 @@ int hci_strtover(char *str, unsigned int *ver); char *lmp_vertostr(unsigned int ver); int lmp_strtover(char *str, unsigned int *ver); +char *lmp_featurestostr(uint8_t *features, char *pref, int width); + static inline void hci_set_bit(int nr, void *addr) { *((uint32_t *) addr + (nr >> 5)) |= (1 << (nr & 31)); -- cgit From 083ac35c0e178f548da930e91fe4154a4993af0e Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Thu, 11 Apr 2002 18:19:58 +0000 Subject: Added hci_class_of_dev function. hci_req initialization cleanup. --- include/hci_lib.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index 10374a30..5a49fd35 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -67,6 +67,7 @@ int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); int hci_read_local_version(int dd, struct hci_version *ver, int to); +int hci_class_of_dev(int dd, uint8_t *class, int to); char *hci_dtypetostr(int type); char *hci_dflagstostr(uint32_t flags); -- cgit From 16591cb20976879e8189d46d24ed1b41b0941a27 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Mon, 22 Apr 2002 20:12:15 +0000 Subject: Additional hci_filter_ functions --- include/hci_lib.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index 5a49fd35..ecf180be 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -90,6 +90,11 @@ static inline void hci_set_bit(int nr, void *addr) *((uint32_t *) addr + (nr >> 5)) |= (1 << (nr & 31)); } +static inline void hci_clear_bit(int nr, void *addr) +{ + *((uint32_t *) addr + (nr >> 5)) &= ~(1 << (nr & 31)); +} + static inline int hci_test_bit(int nr, void *addr) { return *((uint32_t *) addr + (nr >> 5)) & (1 << (nr & 31)); @@ -104,6 +109,14 @@ static inline void hci_filter_set_ptype(int t, struct hci_filter *f) { hci_set_bit((t & HCI_FLT_TYPE_BITS), &f->type_mask); } +static inline void hci_filter_clear_ptype(int t, struct hci_filter *f) +{ + hci_clear_bit((t & HCI_FLT_TYPE_BITS), &f->type_mask); +} +static inline int hci_filter_test_ptype(int t, struct hci_filter *f) +{ + return hci_test_bit((t & HCI_FLT_TYPE_BITS), &f->type_mask); +} static inline void hci_filter_all_ptypes(struct hci_filter *f) { memset((void *)&f->type_mask, 0xff, sizeof(f->type_mask)); @@ -112,6 +125,14 @@ static inline void hci_filter_set_event(int e, struct hci_filter *f) { hci_set_bit((e & HCI_FLT_EVENT_BITS), &f->event_mask); } +static inline void hci_filter_clear_event(int e, struct hci_filter *f) +{ + hci_clear_bit((e & HCI_FLT_EVENT_BITS), &f->event_mask); +} +static inline int hci_filter_test_event(int e, struct hci_filter *f) +{ + return hci_test_bit((e & HCI_FLT_EVENT_BITS), &f->event_mask); +} static inline void hci_filter_all_events(struct hci_filter *f) { memset((void *)f->event_mask, 0xff, sizeof(f->event_mask)); @@ -120,6 +141,14 @@ static inline void hci_filter_set_opcode(int opcode, struct hci_filter *f) { f->opcode = opcode; } +static inline void hci_filter_clear_opcode(int opcode, struct hci_filter *f) +{ + f->opcode = 0; +} +static inline int hci_filter_test_opcode(int opcode, struct hci_filter *f) +{ + return (f->opcode == opcode); +} #ifdef __cplusplus } -- cgit From 807d006ed3259907b450642536cad6123431acf9 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Mon, 6 May 2002 20:54:32 +0000 Subject: Add BNEP socket proto. --- include/bluetooth.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index 8026832b..b93c4e35 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -47,6 +47,7 @@ extern "C" { #define BTPROTO_HCI 1 #define BTPROTO_SCO 2 #define BTPROTO_RFCOMM 3 +#define BTPROTO_BNEP 4 #define SOL_HCI 0 #define SOL_L2CAP 6 -- cgit From 8e9ea9b77e3c4eaf1f1813cfa1e275c7b7ef219a Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Fri, 17 May 2002 01:09:28 +0000 Subject: Fix "make dist" --- include/Makefile.am | 2 ++ include/Makefile.in | 6 ++++++ 2 files changed, 8 insertions(+) (limited to 'include') diff --git a/include/Makefile.am b/include/Makefile.am index dceb3447..53b05244 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -4,6 +4,8 @@ hdrdir = $(prefix)/include/bluetooth +EXTRA_DIST = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h + install-data-local: $(mkinstalldirs) $(DESTDIR)$(hdrdir) $(INSTALL) -m 644 $(srcdir)/*.h $(DESTDIR)$(hdrdir) diff --git a/include/Makefile.in b/include/Makefile.in index 5a8de87a..78aa59f9 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -61,8 +61,12 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : +build_alias = @build_alias@ +build_triplet = @build@ host_alias = @host_alias@ host_triplet = @host@ +target_alias = @target_alias@ +target_triplet = @target@ AR = @AR@ AS = @AS@ CC = @CC@ @@ -81,6 +85,8 @@ STRIP = @STRIP@ VERSION = @VERSION@ hdrdir = $(prefix)/include/bluetooth + +EXTRA_DIST = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = DIST_COMMON = Makefile.am Makefile.in -- cgit From bf19cd7953fbc8cc916b9514d8f11fc8557f0cec Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Fri, 17 May 2002 17:12:30 +0000 Subject: Add hci_devba function --- include/hci_lib.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index ecf180be..02c56a1f 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -61,6 +61,7 @@ int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to); inquiry_info *hci_inquiry(int dev_id, int len, int *num_rsp, uint8_t *lap, long flags); int hci_devinfo(int dev_id, struct hci_dev_info *di); +int hci_devba(int dev_id, bdaddr_t *ba); int hci_local_name(int dd, int len, char *name, int to); int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); -- cgit From 468f117f4ce1090cec1cc1928676c449434eb9a3 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Sat, 18 May 2002 00:30:02 +0000 Subject: SET_CONN_PTYPE defin fix. --- include/hci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 4610ac00..d6946976 100644 --- a/include/hci.h +++ b/include/hci.h @@ -378,7 +378,7 @@ typedef struct { uint16_t handle; uint16_t pkt_type; } __attribute__ ((packed)) set_conn_ptype_cp; -#define SET_CONN_PKT_TYPE_CP_SIZE 4 +#define SET_CONN_PTYPE_CP_SIZE 4 #define OCF_AUTH_REQUESTED 0x0011 typedef struct { -- cgit From 4bbdd73f337a0e1f76597c93bb3bda99cea4a550 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Thu, 23 May 2002 20:26:01 +0000 Subject: Build env cleanup. Remove auto generated files from CVS. Working 'make distcheck'. --- include/Makefile.am | 8 +-- include/Makefile.in | 200 ---------------------------------------------------- 2 files changed, 2 insertions(+), 206 deletions(-) delete mode 100644 include/Makefile.in (limited to 'include') diff --git a/include/Makefile.am b/include/Makefile.am index 53b05244..f4a9f308 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -2,10 +2,6 @@ # $Id$ # -hdrdir = $(prefix)/include/bluetooth +includedir = @includedir@/bluetooth -EXTRA_DIST = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h - -install-data-local: - $(mkinstalldirs) $(DESTDIR)$(hdrdir) - $(INSTALL) -m 644 $(srcdir)/*.h $(DESTDIR)$(hdrdir) +include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h diff --git a/include/Makefile.in b/include/Makefile.in deleted file mode 100644 index 78aa59f9..00000000 --- a/include/Makefile.in +++ /dev/null @@ -1,200 +0,0 @@ -# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am - -# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# -# $Id$ -# - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_alias = @build_alias@ -build_triplet = @build@ -host_alias = @host_alias@ -host_triplet = @host@ -target_alias = @target_alias@ -target_triplet = @target@ -AR = @AR@ -AS = @AS@ -CC = @CC@ -DLLTOOL = @DLLTOOL@ -ECHO = @ECHO@ -EXEEXT = @EXEEXT@ -LD = @LD@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -MAKEINFO = @MAKEINFO@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -STRIP = @STRIP@ -VERSION = @VERSION@ - -hdrdir = $(prefix)/include/bluetooth - -EXTRA_DIST = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_CLEAN_FILES = -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = gtar -GZIP_ENV = --best -all: all-redirect -.SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - -tags: TAGS -TAGS: - - -distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = include - -distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu include/Makefile - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: -install-exec: install-exec-am - -install-data-am: install-data-local -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: -uninstall: uninstall-am -all-am: Makefile -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - - -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* - -maintainer-clean-generic: -mostlyclean-am: mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-generic clean-am - -rm -f libtool - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-generic distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - -maintainer-clean: maintainer-clean-am - -.PHONY: tags distdir info-am info dvi-am dvi check check-am \ -installcheck-am installcheck install-exec-am install-exec \ -install-data-local install-data-am install-data install-am install \ -uninstall-am uninstall all-redirect all-am all installdirs \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -install-data-local: - $(mkinstalldirs) $(DESTDIR)$(hdrdir) - $(INSTALL) -m 644 $(srcdir)/*.h $(DESTDIR)$(hdrdir) - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: -- cgit From 9bf1d0ca2ad3beefb98c8f1a08c8188dfaedf579 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Mon, 27 May 2002 02:25:33 +0000 Subject: Libtoolize and fix top level build. Make cleanup. --- include/Makefile.am | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/Makefile.am b/include/Makefile.am index f4a9f308..794a4c55 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -5,3 +5,10 @@ includedir = @includedir@/bluetooth include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h + +bluetooth: + ln -s . bluetooth + +all-local: bluetooth +clean-local: + rm -f bluetooth -- cgit From 4837bd7e9ba55361aeca45610a160dd107d5be2f Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 18 Jun 2002 16:46:54 +0000 Subject: Fix inquiry function to return errors and accept user buffers. New functions hci_for_each_dev and hci_get_route. --- include/hci_lib.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index 02c56a1f..7fd95cfc 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -59,7 +59,7 @@ int hci_send_req(int dd, struct hci_request *req, int timeout); int hci_create_connection(int dd, bdaddr_t *ba, uint16_t ptype, uint16_t clkoffset, uint8_t rswitch, uint16_t *handle, int to); int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to); -inquiry_info *hci_inquiry(int dev_id, int len, int *num_rsp, uint8_t *lap, long flags); +int hci_inquiry(int dev_id, int len, int num_rsp, uint8_t *lap, inquiry_info **ii, long flags); int hci_devinfo(int dev_id, struct hci_dev_info *di); int hci_devba(int dev_id, bdaddr_t *ba); @@ -70,6 +70,9 @@ int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, in int hci_read_local_version(int dd, struct hci_version *ver, int to); int hci_class_of_dev(int dd, uint8_t *class, int to); +int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg); +int hci_get_route(bdaddr_t *bdaddr); + char *hci_dtypetostr(int type); char *hci_dflagstostr(uint32_t flags); char *hci_ptypetostr(unsigned int ptype); -- cgit From d316a5fbab4a41ce3f8321eef407db9c53b57e85 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 18 Jun 2002 18:15:13 +0000 Subject: Added hci_devid function. --- include/hci_lib.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index 7fd95cfc..982c7608 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -62,6 +62,7 @@ int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to); int hci_inquiry(int dev_id, int len, int num_rsp, uint8_t *lap, inquiry_info **ii, long flags); int hci_devinfo(int dev_id, struct hci_dev_info *di); int hci_devba(int dev_id, bdaddr_t *ba); +int hci_devid(bdaddr_t *ba); int hci_local_name(int dd, int len, char *name, int to); int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); -- cgit From 9942261d0febb9ef243ffe810421451e97925e68 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 18 Jun 2002 18:32:44 +0000 Subject: improved hci_devid --- include/hci_lib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index 982c7608..b988de5f 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -62,7 +62,7 @@ int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to); int hci_inquiry(int dev_id, int len, int num_rsp, uint8_t *lap, inquiry_info **ii, long flags); int hci_devinfo(int dev_id, struct hci_dev_info *di); int hci_devba(int dev_id, bdaddr_t *ba); -int hci_devid(bdaddr_t *ba); +int hci_devid(char *str); int hci_local_name(int dd, int len, char *name, int to); int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); -- cgit From 2377f938f56bc623ac6e0ad2e68862a0566dd7de Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 25 Jun 2002 04:07:01 +0000 Subject: Additional HCI defines. --- include/hci.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index d6946976..8c898d42 100644 --- a/include/hci.h +++ b/include/hci.h @@ -210,6 +210,34 @@ typedef struct { #define OGF_HOST_CTL 0x03 #define OCF_RESET 0x0003 +#define OCF_READ_PAGE_TIMEOUT 0x0017 +typedef struct { + uint8_t status; + uint16_t timeout; +} __attribute__ ((packed)) read_page_timeout_rp; +#define READ_PAGE_TIMEOUT_RP_SIZE 3 + +#define OCF_WRITE_PAGE_TIMEOUT 0x0018 +typedef struct { + uint16_t timeout; +} __attribute__ ((packed)) write_page_timeout_cp; +#define WRITE_PAGE_TIMEOUT_CP_SIZE 2 + +#define OCF_READ_PAGE_ACTIVITY 0x001B +typedef struct { + uint8_t status; + uint16_t interval; + uint16_t window; +} __attribute__ ((packed)) read_page_activity_rp; +#define READ_PAGE_ACTIVITY_RP_SIZE 5 + +#define OCF_WRITE_PAGE_ACTIVITY 0x001C +typedef struct { + uint16_t interval; + uint16_t window; +} __attribute__ ((packed)) write_page_activity_cp; +#define WRITE_PAGE_ACTIVITY_CP_SIZE 4 + #define OCF_READ_INQ_ACTIVITY 0x001D typedef struct { uint8_t status; -- cgit From 23ee7253eaee8524cdad88c0a796a630ceebac66 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Thu, 27 Jun 2002 17:30:13 +0000 Subject: Fix broadcast flags. --- include/hci.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 8c898d42..d36a43eb 100644 --- a/include/hci.h +++ b/include/hci.h @@ -122,10 +122,10 @@ enum { #define ACL_PTYPE_MASK (~SCO_PTYPE_MASK) /* ACL flags */ -#define ACL_CONT 0x0001 -#define ACL_START 0x0002 -#define ACL_ACTIVE_BCAST 0x0010 -#define ACL_PICO_BCAST 0x0020 +#define ACL_CONT 0x01 +#define ACL_START 0x02 +#define ACL_ACTIVE_BCAST 0x04 +#define ACL_PICO_BCAST 0x08 /* Baseband links */ #define SCO_LINK 0x00 -- cgit From 3bd9f65df44db713ad911a729d7a934e2d328661 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Wed, 3 Jul 2002 22:01:23 +0000 Subject: rssi is signed int --- include/hci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index d36a43eb..90d148f0 100644 --- a/include/hci.h +++ b/include/hci.h @@ -517,7 +517,7 @@ typedef struct { typedef struct { uint8_t status; uint16_t handle; - uint8_t rssi; + int8_t rssi; } __attribute__ ((packed)) read_rssi_rp; #define READ_RSSI_RP_SIZE 4 -- cgit From 7a31ba9955325e957677b4b9237155d6ca71d86d Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Mon, 19 Aug 2002 16:50:09 +0000 Subject: RFCOMM headers --- include/rfcomm.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 include/rfcomm.h (limited to 'include') diff --git a/include/rfcomm.h b/include/rfcomm.h new file mode 100644 index 00000000..533ddda5 --- /dev/null +++ b/include/rfcomm.h @@ -0,0 +1,45 @@ +/* + RFCOMM implementation for Linux Bluetooth stack (BlueZ). + Copyright (C) 2002 Maxim Krasnyansky + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + SOFTWARE IS DISCLAIMED. +*/ + +/* + * $Id$ + */ + +#ifndef __RFCOMM_H +#define __RFCOMM_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define RFCOMM_PSM 3 + +#define RFCOMM_CONN_TIMEOUT (HZ * 30) +#define RFCOMM_DISC_TIMEOUT (HZ * 5) + +struct sockaddr_rc { + sa_family_t rc_family; + bdaddr_t rc_bdaddr; + int rc_port; +}; + +#endif /* __RFCOMM_H */ -- cgit From 63a52518621efce1ec40afb05b8b698e4d6b9b2f Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 20 Aug 2002 19:52:36 +0000 Subject: port -> channel --- include/rfcomm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/rfcomm.h b/include/rfcomm.h index 533ddda5..7da85482 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -39,7 +39,7 @@ extern "C" { struct sockaddr_rc { sa_family_t rc_family; bdaddr_t rc_bdaddr; - int rc_port; + int rc_channel; }; #endif /* __RFCOMM_H */ -- cgit From 803bf105508009f7efc87276a539dda244527690 Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Wed, 21 Aug 2002 16:38:15 +0000 Subject: implement hci_{read, write}_current_iac_lap() --- include/hci.h | 16 ++++++++++++++++ include/hci_lib.h | 2 ++ 2 files changed, 18 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 90d148f0..e12352b4 100644 --- a/include/hci.h +++ b/include/hci.h @@ -329,6 +329,22 @@ typedef struct { } __attribute__ ((packed)) host_buffer_size_cp; #define HOST_BUFFER_SIZE_CP_SIZE 7 +#define MAX_IAC_LAP 0x40 +#define OCF_READ_CURRENT_IAC_LAP 0x0039 +typedef struct { + uint8_t status; + uint8_t num_current_iac; + uint8_t lap[3][MAX_IAC_LAP]; +} __attribute__ ((packed)) read_current_iac_lap_rp; +#define READ_CURRENT_IAC_LAP_RP_SIZE 2+3*MAX_IAC_LAP + +#define OCF_WRITE_CURRENT_IAC_LAP 0x003A +typedef struct { + uint8_t num_current_iac; + uint8_t lap[3][MAX_IAC_LAP]; +} __attribute__ ((packed)) write_current_iac_lap_cp; +#define WRITE_CURRENT_IAC_LAP_CP_SIZE 1+3*MAX_IAC_LAP + /* Link Control */ #define OGF_LINK_CTL 0x01 #define OCF_CREATE_CONN 0x0005 diff --git a/include/hci_lib.h b/include/hci_lib.h index b988de5f..afa2fb51 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -70,6 +70,8 @@ int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to) int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); int hci_read_local_version(int dd, struct hci_version *ver, int to); int hci_class_of_dev(int dd, uint8_t *class, int to); +int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to); +int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to); int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg); int hci_get_route(bdaddr_t *bdaddr); -- cgit From 9aa01920bf2e6f3b9b23b44d7c5e48dadc2f8da8 Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Thu, 22 Aug 2002 09:19:29 +0000 Subject: implement hci_{read, write}_class_of_dev() --- include/hci_lib.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index afa2fb51..ba33be73 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -69,7 +69,8 @@ int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); int hci_read_local_version(int dd, struct hci_version *ver, int to); -int hci_class_of_dev(int dd, uint8_t *class, int to); +int hci_read_class_of_dev(int dd, uint8_t *cls, int to); +int hci_write_class_of_dev(int dd, uint32_t cls, int to); int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to); int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to); -- cgit From e329c9ff80a76cb34ff616bce80df0d161731d0b Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Thu, 22 Aug 2002 10:04:18 +0000 Subject: hci_write_local_name() --- include/hci_lib.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index ba33be73..4108dc06 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -64,8 +64,9 @@ int hci_devinfo(int dev_id, struct hci_dev_info *di); int hci_devba(int dev_id, bdaddr_t *ba); int hci_devid(char *str); -int hci_local_name(int dd, int len, char *name, int to); -int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); +int hci_read_local_name(int dd, int len, char *name, int to); +int hci_write_local_name(int dd, char *name, int to); +int hci_read_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); int hci_read_local_version(int dd, struct hci_version *ver, int to); -- cgit From 66d1c38bdf157527c00cf7bde69e1de7bdd3ea28 Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Thu, 22 Aug 2002 17:17:57 +0000 Subject: resurrect hci_local_name(); fix whitespace --- include/hci_lib.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index 4108dc06..685eb413 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -64,6 +64,8 @@ int hci_devinfo(int dev_id, struct hci_dev_info *di); int hci_devba(int dev_id, bdaddr_t *ba); int hci_devid(char *str); +// deprecated: preserve compatibility +int hci_local_name(int dd, int len, char *name, int to); int hci_read_local_name(int dd, int len, char *name, int to); int hci_write_local_name(int dd, char *name, int to); int hci_read_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); -- cgit From 3c7d6997f5434c7fbb188253bb077bcc0585af3f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 23 Aug 2002 15:40:54 +0000 Subject: Add TTY ioctl defines and structures --- include/Makefile.am | 2 +- include/rfcomm.h | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/Makefile.am b/include/Makefile.am index 794a4c55..27a769fa 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -4,7 +4,7 @@ includedir = @includedir@/bluetooth -include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h +include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h rfcomm.h bluetooth: ln -s . bluetooth diff --git a/include/rfcomm.h b/include/rfcomm.h index 7da85482..b7dd179d 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -31,15 +31,69 @@ extern "C" { #endif +/* RFCOMM defaults */ +#define RFCOMM_DEFAULT_MTU 127 + #define RFCOMM_PSM 3 #define RFCOMM_CONN_TIMEOUT (HZ * 30) #define RFCOMM_DISC_TIMEOUT (HZ * 5) +/* RFCOMM socket address */ struct sockaddr_rc { sa_family_t rc_family; bdaddr_t rc_bdaddr; int rc_channel; }; +/* RFCOMM TTY support */ +#define RFCOMM_MAX_DEV 256 + +#define RFCOMM_UNKNOWN 0 +#define RFCOMM_CONNECT 1 +#define RFCOMM_BIND 2 + +#define RFCOMMCONNECT _IOW('R', 201, int) +#define RFCOMMDISCONNECT _IOW('R', 202, int) +#define RFCOMMBIND _IOW('R', 203, int) +#define RFCOMMRELEASE _IOW('R', 204, int) + +#define RFCOMMGETDEVLIST _IOR('R', 211, int) +#define RFCOMMGETDEVINFO _IOR('R', 212, int) + +struct rfcomm_dev_conn_req { + uint16_t dev_id; + bdaddr_t src; + bdaddr_t dst; + uint8_t chn; +}; + +struct rfcomm_dev_disc_req { + uint16_t dev_id; +}; + +struct rfcomm_dev_data_req { + uint16_t dev_id; + uint32_t dev_opt; +}; + +struct rfcomm_dev_list_req { + uint16_t dev_num; + struct rfcomm_dev_data_req dev_req[0]; +}; + +struct rfcomm_dev_info_req { + uint16_t dev_id; + uint8_t type; + uint32_t flags; + uint16_t state; + bdaddr_t src; + bdaddr_t dst; + uint8_t chn; +}; + +#ifdef __cplusplus +} +#endif + #endif /* __RFCOMM_H */ -- cgit From 91dc360626ec7b6b5d4da7dcb0a6287c39f3c9f4 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Thu, 12 Sep 2002 01:59:49 +0000 Subject: channel must be uint8 --- include/rfcomm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/rfcomm.h b/include/rfcomm.h index b7dd179d..408874f8 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -43,7 +43,7 @@ extern "C" { struct sockaddr_rc { sa_family_t rc_family; bdaddr_t rc_bdaddr; - int rc_channel; + uint8_t rc_channel; }; /* RFCOMM TTY support */ -- cgit From 9a51483b2a1d80512904b1df81a8222afdb3a76a Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Sun, 15 Sep 2002 16:30:56 +0000 Subject: Role change event size is 8 --- include/hci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index e12352b4..ba01bec0 100644 --- a/include/hci.h +++ b/include/hci.h @@ -643,7 +643,7 @@ typedef struct { bdaddr_t bdaddr; uint8_t role; } __attribute__ ((packed)) evt_role_change; -#define EVT_ROLE_CHANGE_SIZE 1 +#define EVT_ROLE_CHANGE_SIZE 8 #define EVT_PIN_CODE_REQ 0x16 typedef struct { -- cgit From a8d88fd7895fa8a4918b31f2654cc702cacb0eee Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Sun, 15 Sep 2002 16:35:13 +0000 Subject: disconnect timeo is 20 sec --- include/rfcomm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/rfcomm.h b/include/rfcomm.h index 408874f8..e013a046 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -37,7 +37,7 @@ extern "C" { #define RFCOMM_PSM 3 #define RFCOMM_CONN_TIMEOUT (HZ * 30) -#define RFCOMM_DISC_TIMEOUT (HZ * 5) +#define RFCOMM_DISC_TIMEOUT (HZ * 20) /* RFCOMM socket address */ struct sockaddr_rc { -- cgit From 96cd06b189af2a09bde5d752552f58fd495d5646 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Wed, 18 Sep 2002 00:37:04 +0000 Subject: resurrect hci_remote_name() --- include/hci_lib.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index 685eb413..8f17a8dd 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -68,6 +68,7 @@ int hci_devid(char *str); int hci_local_name(int dd, int len, char *name, int to); int hci_read_local_name(int dd, int len, char *name, int to); int hci_write_local_name(int dd, char *name, int to); +int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); int hci_read_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); -- cgit From 79cd53450eeb6555077f7ede0b5e02a23d7bebe8 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 22 Sep 2002 23:59:17 +0000 Subject: Add HCI_PCI to the device types --- include/hci.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index ba01bec0..e522ee85 100644 --- a/include/hci.h +++ b/include/hci.h @@ -52,6 +52,7 @@ extern "C" { #define HCI_PCCARD 2 #define HCI_UART 3 #define HCI_RS232 4 +#define HCI_PCI 5 /* HCI device flags */ enum { -- cgit From d16c23005aaece1792be1f6377655758fe6fc661 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Mon, 30 Sep 2002 06:09:24 +0000 Subject: New RFCOMM ioctl API. --- include/rfcomm.h | 55 ++++++++++++++++++++++--------------------------------- 1 file changed, 22 insertions(+), 33 deletions(-) (limited to 'include') diff --git a/include/rfcomm.h b/include/rfcomm.h index e013a046..2f26b8b8 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -49,48 +49,37 @@ struct sockaddr_rc { /* RFCOMM TTY support */ #define RFCOMM_MAX_DEV 256 -#define RFCOMM_UNKNOWN 0 -#define RFCOMM_CONNECT 1 -#define RFCOMM_BIND 2 - -#define RFCOMMCONNECT _IOW('R', 201, int) -#define RFCOMMDISCONNECT _IOW('R', 202, int) -#define RFCOMMBIND _IOW('R', 203, int) -#define RFCOMMRELEASE _IOW('R', 204, int) - -#define RFCOMMGETDEVLIST _IOR('R', 211, int) -#define RFCOMMGETDEVINFO _IOR('R', 212, int) - -struct rfcomm_dev_conn_req { - uint16_t dev_id; - bdaddr_t src; - bdaddr_t dst; - uint8_t chn; +#define RFCOMMSETMODE _IOW('R', 200, int) +#define RFCOMMCREATEDEV _IOW('R', 201, int) +#define RFCOMMRELEASEDEV _IOW('R', 202, int) +#define RFCOMMGETDEVLIST _IOR('R', 210, int) +#define RFCOMMGETDEVINFO _IOR('R', 211, int) + +struct rfcomm_dev_create_req { + int16_t dev_id; + bdaddr_t src; + bdaddr_t dst; + uint8_t channel; }; -struct rfcomm_dev_disc_req { - uint16_t dev_id; +struct rfcomm_dev_release_req { + int16_t dev_id; }; -struct rfcomm_dev_data_req { - uint16_t dev_id; - uint32_t dev_opt; +struct rfcomm_dev_info { + int16_t id; + uint32_t flags; + uint16_t state; + bdaddr_t src; + bdaddr_t dst; + uint8_t channel; }; struct rfcomm_dev_list_req { - uint16_t dev_num; - struct rfcomm_dev_data_req dev_req[0]; + uint16_t dev_num; + struct rfcomm_dev_info dev_info[0]; }; -struct rfcomm_dev_info_req { - uint16_t dev_id; - uint8_t type; - uint32_t flags; - uint16_t state; - bdaddr_t src; - bdaddr_t dst; - uint8_t chn; -}; #ifdef __cplusplus } -- cgit From 2b6704ff38275b2bb881b349248513f0ae3c1e60 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 1 Oct 2002 23:26:55 +0000 Subject: TTY ioct API changes --- include/rfcomm.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/rfcomm.h b/include/rfcomm.h index 2f26b8b8..cfad4feb 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -49,22 +49,21 @@ struct sockaddr_rc { /* RFCOMM TTY support */ #define RFCOMM_MAX_DEV 256 -#define RFCOMMSETMODE _IOW('R', 200, int) -#define RFCOMMCREATEDEV _IOW('R', 201, int) -#define RFCOMMRELEASEDEV _IOW('R', 202, int) +#define RFCOMMCREATEDEV _IOW('R', 200, int) +#define RFCOMMRELEASEDEV _IOW('R', 201, int) #define RFCOMMGETDEVLIST _IOR('R', 210, int) #define RFCOMMGETDEVINFO _IOR('R', 211, int) -struct rfcomm_dev_create_req { +struct rfcomm_dev_req { int16_t dev_id; + uint32_t flags; bdaddr_t src; bdaddr_t dst; uint8_t channel; }; - -struct rfcomm_dev_release_req { - int16_t dev_id; -}; +#define RFCOMM_REUSE_DLC 0 +#define RFCOMM_RELEASE_ONHUP 1 +#define RFCOMM_HANGUP_NOW 2 struct rfcomm_dev_info { int16_t id; -- cgit From 5fddbd5c7ba7414fedd85a52d0e30798f09aafba Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Wed, 2 Oct 2002 21:12:36 +0000 Subject: Added TTY_ATTACHED flag --- include/rfcomm.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/rfcomm.h b/include/rfcomm.h index cfad4feb..d583f98c 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -64,6 +64,7 @@ struct rfcomm_dev_req { #define RFCOMM_REUSE_DLC 0 #define RFCOMM_RELEASE_ONHUP 1 #define RFCOMM_HANGUP_NOW 2 +#define RFCOMM_TTY_ATTACHED 3 struct rfcomm_dev_info { int16_t id; -- cgit From b7597027bc00feec6a7c90b5bef45f348417781f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 4 Oct 2002 13:34:53 +0000 Subject: Add hci_suspend_dev() and hci_resume_dev() skeleton --- include/hci.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index e522ee85..bd4f692c 100644 --- a/include/hci.h +++ b/include/hci.h @@ -45,6 +45,8 @@ extern "C" { #define HCI_DEV_UNREG 2 #define HCI_DEV_UP 3 #define HCI_DEV_DOWN 4 +#define HCI_DEV_SUSPEND 5 +#define HCI_DEV_RESUME 6 /* HCI device types */ #define HCI_VHCI 0 -- cgit From 5c637d2cdb568e8d3c0cf08a57fca8131ddbe036 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Mon, 7 Oct 2002 06:01:46 +0000 Subject: Added link supervision timeout cmd and events. --- include/hci.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index bd4f692c..9e2848f6 100644 --- a/include/hci.h +++ b/include/hci.h @@ -256,6 +256,21 @@ typedef struct { } __attribute__ ((packed)) write_inq_activity_cp; #define WRITE_INQ_ACTIVITY_CP_SIZE 4 +#define OCF_READ_LINK_SUPERVISION_TIMEOUT 0x0036 +typedef struct { + uint8_t status; + uint16_t handle; + uint16_t link_sup_to; +} __attribute__ ((packed)) read_link_supervision_timeout_rp; +#define READ_LINK_SUPERVISION_TIMEOUT_RP_SIZE 5 + +#define OCF_WRITE_LINK_SUPERVISION_TIMEOUT 0x0037 +typedef struct { + uint16_t handle; + uint16_t link_sup_to; +} __attribute__ ((packed)) write_link_supervision_timeout_cp; +#define WRITE_LINK_SUPERVISION_TIMEOUT_CP_SIZE 4 + #define OCF_READ_AUTH_ENABLE 0x001F #define OCF_WRITE_AUTH_ENABLE 0x0020 #define AUTH_DISABLED 0x00 @@ -668,6 +683,14 @@ typedef struct { } __attribute__ ((packed)) evt_link_key_notify; #define EVT_LINK_KEY_NOTIFY_SIZE 23 +#define EVT_CONN_PTYPE_CHANGED 0x1D +typedef struct { + uint8_t status; + uint16_t handle; + uint16_t ptype; +} __attribute__ ((packed)) evt_conn_ptype_changed; +#define EVT_CONN_PTYPE_CHANGED_SIZE 5 + #define EVT_READ_REMOTE_FEATURES_COMPLETE 0x0B typedef struct { uint8_t status; -- cgit From 38b2a7b2c0d00282a52c339145ae55b4a787d6db Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 22 Nov 2002 20:04:43 +0000 Subject: Some more missing HCI commands and correction of the QOS event --- include/hci.h | 55 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 47 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 9e2848f6..8000e47b 100644 --- a/include/hci.h +++ b/include/hci.h @@ -363,6 +363,13 @@ typedef struct { } __attribute__ ((packed)) write_current_iac_lap_cp; #define WRITE_CURRENT_IAC_LAP_CP_SIZE 1+3*MAX_IAC_LAP +#define OCF_WRITE_SUPERVISION_TIMEOUT 0x0037 +typedef struct { + uint16_t handle; + uint16_t timeout; /* in 0.625 ms units */ +} __attribute__ ((packed)) write_supervision_timeout_cp; +#define WRITE_SUPERVISION_TIMEOUT_CP_SIZE 4 + /* Link Control */ #define OGF_LINK_CTL 0x01 #define OCF_CREATE_CONN 0x0005 @@ -418,6 +425,20 @@ typedef struct { } __attribute__ ((packed)) status_bdaddr_rp; #define STATUS_BDADDR_RP_SIZE 7 +#define OCF_INQUIRY_CANCEL 0x0002 + +#define OCF_PERIODIC_INQUIRY 0x0003 +typedef struct { + uint16_t max_period; /* 1.28s units */ + uint16_t min_period; /* 1.28s units */ + uint8_t lap[3]; + uint8_t length; /* 1.28s units */ + uint8_t num_rsp; +} __attribute__ ((packed)) periodic_inquiry_cp; +#define PERIODIC_INQUIRY_CP_SIZE 9 + +#define OCF_EXIT_PERIODIC_INQUIRY 0x0004 + #define OCF_LINK_KEY_REPLY 0x000B #define OCF_LINK_KEY_NEG_REPLY 0x000C typedef struct { @@ -478,6 +499,24 @@ typedef struct { /* Link Policy */ #define OGF_LINK_POLICY 0x02 + +typedef struct { + uint8_t service_type; /* 1 = best effort */ + uint32_t token_rate; /* Byte per seconds */ + uint32_t peak_bandwidth; /* Byte per seconds */ + uint32_t latency; /* Microseconds */ + uint32_t delay_variation; /* Microseconds */ +} __attribute__ ((packed)) hci_qos; +#define HCI_QOS_CP_SIZE 17 + +#define OCF_QOS_SETUP 0x0007 +typedef struct { + uint16_t handle; + uint8_t flags; /* Reserved */ + hci_qos qos; +} __attribute__ ((packed)) qos_setup_cp; +#define QOS_SETUP_CP_SIZE (3 + HCI_QOS_CP_SIZE) + #define OCF_ROLE_DISCOVERY 0x0009 typedef struct { uint16_t handle; @@ -619,19 +658,19 @@ typedef struct { #define EVT_ENCRYPT_CHANGE_SIZE 5 #define EVT_QOS_SETUP_COMPLETE 0x0D -typedef struct { - uint8_t service_type; - uint32_t token_rate; - uint32_t peak_bandwidth; - uint32_t latency; - uint32_t delay_variation; -} __attribute__ ((packed)) hci_qos; typedef struct { uint8_t status; uint16_t handle; + uint8_t flags; /* Reserved */ hci_qos qos; } __attribute__ ((packed)) evt_qos_setup_complete; -#define EVT_QOS_SETUP_COMPLETE_SIZE 20 +#define EVT_QOS_SETUP_COMPLETE_SIZE (4 + HCI_QOS_CP_SIZE) + +#define EVT_QOS_VIOLATION 0x1E +typedef struct { + uint16_t handle; +} __attribute__ ((packed)) evt_qos_violation; +#define EVT_QOS_VIOLATION_SIZE 2 #define EVT_CMD_COMPLETE 0x0e typedef struct { -- cgit From 4e89f72ef1e8a70c40e5b587589977ee9f665d9b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 22 Nov 2002 20:11:46 +0000 Subject: Remove OCF_WRITE_SUPERVISION_TIMEOUT --- include/hci.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 8000e47b..7868366c 100644 --- a/include/hci.h +++ b/include/hci.h @@ -363,13 +363,6 @@ typedef struct { } __attribute__ ((packed)) write_current_iac_lap_cp; #define WRITE_CURRENT_IAC_LAP_CP_SIZE 1+3*MAX_IAC_LAP -#define OCF_WRITE_SUPERVISION_TIMEOUT 0x0037 -typedef struct { - uint16_t handle; - uint16_t timeout; /* in 0.625 ms units */ -} __attribute__ ((packed)) write_supervision_timeout_cp; -#define WRITE_SUPERVISION_TIMEOUT_CP_SIZE 4 - /* Link Control */ #define OGF_LINK_CTL 0x01 #define OCF_CREATE_CONN 0x0005 -- cgit From e101b08ba577ff8f6a2a789eb67d128977859fd3 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 22 Nov 2002 20:27:51 +0000 Subject: Remove the opcode parameter in hci_filter_clear_opcode() --- include/hci_lib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index 8f17a8dd..e7aa8bcd 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -153,7 +153,7 @@ static inline void hci_filter_set_opcode(int opcode, struct hci_filter *f) { f->opcode = opcode; } -static inline void hci_filter_clear_opcode(int opcode, struct hci_filter *f) +static inline void hci_filter_clear_opcode(struct hci_filter *f) { f->opcode = 0; } -- cgit From d6cbeb4c61f5dc0c0d04dd022139b44f81964b18 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 15 Dec 2002 13:18:53 +0000 Subject: Support for voice setting --- include/hci.h | 13 +++++++++++++ include/hci_lib.h | 2 ++ 2 files changed, 15 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 7868366c..a00b7218 100644 --- a/include/hci.h +++ b/include/hci.h @@ -338,6 +338,19 @@ typedef struct { } __attribute__ ((packed)) write_class_of_dev_cp; #define WRITE_CLASS_OF_DEV_CP_SIZE 3 +#define OCF_READ_VOICE_SETTING 0x0025 +typedef struct { + uint8_t status; + uint16_t voice_setting; +} __attribute__ ((packed)) read_voice_setting_rp; +#define READ_VOICE_SETTING_RP_SIZE 3 + +#define OCF_WRITE_VOICE_SETTING 0x0026 +typedef struct { + uint16_t voice_setting; +} __attribute__ ((packed)) write_voice_setting_cp; +#define WRITE_VOICE_SETTING_CP_SIZE 2 + #define OCF_HOST_BUFFER_SIZE 0x0033 typedef struct { uint16_t acl_mtu; diff --git a/include/hci_lib.h b/include/hci_lib.h index e7aa8bcd..81d29ecf 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -75,6 +75,8 @@ int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, in int hci_read_local_version(int dd, struct hci_version *ver, int to); int hci_read_class_of_dev(int dd, uint8_t *cls, int to); int hci_write_class_of_dev(int dd, uint32_t cls, int to); +int hci_read_voice_setting(int dd, uint16_t *vs, int to); +int hci_write_voice_setting(int dd, uint16_t vs, int to); int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to); int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to); -- cgit From b76e31a4c8d609d5334fa8958c53f09b0014aeac Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 21 Dec 2002 19:19:17 +0000 Subject: Add the vendor and testing defines --- include/hci.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index a00b7218..8093c35a 100644 --- a/include/hci.h +++ b/include/hci.h @@ -504,7 +504,7 @@ typedef struct { #define READ_REMOTE_VERSION_CP_SIZE 2 /* Link Policy */ -#define OGF_LINK_POLICY 0x02 +#define OGF_LINK_POLICY 0x02 typedef struct { uint8_t service_type; /* 1 = best effort */ @@ -600,6 +600,12 @@ typedef struct { } __attribute__ ((packed)) read_rssi_rp; #define READ_RSSI_RP_SIZE 4 +/* Testing commands */ +#define OGF_TESTING_CMD 0x3e + +/* Vendor specific commands */ +#define OGF_VENDOR_CMD 0x3f + /* ---- HCI Events ---- */ #define EVT_INQUIRY_COMPLETE 0x01 @@ -777,6 +783,10 @@ typedef struct { uint8_t incomming; } __attribute__ ((packed)) evt_si_security; +#define EVT_TESTING 0xfe + +#define EVT_VENDOR 0xff + /* -------- HCI Packet structures -------- */ #define HCI_TYPE_LEN 1 -- cgit From be47bbe6b4e691321240443f2915c5fba4a7d748 Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Mon, 3 Feb 2003 17:26:56 +0000 Subject: hci error codes --- include/hci.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 8093c35a..3e736558 100644 --- a/include/hci.h +++ b/include/hci.h @@ -124,6 +124,49 @@ enum { #define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3) #define ACL_PTYPE_MASK (~SCO_PTYPE_MASK) +/* HCI Error codes */ +#define HCI_UNKNOWN_COMMAND 0x01 +#define HCI_NO_CONNECTION 0x02 +#define HCI_HARDWARE_FAILURE 0x03 +#define HCI_PAGE_TIMEOUT 0x04 +#define HCI_AUTHENTICATION_FAILURE 0x05 +#define HCI_KEY_MISSING 0x06 +#define HCI_MEMORY_FULL 0x07 +#define HCI_CONNECTION_TIMEOUT 0x08 +#define HCI_MAX_NUMBER_OF_CONNECTIONS 0x09 +#define HCI_MAX_NUMBER_OF_SCO_CONNECTIONS 0x0a +#define HCI_ACL_CONNECTION_EXISTS 0x0b +#define HCI_COMMAND_DISALLOWED 0x0c +#define HCI_REJECTED_LIMITED_RESOURCES 0x0d +#define HCI_REJECTED_SECURITY 0x0e +#define HCI_REJECTED_PERSONAL 0x0f +#define HCI_HOST_TIMEOUT 0x10 +#define HCI_UNSUPPORTED_FEATURE 0x11 +#define HCI_INVALID_PARAMETERS 0x12 +#define HCI_OE_USER_ENDED_CONNECTION 0x13 +#define HCI_OE_LOW_RESOURCES 0x14 +#define HCI_OE_POWER_OFF 0x15 +#define HCI_CONNECTION_TERMINATED 0x16 +#define HCI_REPEATED_ATTEMPTS 0x17 +#define HCI_PAIRING_NOT_ALLOWED 0x18 +#define HCI_UNKNOWN_LMP_PDU 0x19 +#define HCI_UNSUPPORTED_REMOTE_FEATURE 0x1a +#define HCI_SCO_OFFSET_REJECTED 0x1b +#define HCI_SCO_INTERVAL_REJECTED 0x1c +#define HCI_AIR_MODE_REJECTED 0x1d +#define HCI_INVALID_LMP_PARAMETERS 0x1e +#define HCI_UNSPECIFIED_ERROR 0x1f +#define HCI_UNSUPPORTED_LMP_PARAMETER_VALUE 0x20 +#define HCI_ROLE_CHANGE_NOT_ALLOWED 0x21 +#define HCI_LMP_RESPONSE_TIMEOUT 0x22 +#define HCI_LMP_ERROR_TRANSACTION_COLLISION 0x23 +#define HCI_LMP_PDU_NOT_ALLOWED 0x24 +#define HCI_ENCRYPTION_MODE_NOT_ACCEPTED 0x25 +#define HCI_UNIT_LINK_KEY_USED 0x26 +#define HCI_QOS_NOT_SUPPORTED 0x27 +#define HCI_INSTANT_PASSED 0x28 +#define HCI_PAIRING_NOT_SUPPORTED 0x29 + /* ACL flags */ #define ACL_CONT 0x01 #define ACL_START 0x02 -- cgit From bff9ecffc1771df893e0cccc59fe708cf9ba43bb Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 4 Feb 2003 00:30:39 +0000 Subject: Whitespace cleanup --- include/hci.h | 74 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 3e736558..8168a492 100644 --- a/include/hci.h +++ b/include/hci.h @@ -125,47 +125,47 @@ enum { #define ACL_PTYPE_MASK (~SCO_PTYPE_MASK) /* HCI Error codes */ -#define HCI_UNKNOWN_COMMAND 0x01 -#define HCI_NO_CONNECTION 0x02 -#define HCI_HARDWARE_FAILURE 0x03 -#define HCI_PAGE_TIMEOUT 0x04 -#define HCI_AUTHENTICATION_FAILURE 0x05 -#define HCI_KEY_MISSING 0x06 -#define HCI_MEMORY_FULL 0x07 -#define HCI_CONNECTION_TIMEOUT 0x08 -#define HCI_MAX_NUMBER_OF_CONNECTIONS 0x09 +#define HCI_UNKNOWN_COMMAND 0x01 +#define HCI_NO_CONNECTION 0x02 +#define HCI_HARDWARE_FAILURE 0x03 +#define HCI_PAGE_TIMEOUT 0x04 +#define HCI_AUTHENTICATION_FAILURE 0x05 +#define HCI_KEY_MISSING 0x06 +#define HCI_MEMORY_FULL 0x07 +#define HCI_CONNECTION_TIMEOUT 0x08 +#define HCI_MAX_NUMBER_OF_CONNECTIONS 0x09 #define HCI_MAX_NUMBER_OF_SCO_CONNECTIONS 0x0a -#define HCI_ACL_CONNECTION_EXISTS 0x0b -#define HCI_COMMAND_DISALLOWED 0x0c -#define HCI_REJECTED_LIMITED_RESOURCES 0x0d -#define HCI_REJECTED_SECURITY 0x0e -#define HCI_REJECTED_PERSONAL 0x0f -#define HCI_HOST_TIMEOUT 0x10 -#define HCI_UNSUPPORTED_FEATURE 0x11 -#define HCI_INVALID_PARAMETERS 0x12 -#define HCI_OE_USER_ENDED_CONNECTION 0x13 -#define HCI_OE_LOW_RESOURCES 0x14 -#define HCI_OE_POWER_OFF 0x15 -#define HCI_CONNECTION_TERMINATED 0x16 -#define HCI_REPEATED_ATTEMPTS 0x17 -#define HCI_PAIRING_NOT_ALLOWED 0x18 -#define HCI_UNKNOWN_LMP_PDU 0x19 -#define HCI_UNSUPPORTED_REMOTE_FEATURE 0x1a -#define HCI_SCO_OFFSET_REJECTED 0x1b -#define HCI_SCO_INTERVAL_REJECTED 0x1c -#define HCI_AIR_MODE_REJECTED 0x1d -#define HCI_INVALID_LMP_PARAMETERS 0x1e -#define HCI_UNSPECIFIED_ERROR 0x1f +#define HCI_ACL_CONNECTION_EXISTS 0x0b +#define HCI_COMMAND_DISALLOWED 0x0c +#define HCI_REJECTED_LIMITED_RESOURCES 0x0d +#define HCI_REJECTED_SECURITY 0x0e +#define HCI_REJECTED_PERSONAL 0x0f +#define HCI_HOST_TIMEOUT 0x10 +#define HCI_UNSUPPORTED_FEATURE 0x11 +#define HCI_INVALID_PARAMETERS 0x12 +#define HCI_OE_USER_ENDED_CONNECTION 0x13 +#define HCI_OE_LOW_RESOURCES 0x14 +#define HCI_OE_POWER_OFF 0x15 +#define HCI_CONNECTION_TERMINATED 0x16 +#define HCI_REPEATED_ATTEMPTS 0x17 +#define HCI_PAIRING_NOT_ALLOWED 0x18 +#define HCI_UNKNOWN_LMP_PDU 0x19 +#define HCI_UNSUPPORTED_REMOTE_FEATURE 0x1a +#define HCI_SCO_OFFSET_REJECTED 0x1b +#define HCI_SCO_INTERVAL_REJECTED 0x1c +#define HCI_AIR_MODE_REJECTED 0x1d +#define HCI_INVALID_LMP_PARAMETERS 0x1e +#define HCI_UNSPECIFIED_ERROR 0x1f #define HCI_UNSUPPORTED_LMP_PARAMETER_VALUE 0x20 -#define HCI_ROLE_CHANGE_NOT_ALLOWED 0x21 -#define HCI_LMP_RESPONSE_TIMEOUT 0x22 +#define HCI_ROLE_CHANGE_NOT_ALLOWED 0x21 +#define HCI_LMP_RESPONSE_TIMEOUT 0x22 #define HCI_LMP_ERROR_TRANSACTION_COLLISION 0x23 -#define HCI_LMP_PDU_NOT_ALLOWED 0x24 +#define HCI_LMP_PDU_NOT_ALLOWED 0x24 #define HCI_ENCRYPTION_MODE_NOT_ACCEPTED 0x25 -#define HCI_UNIT_LINK_KEY_USED 0x26 -#define HCI_QOS_NOT_SUPPORTED 0x27 -#define HCI_INSTANT_PASSED 0x28 -#define HCI_PAIRING_NOT_SUPPORTED 0x29 +#define HCI_UNIT_LINK_KEY_USED 0x26 +#define HCI_QOS_NOT_SUPPORTED 0x27 +#define HCI_INSTANT_PASSED 0x28 +#define HCI_PAIRING_NOT_SUPPORTED 0x29 /* ACL flags */ #define ACL_CONT 0x01 -- cgit From 109bfa547ab9e24672472371e2183dcec24d0058 Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Tue, 11 Feb 2003 10:22:23 +0000 Subject: add const to fn sigs; fns to auth and enc links --- include/bluetooth.h | 14 +++++++------- include/hci.h | 2 +- include/hci_lib.h | 14 ++++++++------ 3 files changed, 16 insertions(+), 14 deletions(-) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index b93c4e35..93a6f628 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -91,20 +91,20 @@ typedef struct { #define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}}) /* Copy, swap, convert BD Address */ -static inline int bacmp(bdaddr_t *ba1, bdaddr_t *ba2) +static inline int bacmp(const bdaddr_t *ba1, const bdaddr_t *ba2) { return memcmp(ba1, ba2, sizeof(bdaddr_t)); } -static inline void bacpy(bdaddr_t *dst, bdaddr_t *src) +static inline void bacpy(bdaddr_t *dst, const bdaddr_t *src) { memcpy(dst, src, sizeof(bdaddr_t)); } -void baswap(bdaddr_t *dst, bdaddr_t *src); -bdaddr_t *strtoba(char *str); -char *batostr(bdaddr_t *ba); -int ba2str(bdaddr_t *ba, char *str); -int str2ba(char *str, bdaddr_t *ba); +void baswap(bdaddr_t *dst, const bdaddr_t *src); +bdaddr_t *strtoba(const char *str); +char *batostr(const bdaddr_t *ba); +int ba2str(const bdaddr_t *ba, char *str); +int str2ba(const char *str, bdaddr_t *ba); int bt_error(uint16_t code); char *bt_compidtostr(int id); diff --git a/include/hci.h b/include/hci.h index 8168a492..212db12b 100644 --- a/include/hci.h +++ b/include/hci.h @@ -823,7 +823,7 @@ typedef struct { uint16_t event; uint16_t proto; uint16_t subproto; - uint8_t incomming; + uint8_t incoming; } __attribute__ ((packed)) evt_si_security; #define EVT_TESTING 0xfe diff --git a/include/hci_lib.h b/include/hci_lib.h index 81d29ecf..d6d76214 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -56,20 +56,20 @@ int hci_close_dev(int dd); int hci_send_cmd(int dd, uint16_t ogf, uint16_t ocf, uint8_t plen, void *param); int hci_send_req(int dd, struct hci_request *req, int timeout); -int hci_create_connection(int dd, bdaddr_t *ba, uint16_t ptype, uint16_t clkoffset, uint8_t rswitch, uint16_t *handle, int to); +int hci_create_connection(int dd, const bdaddr_t *ba, uint16_t ptype, uint16_t clkoffset, uint8_t rswitch, uint16_t *handle, int to); int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to); -int hci_inquiry(int dev_id, int len, int num_rsp, uint8_t *lap, inquiry_info **ii, long flags); +int hci_inquiry(int dev_id, int len, int num_rsp, const uint8_t *lap, inquiry_info **ii, long flags); int hci_devinfo(int dev_id, struct hci_dev_info *di); int hci_devba(int dev_id, bdaddr_t *ba); -int hci_devid(char *str); +int hci_devid(const char *str); // deprecated: preserve compatibility int hci_local_name(int dd, int len, char *name, int to); int hci_read_local_name(int dd, int len, char *name, int to); -int hci_write_local_name(int dd, char *name, int to); -int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); -int hci_read_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); +int hci_write_local_name(int dd, const char *name, int to); +int hci_remote_name(int dd, const bdaddr_t *ba, int len, char *name, int to); +int hci_read_remote_name(int dd, const bdaddr_t *ba, int len, char *name, int to); int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); int hci_read_local_version(int dd, struct hci_version *ver, int to); @@ -79,6 +79,8 @@ int hci_read_voice_setting(int dd, uint16_t *vs, int to); int hci_write_voice_setting(int dd, uint16_t vs, int to); int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to); int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to); +int hci_authenticate_link(int dd, uint16_t handle, int to); +int hci_encrypt_link(int dd, uint16_t handle, int on, int to); int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg); int hci_get_route(bdaddr_t *bdaddr); -- cgit From 1c9576607a611e033e0bac0f56d91146c120a16d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 22 Mar 2003 08:00:36 +0000 Subject: Support for reading the clock offset --- include/hci.h | 14 ++++++++++++++ include/hci_lib.h | 1 + 2 files changed, 15 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 212db12b..904bc5c8 100644 --- a/include/hci.h +++ b/include/hci.h @@ -546,6 +546,12 @@ typedef struct { } __attribute__ ((packed)) read_remote_version_cp; #define READ_REMOTE_VERSION_CP_SIZE 2 +#define OCF_READ_CLOCK_OFFSET 0x001F +typedef struct { + uint16_t handle; +} __attribute__ ((packed)) read_clock_offset_cp; +#define READ_CLOCK_OFFSET_CP_SIZE 2 + /* Link Policy */ #define OGF_LINK_POLICY 0x02 @@ -777,6 +783,14 @@ typedef struct { } __attribute__ ((packed)) evt_link_key_notify; #define EVT_LINK_KEY_NOTIFY_SIZE 23 +#define EVT_READ_CLOCK_OFFSET_COMPLETE 0x1C +typedef struct { + uint8_t status; + uint16_t handle; + uint16_t clock_offset; +} __attribute__ ((packed)) evt_read_clock_offset_complete; +#define EVT_READ_CLOCK_OFFSET_COMPLETE_SIZE 5 + #define EVT_CONN_PTYPE_CHANGED 0x1D typedef struct { uint8_t status; diff --git a/include/hci_lib.h b/include/hci_lib.h index d6d76214..79866a45 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -72,6 +72,7 @@ int hci_remote_name(int dd, const bdaddr_t *ba, int len, char *name, int to); int hci_read_remote_name(int dd, const bdaddr_t *ba, int len, char *name, int to); int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); +int hci_read_clock_offset(int dd, uint16_t handle, uint16_t *clkoffset, int to); int hci_read_local_version(int dd, struct hci_version *ver, int to); int hci_read_class_of_dev(int dd, uint8_t *cls, int to); int hci_write_class_of_dev(int dd, uint32_t cls, int to); -- cgit From be609d042ad549ec27de081cd81a7001fb307581 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 23 Apr 2003 01:13:10 +0000 Subject: Add HCI defines for park, sniff and hold mode --- include/hci.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 904bc5c8..531d4e1d 100644 --- a/include/hci.h +++ b/include/hci.h @@ -421,6 +421,7 @@ typedef struct { /* Link Control */ #define OGF_LINK_CTL 0x01 + #define OCF_CREATE_CONN 0x0005 typedef struct { bdaddr_t bdaddr; @@ -555,6 +556,36 @@ typedef struct { /* Link Policy */ #define OGF_LINK_POLICY 0x02 +#define OCF_SNIFF_MODE 0x0003 +typedef struct { + uint16_t handle; + uint16_t interval_max; + uint16_t interval_min; + uint16_t attempt_window; + uint16_t timeout; +} __attribute__ ((packed)) sniff_mode_cp; +#define SNIFF_MODE_CP_SIZE 10 + +#define OCF_EXIT_SNIFF_MODE 0x0004 +typedef struct { + uint16_t handle; +} __attribute__ ((packed)) exit_sniff_mode_cp; +#define EXIT_SNIFF_MODE_CP_SIZE 2 + +#define OCF_PARK_MODE 0x0005 +typedef struct { + uint16_t handle; + uint16_t beacon_max; + uint16_t beacon_min; +} __attribute__ ((packed)) park_mode_cp; +#define PARK_MODE_CP_SIZE 6 + +#define OCF_EXIT_PARK_MODE 0x0006 +typedef struct { + uint16_t handle; +} __attribute__ ((packed)) exit_park_mode_cp; +#define EXIT_PARK_MODE_CP_SIZE 2 + typedef struct { uint8_t service_type; /* 1 = best effort */ uint32_t token_rate; /* Byte per seconds */ @@ -727,6 +758,15 @@ typedef struct { } __attribute__ ((packed)) evt_qos_setup_complete; #define EVT_QOS_SETUP_COMPLETE_SIZE (4 + HCI_QOS_CP_SIZE) +#define EVT_MODE_CHANGE 0x14 +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t mode; + uint16_t interval; +} __attribute__ ((packed)) evt_mode_change; +#define EVT_MODE_CHANGE_SIZE 6 + #define EVT_QOS_VIOLATION 0x1E typedef struct { uint16_t handle; -- cgit From 2c375c1f2c5cff353e2f767ac14f8251452392e9 Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Tue, 20 May 2003 11:33:53 +0000 Subject: add role switch --- include/hci_lib.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index 79866a45..31995411 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -82,6 +82,8 @@ int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to); int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to); int hci_authenticate_link(int dd, uint16_t handle, int to); int hci_encrypt_link(int dd, uint16_t handle, int on, int to); +// role == 0 is master, 1 is slave +int hci_switch_role(int dd, bdaddr_t peer, int role, int to); int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg); int hci_get_route(bdaddr_t *bdaddr); -- cgit From 742d032d41631219ddbd39f39b7c70419064acc1 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 28 May 2003 23:59:55 +0000 Subject: Add definition of LM_RELIABLE flag --- include/hci.h | 1 + include/l2cap.h | 1 + 2 files changed, 2 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 531d4e1d..e96eee9e 100644 --- a/include/hci.h +++ b/include/hci.h @@ -213,6 +213,7 @@ enum { #define HCI_LM_AUTH 0x0002 #define HCI_LM_ENCRYPT 0x0004 #define HCI_LM_TRUSTED 0x0008 +#define HCI_LM_RELIABLE 0x0010 /* ----- HCI Commands ----- */ /* OGF & OCF values */ diff --git a/include/l2cap.h b/include/l2cap.h index 25178401..dec00efc 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -64,6 +64,7 @@ struct l2cap_conninfo { #define L2CAP_LM_AUTH 0x0002 #define L2CAP_LM_ENCRYPT 0x0004 #define L2CAP_LM_TRUSTED 0x0008 +#define L2CAP_LM_RELIABLE 0x0010 #define L2CAP_QOS 0x04 struct l2cap_qos { -- cgit From 5206dbb419458caad6664aef67e34dba8be3fefa Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 5 Jun 2003 06:25:32 +0000 Subject: Cleanup --- include/rfcomm.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/rfcomm.h b/include/rfcomm.h index d583f98c..f04ace71 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -1,6 +1,7 @@ /* - RFCOMM implementation for Linux Bluetooth stack (BlueZ). - Copyright (C) 2002 Maxim Krasnyansky + RFCOMM protocol definition for Linux Bluetooth stack (BlueZ). + Copyright (C) 2002-2003 Maxim Krasnyansky + Copyright (C) 2002-2003 Marcel Holtmann This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as @@ -80,7 +81,6 @@ struct rfcomm_dev_list_req { struct rfcomm_dev_info dev_info[0]; }; - #ifdef __cplusplus } #endif -- cgit From fccacdc27dffbc563a4cfe2e1aa9ed987a1bfca1 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 5 Jun 2003 06:38:18 +0000 Subject: Add protocol number for CMTP --- include/bluetooth.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index 93a6f628..c09e99d4 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -48,6 +48,7 @@ extern "C" { #define BTPROTO_SCO 2 #define BTPROTO_RFCOMM 3 #define BTPROTO_BNEP 4 +#define BTPROTO_CMTP 5 #define SOL_HCI 0 #define SOL_L2CAP 6 -- cgit From 95989cae022b8bd39e3e45e5bc92eaf8c6b5d0ab Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 26 Jun 2003 11:19:19 +0000 Subject: Add HCI defines for transmit power level --- include/hci.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index e96eee9e..746bb66c 100644 --- a/include/hci.h +++ b/include/hci.h @@ -395,6 +395,19 @@ typedef struct { } __attribute__ ((packed)) write_voice_setting_cp; #define WRITE_VOICE_SETTING_CP_SIZE 2 +#define OCF_READ_TRANSMIT_POWER_LEVEL 0x002D +typedef struct { + uint16_t handle; + uint8_t type; +} __attribute__ ((packed)) read_transmit_power_level_cp; +#define READ_TRANSMIT_POWER_LEVEL_CP_SIZE 3 +typedef struct { + uint8_t status; + uint16_t handle; + int8_t level; +} __attribute__ ((packed)) read_transmit_power_level_rp; +#define READ_TRANSMIT_POWER_LEVEL_RP_SIZE 4 + #define OCF_HOST_BUFFER_SIZE 0x0033 typedef struct { uint16_t acl_mtu; -- cgit From 78410fbc646a08b98487096e93e7bde4189314ae Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 26 Jun 2003 13:09:02 +0000 Subject: Add functions for park mode --- include/hci.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 746bb66c..4e881275 100644 --- a/include/hci.h +++ b/include/hci.h @@ -568,14 +568,22 @@ typedef struct { #define READ_CLOCK_OFFSET_CP_SIZE 2 /* Link Policy */ -#define OGF_LINK_POLICY 0x02 +#define OGF_LINK_POLICY 0x02 + +#define OCF_HOLD_MODE 0x0001 +typedef struct { + uint16_t handle; + uint16_t max_interval; + uint16_t min_interval; +} __attribute__ ((packed)) hold_mode_cp; +#define HOLD_MODE_CP_SIZE 6 #define OCF_SNIFF_MODE 0x0003 typedef struct { uint16_t handle; - uint16_t interval_max; - uint16_t interval_min; - uint16_t attempt_window; + uint16_t max_interval; + uint16_t min_interval; + uint16_t attempt; uint16_t timeout; } __attribute__ ((packed)) sniff_mode_cp; #define SNIFF_MODE_CP_SIZE 10 @@ -589,8 +597,8 @@ typedef struct { #define OCF_PARK_MODE 0x0005 typedef struct { uint16_t handle; - uint16_t beacon_max; - uint16_t beacon_min; + uint16_t max_interval; + uint16_t min_interval; } __attribute__ ((packed)) park_mode_cp; #define PARK_MODE_CP_SIZE 6 -- cgit From 5624d6cc20e5fb63d4b34b672b2421eb38b849e5 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 26 Jun 2003 21:17:37 +0000 Subject: Add functions for park mode --- include/hci_lib.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index 31995411..6b7b6f63 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -84,6 +84,8 @@ int hci_authenticate_link(int dd, uint16_t handle, int to); int hci_encrypt_link(int dd, uint16_t handle, int on, int to); // role == 0 is master, 1 is slave int hci_switch_role(int dd, bdaddr_t peer, int role, int to); +int hci_park_mode(int dd, uint16_t handle, uint16_t max_interval, uint16_t min_interval, int to); +int hci_exit_park_mode(int dd, uint16_t handle, int to); int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg); int hci_get_route(bdaddr_t *bdaddr); -- cgit From 30bc21fa83734b36204d85ec00481ee836ef13d5 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 2 Jul 2003 23:49:47 +0000 Subject: Sort HCI commands --- include/hci.h | 630 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 316 insertions(+), 314 deletions(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 4e881275..99f01f7f 100644 --- a/include/hci.h +++ b/include/hci.h @@ -216,361 +216,147 @@ enum { #define HCI_LM_RELIABLE 0x0010 /* ----- HCI Commands ----- */ -/* OGF & OCF values */ -/* Informational Parameters */ -#define OGF_INFO_PARAM 0x04 - -#define OCF_READ_LOCAL_VERSION 0x0001 -typedef struct { - uint8_t status; - uint8_t hci_ver; - uint16_t hci_rev; - uint8_t lmp_ver; - uint16_t manufacturer; - uint16_t lmp_subver; -} __attribute__ ((packed)) read_local_version_rp; -#define READ_LOCAL_VERSION_RP_SIZE 9 +/* Link Control */ +#define OGF_LINK_CTL 0x01 -#define OCF_READ_LOCAL_FEATURES 0x0003 +#define OCF_INQUIRY 0x0001 typedef struct { - uint8_t status; - uint8_t features[8]; -} __attribute__ ((packed)) read_local_features_rp; + uint8_t lap[3]; + uint8_t length; /* 1.28s units */ + uint8_t num_rsp; +} __attribute__ ((packed)) inquiry_cp; +#define INQUIRY_CP_SIZE 5 -#define OCF_READ_BUFFER_SIZE 0x0005 typedef struct { uint8_t status; - uint16_t acl_mtu; - uint8_t sco_mtu; - uint16_t acl_max_pkt; - uint16_t sco_max_pkt; -} __attribute__ ((packed)) read_buffer_size_rp; - -#define OCF_READ_BD_ADDR 0x0009 -typedef struct { - uint8_t status; bdaddr_t bdaddr; -} __attribute__ ((packed)) read_bd_addr_rp; - -/* Host Controller and Baseband */ -#define OGF_HOST_CTL 0x03 -#define OCF_RESET 0x0003 - -#define OCF_READ_PAGE_TIMEOUT 0x0017 -typedef struct { - uint8_t status; - uint16_t timeout; -} __attribute__ ((packed)) read_page_timeout_rp; -#define READ_PAGE_TIMEOUT_RP_SIZE 3 - -#define OCF_WRITE_PAGE_TIMEOUT 0x0018 -typedef struct { - uint16_t timeout; -} __attribute__ ((packed)) write_page_timeout_cp; -#define WRITE_PAGE_TIMEOUT_CP_SIZE 2 - -#define OCF_READ_PAGE_ACTIVITY 0x001B -typedef struct { - uint8_t status; - uint16_t interval; - uint16_t window; -} __attribute__ ((packed)) read_page_activity_rp; -#define READ_PAGE_ACTIVITY_RP_SIZE 5 - -#define OCF_WRITE_PAGE_ACTIVITY 0x001C -typedef struct { - uint16_t interval; - uint16_t window; -} __attribute__ ((packed)) write_page_activity_cp; -#define WRITE_PAGE_ACTIVITY_CP_SIZE 4 - -#define OCF_READ_INQ_ACTIVITY 0x001D -typedef struct { - uint8_t status; - uint16_t interval; - uint16_t window; -} __attribute__ ((packed)) read_inq_activity_rp; -#define READ_INQ_ACTIVITY_RP_SIZE 5 - -#define OCF_WRITE_INQ_ACTIVITY 0x001E -typedef struct { - uint16_t interval; - uint16_t window; -} __attribute__ ((packed)) write_inq_activity_cp; -#define WRITE_INQ_ACTIVITY_CP_SIZE 4 - -#define OCF_READ_LINK_SUPERVISION_TIMEOUT 0x0036 -typedef struct { - uint8_t status; - uint16_t handle; - uint16_t link_sup_to; -} __attribute__ ((packed)) read_link_supervision_timeout_rp; -#define READ_LINK_SUPERVISION_TIMEOUT_RP_SIZE 5 - -#define OCF_WRITE_LINK_SUPERVISION_TIMEOUT 0x0037 -typedef struct { - uint16_t handle; - uint16_t link_sup_to; -} __attribute__ ((packed)) write_link_supervision_timeout_cp; -#define WRITE_LINK_SUPERVISION_TIMEOUT_CP_SIZE 4 - -#define OCF_READ_AUTH_ENABLE 0x001F -#define OCF_WRITE_AUTH_ENABLE 0x0020 - #define AUTH_DISABLED 0x00 - #define AUTH_ENABLED 0x01 - -#define OCF_READ_ENCRYPT_MODE 0x0021 -#define OCF_WRITE_ENCRYPT_MODE 0x0022 - #define ENCRYPT_DISABLED 0x00 - #define ENCRYPT_P2P 0x01 - #define ENCRYPT_BOTH 0x02 - -#define OCF_WRITE_CA_TIMEOUT 0x0016 -#define OCF_WRITE_PG_TIMEOUT 0x0018 - -#define OCF_WRITE_SCAN_ENABLE 0x001A - #define SCAN_DISABLED 0x00 - #define SCAN_INQUIRY 0x01 - #define SCAN_PAGE 0x02 - -#define OCF_SET_EVENT_FLT 0x0005 -typedef struct { - uint8_t flt_type; - uint8_t cond_type; - uint8_t condition[0]; -} __attribute__ ((packed)) set_event_flt_cp; -#define SET_EVENT_FLT_CP_SIZE 2 - -/* Filter types */ -#define FLT_CLEAR_ALL 0x00 -#define FLT_INQ_RESULT 0x01 -#define FLT_CONN_SETUP 0x02 - -/* CONN_SETUP Condition types */ -#define CONN_SETUP_ALLOW_ALL 0x00 -#define CONN_SETUP_ALLOW_CLASS 0x01 -#define CONN_SETUP_ALLOW_BDADDR 0x02 - -/* CONN_SETUP Conditions */ -#define CONN_SETUP_AUTO_OFF 0x01 -#define CONN_SETUP_AUTO_ON 0x02 - -#define OCF_CHANGE_LOCAL_NAME 0x0013 -typedef struct { - uint8_t name[248]; -} __attribute__ ((packed)) change_local_name_cp; -#define CHANGE_LOCAL_NAME_CP_SIZE 248 - -#define OCF_READ_LOCAL_NAME 0x0014 -typedef struct { - uint8_t status; - uint8_t name[248]; -} __attribute__ ((packed)) read_local_name_rp; -#define READ_LOCAL_NAME_RP_SIZE 249 - -#define OCF_READ_CLASS_OF_DEV 0x0023 -typedef struct { - uint8_t status; - uint8_t dev_class[3]; -} __attribute__ ((packed)) read_class_of_dev_rp; -#define READ_CLASS_OF_DEV_RP_SIZE 4 - -#define OCF_WRITE_CLASS_OF_DEV 0x0024 -typedef struct { - uint8_t dev_class[3]; -} __attribute__ ((packed)) write_class_of_dev_cp; -#define WRITE_CLASS_OF_DEV_CP_SIZE 3 - -#define OCF_READ_VOICE_SETTING 0x0025 -typedef struct { - uint8_t status; - uint16_t voice_setting; -} __attribute__ ((packed)) read_voice_setting_rp; -#define READ_VOICE_SETTING_RP_SIZE 3 - -#define OCF_WRITE_VOICE_SETTING 0x0026 -typedef struct { - uint16_t voice_setting; -} __attribute__ ((packed)) write_voice_setting_cp; -#define WRITE_VOICE_SETTING_CP_SIZE 2 - -#define OCF_READ_TRANSMIT_POWER_LEVEL 0x002D -typedef struct { - uint16_t handle; - uint8_t type; -} __attribute__ ((packed)) read_transmit_power_level_cp; -#define READ_TRANSMIT_POWER_LEVEL_CP_SIZE 3 -typedef struct { - uint8_t status; - uint16_t handle; - int8_t level; -} __attribute__ ((packed)) read_transmit_power_level_rp; -#define READ_TRANSMIT_POWER_LEVEL_RP_SIZE 4 +} __attribute__ ((packed)) status_bdaddr_rp; +#define STATUS_BDADDR_RP_SIZE 7 -#define OCF_HOST_BUFFER_SIZE 0x0033 -typedef struct { - uint16_t acl_mtu; - uint8_t sco_mtu; - uint16_t acl_max_pkt; - uint16_t sco_max_pkt; -} __attribute__ ((packed)) host_buffer_size_cp; -#define HOST_BUFFER_SIZE_CP_SIZE 7 +#define OCF_INQUIRY_CANCEL 0x0002 -#define MAX_IAC_LAP 0x40 -#define OCF_READ_CURRENT_IAC_LAP 0x0039 +#define OCF_PERIODIC_INQUIRY 0x0003 typedef struct { - uint8_t status; - uint8_t num_current_iac; - uint8_t lap[3][MAX_IAC_LAP]; -} __attribute__ ((packed)) read_current_iac_lap_rp; -#define READ_CURRENT_IAC_LAP_RP_SIZE 2+3*MAX_IAC_LAP - -#define OCF_WRITE_CURRENT_IAC_LAP 0x003A -typedef struct { - uint8_t num_current_iac; - uint8_t lap[3][MAX_IAC_LAP]; -} __attribute__ ((packed)) write_current_iac_lap_cp; -#define WRITE_CURRENT_IAC_LAP_CP_SIZE 1+3*MAX_IAC_LAP + uint16_t max_period; /* 1.28s units */ + uint16_t min_period; /* 1.28s units */ + uint8_t lap[3]; + uint8_t length; /* 1.28s units */ + uint8_t num_rsp; +} __attribute__ ((packed)) periodic_inquiry_cp; +#define PERIODIC_INQUIRY_CP_SIZE 9 -/* Link Control */ -#define OGF_LINK_CTL 0x01 +#define OCF_EXIT_PERIODIC_INQUIRY 0x0004 -#define OCF_CREATE_CONN 0x0005 +#define OCF_CREATE_CONN 0x0005 typedef struct { bdaddr_t bdaddr; - uint16_t pkt_type; - uint8_t pscan_rep_mode; - uint8_t pscan_mode; - uint16_t clock_offset; - uint8_t role_switch; + uint16_t pkt_type; + uint8_t pscan_rep_mode; + uint8_t pscan_mode; + uint16_t clock_offset; + uint8_t role_switch; } __attribute__ ((packed)) create_conn_cp; #define CREATE_CONN_CP_SIZE 13 -#define OCF_ACCEPT_CONN_REQ 0x0009 -typedef struct { - bdaddr_t bdaddr; - uint8_t role; -} __attribute__ ((packed)) accept_conn_req_cp; -#define ACCEPT_CONN_REQ_CP_SIZE 7 - -#define OCF_REJECT_CONN_REQ 0x000a -typedef struct { - bdaddr_t bdaddr; - uint8_t reason; -} __attribute__ ((packed)) reject_conn_req_cp; -#define REJECT_CONN_REQ_CP_SIZE 7 - -#define OCF_DISCONNECT 0x0006 +#define OCF_DISCONNECT 0x0006 typedef struct { - uint16_t handle; - uint8_t reason; + uint16_t handle; + uint8_t reason; } __attribute__ ((packed)) disconnect_cp; #define DISCONNECT_CP_SIZE 3 -#define OCF_ADD_SCO 0x0007 +#define OCF_ADD_SCO 0x0007 typedef struct { - uint16_t handle; - uint16_t pkt_type; + uint16_t handle; + uint16_t pkt_type; } __attribute__ ((packed)) add_sco_cp; #define ADD_SCO_CP_SIZE 4 -#define OCF_INQUIRY 0x0001 -typedef struct { - uint8_t lap[3]; - uint8_t length; - uint8_t num_rsp; -} __attribute__ ((packed)) inquiry_cp; -#define INQUIRY_CP_SIZE 5 - +#define OCF_ACCEPT_CONN_REQ 0x0009 typedef struct { - uint8_t status; bdaddr_t bdaddr; -} __attribute__ ((packed)) status_bdaddr_rp; -#define STATUS_BDADDR_RP_SIZE 7 - -#define OCF_INQUIRY_CANCEL 0x0002 + uint8_t role; +} __attribute__ ((packed)) accept_conn_req_cp; +#define ACCEPT_CONN_REQ_CP_SIZE 7 -#define OCF_PERIODIC_INQUIRY 0x0003 +#define OCF_REJECT_CONN_REQ 0x000a typedef struct { - uint16_t max_period; /* 1.28s units */ - uint16_t min_period; /* 1.28s units */ - uint8_t lap[3]; - uint8_t length; /* 1.28s units */ - uint8_t num_rsp; -} __attribute__ ((packed)) periodic_inquiry_cp; -#define PERIODIC_INQUIRY_CP_SIZE 9 - -#define OCF_EXIT_PERIODIC_INQUIRY 0x0004 + bdaddr_t bdaddr; + uint8_t reason; +} __attribute__ ((packed)) reject_conn_req_cp; +#define REJECT_CONN_REQ_CP_SIZE 7 -#define OCF_LINK_KEY_REPLY 0x000B -#define OCF_LINK_KEY_NEG_REPLY 0x000C +#define OCF_LINK_KEY_REPLY 0x000B typedef struct { bdaddr_t bdaddr; - uint8_t link_key[16]; + uint8_t link_key[16]; } __attribute__ ((packed)) link_key_reply_cp; #define LINK_KEY_REPLY_CP_SIZE 22 -#define OCF_PIN_CODE_REPLY 0x000D -#define OCF_PIN_CODE_NEG_REPLY 0x000E +#define OCF_LINK_KEY_NEG_REPLY 0x000C + +#define OCF_PIN_CODE_REPLY 0x000D typedef struct { bdaddr_t bdaddr; - uint8_t pin_len; - uint8_t pin_code[16]; + uint8_t pin_len; + uint8_t pin_code[16]; } __attribute__ ((packed)) pin_code_reply_cp; #define PIN_CODE_REPLY_CP_SIZE 23 -#define OCF_SET_CONN_PTYPE 0x000F +#define OCF_PIN_CODE_NEG_REPLY 0x000E + +#define OCF_SET_CONN_PTYPE 0x000F typedef struct { uint16_t handle; uint16_t pkt_type; } __attribute__ ((packed)) set_conn_ptype_cp; #define SET_CONN_PTYPE_CP_SIZE 4 -#define OCF_AUTH_REQUESTED 0x0011 +#define OCF_AUTH_REQUESTED 0x0011 typedef struct { uint16_t handle; } __attribute__ ((packed)) auth_requested_cp; #define AUTH_REQUESTED_CP_SIZE 2 -#define OCF_SET_CONN_ENCRYPT 0x0013 +#define OCF_SET_CONN_ENCRYPT 0x0013 typedef struct { uint16_t handle; - uint8_t encrypt; + uint8_t encrypt; } __attribute__ ((packed)) set_conn_encrypt_cp; #define SET_CONN_ENCRYPT_CP_SIZE 3 -#define OCF_REMOTE_NAME_REQ 0x0019 +#define OCF_REMOTE_NAME_REQ 0x0019 typedef struct { bdaddr_t bdaddr; - uint8_t pscan_rep_mode; - uint8_t pscan_mode; + uint8_t pscan_rep_mode; + uint8_t pscan_mode; uint16_t clock_offset; } __attribute__ ((packed)) remote_name_req_cp; #define REMOTE_NAME_REQ_CP_SIZE 10 -#define OCF_READ_REMOTE_FEATURES 0x001B +#define OCF_READ_REMOTE_FEATURES 0x001B typedef struct { uint16_t handle; } __attribute__ ((packed)) read_remote_features_cp; #define READ_REMOTE_FEATURES_CP_SIZE 2 -#define OCF_READ_REMOTE_VERSION 0x001D +#define OCF_READ_REMOTE_VERSION 0x001D typedef struct { uint16_t handle; } __attribute__ ((packed)) read_remote_version_cp; #define READ_REMOTE_VERSION_CP_SIZE 2 -#define OCF_READ_CLOCK_OFFSET 0x001F +#define OCF_READ_CLOCK_OFFSET 0x001F typedef struct { uint16_t handle; } __attribute__ ((packed)) read_clock_offset_cp; #define READ_CLOCK_OFFSET_CP_SIZE 2 /* Link Policy */ -#define OGF_LINK_POLICY 0x02 +#define OGF_LINK_POLICY 0x02 -#define OCF_HOLD_MODE 0x0001 +#define OCF_HOLD_MODE 0x0001 typedef struct { uint16_t handle; uint16_t max_interval; @@ -578,7 +364,7 @@ typedef struct { } __attribute__ ((packed)) hold_mode_cp; #define HOLD_MODE_CP_SIZE 6 -#define OCF_SNIFF_MODE 0x0003 +#define OCF_SNIFF_MODE 0x0003 typedef struct { uint16_t handle; uint16_t max_interval; @@ -588,13 +374,13 @@ typedef struct { } __attribute__ ((packed)) sniff_mode_cp; #define SNIFF_MODE_CP_SIZE 10 -#define OCF_EXIT_SNIFF_MODE 0x0004 +#define OCF_EXIT_SNIFF_MODE 0x0004 typedef struct { uint16_t handle; } __attribute__ ((packed)) exit_sniff_mode_cp; #define EXIT_SNIFF_MODE_CP_SIZE 2 -#define OCF_PARK_MODE 0x0005 +#define OCF_PARK_MODE 0x0005 typedef struct { uint16_t handle; uint16_t max_interval; @@ -602,22 +388,21 @@ typedef struct { } __attribute__ ((packed)) park_mode_cp; #define PARK_MODE_CP_SIZE 6 -#define OCF_EXIT_PARK_MODE 0x0006 +#define OCF_EXIT_PARK_MODE 0x0006 typedef struct { uint16_t handle; } __attribute__ ((packed)) exit_park_mode_cp; #define EXIT_PARK_MODE_CP_SIZE 2 +#define OCF_QOS_SETUP 0x0007 typedef struct { - uint8_t service_type; /* 1 = best effort */ + uint8_t service_type; /* 1 = best effort */ uint32_t token_rate; /* Byte per seconds */ uint32_t peak_bandwidth; /* Byte per seconds */ uint32_t latency; /* Microseconds */ uint32_t delay_variation; /* Microseconds */ } __attribute__ ((packed)) hci_qos; #define HCI_QOS_CP_SIZE 17 - -#define OCF_QOS_SETUP 0x0007 typedef struct { uint16_t handle; uint8_t flags; /* Reserved */ @@ -625,19 +410,26 @@ typedef struct { } __attribute__ ((packed)) qos_setup_cp; #define QOS_SETUP_CP_SIZE (3 + HCI_QOS_CP_SIZE) -#define OCF_ROLE_DISCOVERY 0x0009 +#define OCF_ROLE_DISCOVERY 0x0009 typedef struct { uint16_t handle; } __attribute__ ((packed)) role_discovery_cp; #define ROLE_DISCOVERY_CP_SIZE 2 typedef struct { - uint8_t status; + uint8_t status; uint16_t handle; - uint8_t role; + uint8_t role; } __attribute__ ((packed)) role_discovery_rp; #define ROLE_DISCOVERY_RP_SIZE 4 -#define OCF_READ_LINK_POLICY 0x000C +#define OCF_SWITCH_ROLE 0x000B +typedef struct { + bdaddr_t bdaddr; + uint8_t role; +} __attribute__ ((packed)) switch_role_cp; +#define SWITCH_ROLE_CP_SIZE 7 + +#define OCF_READ_LINK_POLICY 0x000C typedef struct { uint16_t handle; } __attribute__ ((packed)) read_link_policy_cp; @@ -649,14 +441,7 @@ typedef struct { } __attribute__ ((packed)) read_link_policy_rp; #define READ_LINK_POLICY_RP_SIZE 5 -#define OCF_SWITCH_ROLE 0x000B -typedef struct { - bdaddr_t bdaddr; - uint8_t role; -} __attribute__ ((packed)) switch_role_cp; -#define SWITCH_ROLE_CP_SIZE 7 - -#define OCF_WRITE_LINK_POLICY 0x000D +#define OCF_WRITE_LINK_POLICY 0x000D typedef struct { uint16_t handle; uint16_t policy; @@ -668,47 +453,264 @@ typedef struct { } __attribute__ ((packed)) write_link_policy_rp; #define WRITE_LINK_POLICY_RP_SIZE 3 +/* Host Controller and Baseband */ +#define OGF_HOST_CTL 0x03 + +#define OCF_RESET 0x0003 + +#define OCF_SET_EVENT_FLT 0x0005 +typedef struct { + uint8_t flt_type; + uint8_t cond_type; + uint8_t condition[0]; +} __attribute__ ((packed)) set_event_flt_cp; +#define SET_EVENT_FLT_CP_SIZE 2 + +/* Filter types */ +#define FLT_CLEAR_ALL 0x00 +#define FLT_INQ_RESULT 0x01 +#define FLT_CONN_SETUP 0x02 +/* CONN_SETUP Condition types */ +#define CONN_SETUP_ALLOW_ALL 0x00 +#define CONN_SETUP_ALLOW_CLASS 0x01 +#define CONN_SETUP_ALLOW_BDADDR 0x02 +/* CONN_SETUP Conditions */ +#define CONN_SETUP_AUTO_OFF 0x01 +#define CONN_SETUP_AUTO_ON 0x02 + +#define OCF_CHANGE_LOCAL_NAME 0x0013 +typedef struct { + uint8_t name[248]; +} __attribute__ ((packed)) change_local_name_cp; +#define CHANGE_LOCAL_NAME_CP_SIZE 248 + +#define OCF_READ_LOCAL_NAME 0x0014 +typedef struct { + uint8_t status; + uint8_t name[248]; +} __attribute__ ((packed)) read_local_name_rp; +#define READ_LOCAL_NAME_RP_SIZE 249 + +#define OCF_WRITE_CA_TIMEOUT 0x0016 +#define OCF_WRITE_PG_TIMEOUT 0x0018 + +#define OCF_READ_PAGE_TIMEOUT 0x0017 +typedef struct { + uint8_t status; + uint16_t timeout; +} __attribute__ ((packed)) read_page_timeout_rp; +#define READ_PAGE_TIMEOUT_RP_SIZE 3 + +#define OCF_WRITE_PAGE_TIMEOUT 0x0018 +typedef struct { + uint16_t timeout; +} __attribute__ ((packed)) write_page_timeout_cp; +#define WRITE_PAGE_TIMEOUT_CP_SIZE 2 + +#define OCF_WRITE_SCAN_ENABLE 0x001A + #define SCAN_DISABLED 0x00 + #define SCAN_INQUIRY 0x01 + #define SCAN_PAGE 0x02 + +#define OCF_READ_PAGE_ACTIVITY 0x001B +typedef struct { + uint8_t status; + uint16_t interval; + uint16_t window; +} __attribute__ ((packed)) read_page_activity_rp; +#define READ_PAGE_ACTIVITY_RP_SIZE 5 + +#define OCF_WRITE_PAGE_ACTIVITY 0x001C +typedef struct { + uint16_t interval; + uint16_t window; +} __attribute__ ((packed)) write_page_activity_cp; +#define WRITE_PAGE_ACTIVITY_CP_SIZE 4 + +#define OCF_READ_INQ_ACTIVITY 0x001D +typedef struct { + uint8_t status; + uint16_t interval; + uint16_t window; +} __attribute__ ((packed)) read_inq_activity_rp; +#define READ_INQ_ACTIVITY_RP_SIZE 5 + +#define OCF_WRITE_INQ_ACTIVITY 0x001E +typedef struct { + uint16_t interval; + uint16_t window; +} __attribute__ ((packed)) write_inq_activity_cp; +#define WRITE_INQ_ACTIVITY_CP_SIZE 4 + +#define OCF_READ_AUTH_ENABLE 0x001F + +#define OCF_WRITE_AUTH_ENABLE 0x0020 + #define AUTH_DISABLED 0x00 + #define AUTH_ENABLED 0x01 + +#define OCF_READ_ENCRYPT_MODE 0x0021 + +#define OCF_WRITE_ENCRYPT_MODE 0x0022 + #define ENCRYPT_DISABLED 0x00 + #define ENCRYPT_P2P 0x01 + #define ENCRYPT_BOTH 0x02 + +#define OCF_READ_CLASS_OF_DEV 0x0023 +typedef struct { + uint8_t status; + uint8_t dev_class[3]; +} __attribute__ ((packed)) read_class_of_dev_rp; +#define READ_CLASS_OF_DEV_RP_SIZE 4 + +#define OCF_WRITE_CLASS_OF_DEV 0x0024 +typedef struct { + uint8_t dev_class[3]; +} __attribute__ ((packed)) write_class_of_dev_cp; +#define WRITE_CLASS_OF_DEV_CP_SIZE 3 + +#define OCF_READ_VOICE_SETTING 0x0025 +typedef struct { + uint8_t status; + uint16_t voice_setting; +} __attribute__ ((packed)) read_voice_setting_rp; +#define READ_VOICE_SETTING_RP_SIZE 3 + +#define OCF_WRITE_VOICE_SETTING 0x0026 +typedef struct { + uint16_t voice_setting; +} __attribute__ ((packed)) write_voice_setting_cp; +#define WRITE_VOICE_SETTING_CP_SIZE 2 + +#define OCF_READ_TRANSMIT_POWER_LEVEL 0x002D +typedef struct { + uint16_t handle; + uint8_t type; +} __attribute__ ((packed)) read_transmit_power_level_cp; +#define READ_TRANSMIT_POWER_LEVEL_CP_SIZE 3 +typedef struct { + uint8_t status; + uint16_t handle; + int8_t level; +} __attribute__ ((packed)) read_transmit_power_level_rp; +#define READ_TRANSMIT_POWER_LEVEL_RP_SIZE 4 + +#define OCF_HOST_BUFFER_SIZE 0x0033 +typedef struct { + uint16_t acl_mtu; + uint8_t sco_mtu; + uint16_t acl_max_pkt; + uint16_t sco_max_pkt; +} __attribute__ ((packed)) host_buffer_size_cp; +#define HOST_BUFFER_SIZE_CP_SIZE 7 + +#define OCF_READ_LINK_SUPERVISION_TIMEOUT 0x0036 +typedef struct { + uint8_t status; + uint16_t handle; + uint16_t link_sup_to; +} __attribute__ ((packed)) read_link_supervision_timeout_rp; +#define READ_LINK_SUPERVISION_TIMEOUT_RP_SIZE 5 + +#define OCF_WRITE_LINK_SUPERVISION_TIMEOUT 0x0037 +typedef struct { + uint16_t handle; + uint16_t link_sup_to; +} __attribute__ ((packed)) write_link_supervision_timeout_cp; +#define WRITE_LINK_SUPERVISION_TIMEOUT_CP_SIZE 4 + +#define MAX_IAC_LAP 0x40 +#define OCF_READ_CURRENT_IAC_LAP 0x0039 +typedef struct { + uint8_t status; + uint8_t num_current_iac; + uint8_t lap[3][MAX_IAC_LAP]; +} __attribute__ ((packed)) read_current_iac_lap_rp; +#define READ_CURRENT_IAC_LAP_RP_SIZE 2+3*MAX_IAC_LAP + +#define OCF_WRITE_CURRENT_IAC_LAP 0x003A +typedef struct { + uint8_t num_current_iac; + uint8_t lap[3][MAX_IAC_LAP]; +} __attribute__ ((packed)) write_current_iac_lap_cp; +#define WRITE_CURRENT_IAC_LAP_CP_SIZE 1+3*MAX_IAC_LAP + +/* Informational Parameters */ +#define OGF_INFO_PARAM 0x04 + +#define OCF_READ_LOCAL_VERSION 0x0001 +typedef struct { + uint8_t status; + uint8_t hci_ver; + uint16_t hci_rev; + uint8_t lmp_ver; + uint16_t manufacturer; + uint16_t lmp_subver; +} __attribute__ ((packed)) read_local_version_rp; +#define READ_LOCAL_VERSION_RP_SIZE 9 + +#define OCF_READ_LOCAL_FEATURES 0x0003 +typedef struct { + uint8_t status; + uint8_t features[8]; +} __attribute__ ((packed)) read_local_features_rp; + +#define OCF_READ_BUFFER_SIZE 0x0005 +typedef struct { + uint8_t status; + uint16_t acl_mtu; + uint8_t sco_mtu; + uint16_t acl_max_pkt; + uint16_t sco_max_pkt; +} __attribute__ ((packed)) read_buffer_size_rp; + +#define OCF_READ_BD_ADDR 0x0009 +typedef struct { + uint8_t status; + bdaddr_t bdaddr; +} __attribute__ ((packed)) read_bd_addr_rp; + /* Status params */ -#define OGF_STATUS_PARAM 0x05 +#define OGF_STATUS_PARAM 0x05 -#define OCF_READ_FAILED_CONTACT_COUNTER 0x0001 +#define OCF_READ_FAILED_CONTACT_COUNTER 0x0001 typedef struct { - uint8_t status; + uint8_t status; uint16_t handle; - uint8_t counter; + uint8_t counter; } __attribute__ ((packed)) read_failed_contact_counter_rp; #define READ_FAILED_CONTACT_COUNTER_RP_SIZE 4 - -#define OCF_RESET_FAILED_CONTACT_COUNTER 0x0002 + +#define OCF_RESET_FAILED_CONTACT_COUNTER 0x0002 typedef struct { - uint8_t status; + uint8_t status; uint16_t handle; } __attribute__ ((packed)) reset_failed_contact_counter_rp; -#define OCF_RESET_FAILED_CONTACT_COUNTER_RP_SIZE 4 - -#define OCF_GET_LINK_QUALITY 0x0003 +#define RESET_FAILED_CONTACT_COUNTER_RP_SIZE 4 + +#define OCF_GET_LINK_QUALITY 0x0003 typedef struct { - uint8_t status; + uint8_t status; uint16_t handle; - uint8_t link_quality; + uint8_t link_quality; } __attribute__ ((packed)) get_link_quality_rp; #define GET_LINK_QUALITY_RP_SIZE 4 - -#define OCF_READ_RSSI 0x0005 + +#define OCF_READ_RSSI 0x0005 typedef struct { - uint8_t status; + uint8_t status; uint16_t handle; - int8_t rssi; + int8_t rssi; } __attribute__ ((packed)) read_rssi_rp; #define READ_RSSI_RP_SIZE 4 - + /* Testing commands */ -#define OGF_TESTING_CMD 0x3e +#define OGF_TESTING_CMD 0x3e /* Vendor specific commands */ -#define OGF_VENDOR_CMD 0x3f +#define OGF_VENDOR_CMD 0x3f /* ---- HCI Events ---- */ + #define EVT_INQUIRY_COMPLETE 0x01 #define EVT_INQUIRY_RESULT 0x02 -- cgit From 630afac09ee16b0e398b2ab87beba55dec8d7f89 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 3 Jul 2003 00:02:25 +0000 Subject: Sort HCI events --- include/hci.h | 176 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 88 insertions(+), 88 deletions(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 99f01f7f..89ef19b6 100644 --- a/include/hci.h +++ b/include/hci.h @@ -280,7 +280,7 @@ typedef struct { } __attribute__ ((packed)) accept_conn_req_cp; #define ACCEPT_CONN_REQ_CP_SIZE 7 -#define OCF_REJECT_CONN_REQ 0x000a +#define OCF_REJECT_CONN_REQ 0x000A typedef struct { bdaddr_t bdaddr; uint8_t reason; @@ -711,143 +711,155 @@ typedef struct { /* ---- HCI Events ---- */ -#define EVT_INQUIRY_COMPLETE 0x01 +#define EVT_INQUIRY_COMPLETE 0x01 -#define EVT_INQUIRY_RESULT 0x02 +#define EVT_INQUIRY_RESULT 0x02 typedef struct { bdaddr_t bdaddr; - uint8_t pscan_rep_mode; - uint8_t pscan_period_mode; - uint8_t pscan_mode; - uint8_t dev_class[3]; + uint8_t pscan_rep_mode; + uint8_t pscan_period_mode; + uint8_t pscan_mode; + uint8_t dev_class[3]; uint16_t clock_offset; } __attribute__ ((packed)) inquiry_info; #define INQUIRY_INFO_SIZE 14 -#define EVT_CONN_COMPLETE 0x03 +#define EVT_CONN_COMPLETE 0x03 typedef struct { - uint8_t status; + uint8_t status; uint16_t handle; bdaddr_t bdaddr; - uint8_t link_type; - uint8_t encr_mode; + uint8_t link_type; + uint8_t encr_mode; } __attribute__ ((packed)) evt_conn_complete; #define EVT_CONN_COMPLETE_SIZE 13 -#define EVT_CONN_REQUEST 0x04 +#define EVT_CONN_REQUEST 0x04 typedef struct { bdaddr_t bdaddr; - uint8_t dev_class[3]; + uint8_t dev_class[3]; uint8_t link_type; } __attribute__ ((packed)) evt_conn_request; #define EVT_CONN_REQUEST_SIZE 10 -#define EVT_DISCONN_COMPLETE 0x05 +#define EVT_DISCONN_COMPLETE 0x05 typedef struct { - uint8_t status; + uint8_t status; uint16_t handle; - uint8_t reason; + uint8_t reason; } __attribute__ ((packed)) evt_disconn_complete; #define EVT_DISCONN_COMPLETE_SIZE 4 -#define EVT_AUTH_COMPLETE 0x06 +#define EVT_AUTH_COMPLETE 0x06 typedef struct { - uint8_t status; + uint8_t status; uint16_t handle; } __attribute__ ((packed)) evt_auth_complete; #define EVT_AUTH_COMPLETE_SIZE 3 #define EVT_REMOTE_NAME_REQ_COMPLETE 0x07 typedef struct { - uint8_t status; + uint8_t status; bdaddr_t bdaddr; - uint8_t name[248]; + uint8_t name[248]; } __attribute__ ((packed)) evt_remote_name_req_complete; #define EVT_REMOTE_NAME_REQ_COMPLETE_SIZE 255 -#define EVT_ENCRYPT_CHANGE 0x08 +#define EVT_ENCRYPT_CHANGE 0x08 typedef struct { - uint8_t status; + uint8_t status; uint16_t handle; - uint8_t encrypt; + uint8_t encrypt; } __attribute__ ((packed)) evt_encrypt_change; #define EVT_ENCRYPT_CHANGE_SIZE 5 -#define EVT_QOS_SETUP_COMPLETE 0x0D +#define EVT_READ_REMOTE_FEATURES_COMPLETE 0x0B typedef struct { - uint8_t status; + uint8_t status; uint16_t handle; - uint8_t flags; /* Reserved */ - hci_qos qos; -} __attribute__ ((packed)) evt_qos_setup_complete; -#define EVT_QOS_SETUP_COMPLETE_SIZE (4 + HCI_QOS_CP_SIZE) + uint8_t features[8]; +} __attribute__ ((packed)) evt_read_remote_features_complete; +#define EVT_READ_REMOTE_FEATURES_COMPLETE_SIZE 11 -#define EVT_MODE_CHANGE 0x14 +#define EVT_READ_REMOTE_VERSION_COMPLETE 0x0C typedef struct { uint8_t status; uint16_t handle; - uint8_t mode; - uint16_t interval; -} __attribute__ ((packed)) evt_mode_change; -#define EVT_MODE_CHANGE_SIZE 6 + uint8_t lmp_ver; + uint16_t manufacturer; + uint16_t lmp_subver; +} __attribute__ ((packed)) evt_read_remote_version_complete; +#define EVT_READ_REMOTE_VERSION_COMPLETE_SIZE 8 -#define EVT_QOS_VIOLATION 0x1E +#define EVT_QOS_SETUP_COMPLETE 0x0D typedef struct { + uint8_t status; uint16_t handle; -} __attribute__ ((packed)) evt_qos_violation; -#define EVT_QOS_VIOLATION_SIZE 2 + uint8_t flags; /* Reserved */ + hci_qos qos; +} __attribute__ ((packed)) evt_qos_setup_complete; +#define EVT_QOS_SETUP_COMPLETE_SIZE (4 + HCI_QOS_CP_SIZE) -#define EVT_CMD_COMPLETE 0x0e +#define EVT_CMD_COMPLETE 0x0E typedef struct { - uint8_t ncmd; - uint16_t opcode; + uint8_t ncmd; + uint16_t opcode; } __attribute__ ((packed)) evt_cmd_complete; #define EVT_CMD_COMPLETE_SIZE 3 -#define EVT_CMD_STATUS 0x0f +#define EVT_CMD_STATUS 0x0F typedef struct { - uint8_t status; - uint8_t ncmd; + uint8_t status; + uint8_t ncmd; uint16_t opcode; } __attribute__ ((packed)) evt_cmd_status; #define EVT_CMD_STATUS_SIZE 4 -#define EVT_NUM_COMP_PKTS 0x13 +#define EVT_ROLE_CHANGE 0x12 +typedef struct { + uint8_t status; + bdaddr_t bdaddr; + uint8_t role; +} __attribute__ ((packed)) evt_role_change; +#define EVT_ROLE_CHANGE_SIZE 8 + +#define EVT_NUM_COMP_PKTS 0x13 typedef struct { uint8_t num_hndl; /* variable length part */ } __attribute__ ((packed)) evt_num_comp_pkts; #define EVT_NUM_COMP_PKTS_SIZE 1 -#define EVT_ROLE_CHANGE 0x12 +#define EVT_MODE_CHANGE 0x14 typedef struct { - uint8_t status; - bdaddr_t bdaddr; - uint8_t role; -} __attribute__ ((packed)) evt_role_change; -#define EVT_ROLE_CHANGE_SIZE 8 + uint8_t status; + uint16_t handle; + uint8_t mode; + uint16_t interval; +} __attribute__ ((packed)) evt_mode_change; +#define EVT_MODE_CHANGE_SIZE 6 -#define EVT_PIN_CODE_REQ 0x16 +#define EVT_PIN_CODE_REQ 0x16 typedef struct { bdaddr_t bdaddr; } __attribute__ ((packed)) evt_pin_code_req; #define EVT_PIN_CODE_REQ_SIZE 6 -#define EVT_LINK_KEY_REQ 0x17 +#define EVT_LINK_KEY_REQ 0x17 typedef struct { bdaddr_t bdaddr; } __attribute__ ((packed)) evt_link_key_req; #define EVT_LINK_KEY_REQ_SIZE 6 -#define EVT_LINK_KEY_NOTIFY 0x18 +#define EVT_LINK_KEY_NOTIFY 0x18 typedef struct { bdaddr_t bdaddr; - uint8_t link_key[16]; - uint8_t key_type; + uint8_t link_key[16]; + uint8_t key_type; } __attribute__ ((packed)) evt_link_key_notify; #define EVT_LINK_KEY_NOTIFY_SIZE 23 -#define EVT_READ_CLOCK_OFFSET_COMPLETE 0x1C +#define EVT_READ_CLOCK_OFFSET_COMPLETE 0x1C typedef struct { uint8_t status; uint16_t handle; @@ -855,41 +867,33 @@ typedef struct { } __attribute__ ((packed)) evt_read_clock_offset_complete; #define EVT_READ_CLOCK_OFFSET_COMPLETE_SIZE 5 -#define EVT_CONN_PTYPE_CHANGED 0x1D +#define EVT_CONN_PTYPE_CHANGED 0x1D typedef struct { - uint8_t status; - uint16_t handle; - uint16_t ptype; + uint8_t status; + uint16_t handle; + uint16_t ptype; } __attribute__ ((packed)) evt_conn_ptype_changed; #define EVT_CONN_PTYPE_CHANGED_SIZE 5 -#define EVT_READ_REMOTE_FEATURES_COMPLETE 0x0B +#define EVT_QOS_VIOLATION 0x1E typedef struct { - uint8_t status; uint16_t handle; - uint8_t features[8]; -} __attribute__ ((packed)) evt_read_remote_features_complete; -#define EVT_READ_REMOTE_FEATURES_COMPLETE_SIZE 11 +} __attribute__ ((packed)) evt_qos_violation; +#define EVT_QOS_VIOLATION_SIZE 2 -#define EVT_READ_REMOTE_VERSION_COMPLETE 0x0C -typedef struct { - uint8_t status; - uint16_t handle; - uint8_t lmp_ver; - uint16_t manufacturer; - uint16_t lmp_subver; -} __attribute__ ((packed)) evt_read_remote_version_complete; -#define EVT_READ_REMOTE_VERSION_COMPLETE_SIZE 8 +#define EVT_TESTING 0xFE + +#define EVT_VENDOR 0xFF /* Internal events generated by BlueZ stack */ -#define EVT_STACK_INTERNAL 0xfd +#define EVT_STACK_INTERNAL 0xFD typedef struct { uint16_t type; - uint8_t data[0]; + uint8_t data[0]; } __attribute__ ((packed)) evt_stack_internal; #define EVT_STACK_INTERNAL_SIZE 2 -#define EVT_SI_DEVICE 0x01 +#define EVT_SI_DEVICE 0x01 typedef struct { uint16_t event; uint16_t dev_id; @@ -901,25 +905,21 @@ typedef struct { uint16_t event; uint16_t proto; uint16_t subproto; - uint8_t incoming; + uint8_t incoming; } __attribute__ ((packed)) evt_si_security; -#define EVT_TESTING 0xfe - -#define EVT_VENDOR 0xff - /* -------- HCI Packet structures -------- */ #define HCI_TYPE_LEN 1 typedef struct { uint16_t opcode; /* OCF & OGF */ - uint8_t plen; + uint8_t plen; } __attribute__ ((packed)) hci_command_hdr; #define HCI_COMMAND_HDR_SIZE 3 typedef struct { - uint8_t evt; - uint8_t plen; + uint8_t evt; + uint8_t plen; } __attribute__ ((packed)) hci_event_hdr; #define HCI_EVENT_HDR_SIZE 2 @@ -931,7 +931,7 @@ typedef struct { typedef struct { uint16_t handle; - uint8_t dlen; + uint8_t dlen; } __attribute__ ((packed)) hci_sco_hdr; #define HCI_SCO_HDR_SIZE 3 @@ -957,8 +957,8 @@ typedef struct { #define HCI_CMSG_TSTAMP 0x0002 struct sockaddr_hci { - sa_family_t hci_family; - unsigned short hci_dev; + sa_family_t hci_family; + unsigned short hci_dev; }; #define HCI_DEV_NONE 0xffff -- cgit From b45841191f6ab4cc55ccd040a5530c2d08c6ddc6 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 3 Jul 2003 00:06:26 +0000 Subject: Cleanup --- include/bluetooth.h | 16 ++++++++-------- include/l2cap.h | 4 ++-- include/sco.h | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index c09e99d4..1667fd12 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -37,23 +37,23 @@ extern "C" { #include #include #include - + #ifndef AF_BLUETOOTH #define AF_BLUETOOTH 31 #define PF_BLUETOOTH AF_BLUETOOTH #endif -#define BTPROTO_L2CAP 0 -#define BTPROTO_HCI 1 -#define BTPROTO_SCO 2 +#define BTPROTO_L2CAP 0 +#define BTPROTO_HCI 1 +#define BTPROTO_SCO 2 #define BTPROTO_RFCOMM 3 #define BTPROTO_BNEP 4 #define BTPROTO_CMTP 5 -#define SOL_HCI 0 -#define SOL_L2CAP 6 -#define SOL_SCO 17 -#define SOL_RFCOMM 18 +#define SOL_HCI 0 +#define SOL_L2CAP 6 +#define SOL_SCO 17 +#define SOL_RFCOMM 18 /* Connection and socket states */ enum { diff --git a/include/l2cap.h b/include/l2cap.h index dec00efc..a5110a24 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -34,7 +34,7 @@ extern "C" { #endif /* L2CAP defaults */ -#define L2CAP_DEFAULT_MTU 672 +#define L2CAP_DEFAULT_MTU 672 #define L2CAP_DEFAULT_FLUSH_TO 0xFFFF #define L2CAP_CONN_TIMEOUT (HZ * 40) @@ -54,7 +54,7 @@ struct l2cap_options { uint16_t flush_to; }; -#define L2CAP_CONNINFO 0x02 +#define L2CAP_CONNINFO 0x02 struct l2cap_conninfo { uint16_t hci_handle; }; diff --git a/include/sco.h b/include/sco.h index c02bd7ae..d8bc54b6 100644 --- a/include/sco.h +++ b/include/sco.h @@ -34,10 +34,10 @@ extern "C" { #endif /* SCO defaults */ -#define SCO_DEFAULT_MTU 500 +#define SCO_DEFAULT_MTU 500 #define SCO_DEFAULT_FLUSH_TO 0xFFFF -#define SCO_CONN_TIMEOUT (HZ * 40) +#define SCO_CONN_TIMEOUT (HZ * 40) #define SCO_DISCONN_TIMEOUT (HZ * 2) #define SCO_CONN_IDLE_TIMEOUT (HZ * 60) @@ -48,12 +48,12 @@ struct sockaddr_sco { }; /* set/get sockopt defines */ -#define SCO_OPTIONS 0x01 +#define SCO_OPTIONS 0x01 struct sco_options { uint16_t mtu; }; -#define SCO_CONNINFO 0x02 +#define SCO_CONNINFO 0x02 struct sco_conninfo { uint16_t hci_handle; }; -- cgit From aac33d6b2e0c3c7b021478feb320afd8c812bda9 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 18 Nov 2003 11:36:20 +0000 Subject: Add decoding of Bluetooth 1.2 features --- include/hci.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 89ef19b6..fee39c20 100644 --- a/include/hci.h +++ b/include/hci.h @@ -200,6 +200,23 @@ enum { #define LMP_PSCHEME 0x02 #define LMP_PCONTROL 0x04 #define LMP_TRSP_SCO 0x08 +#define LMP_BCAST_ENC 0x80 + +#define LMP_ENH_ISCAN 0x08 +#define LMP_ILACE_ISCAN 0x10 +#define LMP_ILACE_PSCAN 0x20 +#define LMP_RSSI_INQ 0x40 +#define LMP_ESCO 0x80 + +#define LMP_EV4 0x01 +#define LMP_EV5 0x02 +#define LMP_AFH_CAP_SLV 0x08 +#define LMP_AFH_CLS_SLV 0x10 + +#define LMP_AFH_CAP_MST 0x08 +#define LMP_AFH_CLS_MST 0x10 + +#define LMP_EXT_FEAT 0x80 /* Link policies */ #define HCI_LP_RSWITCH 0x0001 -- cgit From d6a0b8361301a4e153a45020d6522f722537000a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 9 Mar 2004 15:39:56 +0000 Subject: Add HIDP protocol identifier --- include/bluetooth.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index 1667fd12..f4ceaae5 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -49,6 +49,7 @@ extern "C" { #define BTPROTO_RFCOMM 3 #define BTPROTO_BNEP 4 #define BTPROTO_CMTP 5 +#define BTPROTO_HIDP 6 #define SOL_HCI 0 #define SOL_L2CAP 6 -- cgit From ca16ae22dd4542899a4a8c9a843fc6f7e72dbab4 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 31 Mar 2004 16:35:56 +0000 Subject: Add header files of the SDP library --- include/Makefile.am | 2 +- include/sdp.h | 396 ++++++++++++++++++++++++++++++++++++ include/sdp_internal.h | 216 ++++++++++++++++++++ include/sdp_lib.h | 529 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 1142 insertions(+), 1 deletion(-) create mode 100644 include/sdp.h create mode 100644 include/sdp_internal.h create mode 100644 include/sdp_lib.h (limited to 'include') diff --git a/include/Makefile.am b/include/Makefile.am index 27a769fa..f615705a 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -4,7 +4,7 @@ includedir = @includedir@/bluetooth -include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h rfcomm.h +include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h rfcomm.h sdp.h sdp_lib.h sdp_internal.h bluetooth: ln -s . bluetooth diff --git a/include/sdp.h b/include/sdp.h new file mode 100644 index 00000000..77564850 --- /dev/null +++ b/include/sdp.h @@ -0,0 +1,396 @@ +/* + Service Discovery Protocol (SDP) + Copyright (C) 2002 Maxim Krasnyansky + + Based on original SDP implementation by Nokia Corporation. + Copyright (C) 2001,2002 Nokia Corporation. + Original author Guruprasad Krishnamurthy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY CLAIM, + OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER + RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE + USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, COPYRIGHTS, + TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS SOFTWARE IS DISCLAIMED. +*/ + +/* + * $Id$ + */ + +#ifndef SDP_H +#define SDP_H + +#include + +#define SDP_UNIX_PATH "/var/run/sdp" +#define SDP_RESPONSE_TIMEOUT 20 +#define SDP_REQ_BUFFER_SIZE 2048 +#define SDP_RSP_BUFFER_SIZE 65535 +#define SDP_PDU_CHUNK_SIZE 1024 + +/* + * All definitions are based on Bluetooth Assigned Numbers + * of the Bluetooth Specification + */ +#define SDP_PSM 0x0001 + +/* + * Protocol UUIDs + */ +#define SDP_UUID 0x0001 +#define RFCOMM_UUID 0x0003 +#define TCS_BIN_UUID 0x0005 +#define L2CAP_UUID 0x0100 +#define IP_UUID 0x0009 +#define UDP_UUID 0x0002 +#define TCP_UUID 0x0004 +#define TCS_BIN_UUID 0x0005 +#define TCS_AT_UUID 0x0006 +#define OBEX_UUID 0x0008 +#define FTP_UUID 0x000A +#define HTTP_UUID 0x000C +#define WSP_UUID 0x000E +#define BNEP_UUID 0x000F +#define HIDP_UUID 0x0011 +#define CMTP_UUID 0x001B + +/* + * Service class identifiers of standard services and service groups + */ +#define SDP_SERVER_SVCLASS_ID 0x1000 +#define BROWSE_GRP_DESC_SVCLASS_ID 0x1001 +#define PUBLIC_BROWSE_GROUP 0x1002 +#define SERIAL_PORT_SVCLASS_ID 0x1101 +#define LAN_ACCESS_SVCLASS_ID 0x1102 +#define DIALUP_NET_SVCLASS_ID 0x1103 +#define IRMC_SYNC_SVCLASS_ID 0x1104 +#define OBEX_OBJPUSH_SVCLASS_ID 0x1105 +#define OBEX_FILETRANS_SVCLASS_ID 0x1106 +#define IRMC_SYNC_CMD_SVCLASS_ID 0x1107 +#define HEADSET_SVCLASS_ID 0x1108 +#define CORDLESS_TELEPHONY_SVCLASS_ID 0x1109 +#define INTERCOM_SVCLASS_ID 0x1110 +#define FAX_SVCLASS_ID 0x1111 +#define HEADSET_AGW_SVCLASS_ID 0x1112 +#define PANU_SVCLASS_ID 0x1115 +#define NAP_SVCLASS_ID 0x1116 +#define GN_SVCLASS_ID 0x1117 +#define IMAGING_SVCLASS_ID 0x111a +#define IMAGING_RESPONDER_SVCLASS_ID 0x111b +#define HANDSFREE_SVCLASS_ID 0x111e +#define HANDSFREE_AUDIO_GW_SVCLASS_ID 0x111f +#define HID_SVCLASS_ID 0x1124 +#define CIP_SVCLASS_ID 0x1128 +#define PNP_INFO_SVCLASS_ID 0x1200 +#define GENERIC_NETWORKING_SVCLASS_ID 0x1201 +#define GENERIC_FILETRANS_SVCLASS_ID 0x1202 +#define GENERIC_AUDIO_SVCLASS_ID 0x1203 +#define GENERIC_TELEPHONY_SVCLASS_ID 0x1204 + +/* + * Standard profile descriptor identifiers; note these + * may be identical to some of the service classes defined above + */ +#define SERIAL_PORT_PROFILE_ID 0x1101 +#define LAN_ACCESS_PROFILE_ID 0x1102 +#define DIALUP_NET_PROFILE_ID 0x1103 +#define IRMC_SYNC_PROFILE_ID 0x1104 +#define OBEX_OBJPUSH_PROFILE_ID 0x1105 +#define OBEX_FILETRANS_PROFILE_ID 0x1106 +#define IRMC_SYNC_CMD_PROFILE_ID 0x1107 +#define HEADSET_PROFILE_ID 0x1108 +#define CORDLESS_TELEPHONY_PROFILE_ID 0x1109 +#define INTERCOM_PROFILE_ID 0x1110 +#define FAX_PROFILE_ID 0x1111 +#define HEADSET_AGW_PROFILE_ID 0x1112 +#define PANU_PROFILE_ID 0x1115 +#define NAP_PROFILE_ID 0x1116 +#define GN_PROFILE_ID 0x1117 +#define IMAGING_PROFILE_ID 0x111a +#define IMAGING_RESPONDER_PROFILE_ID 0x111b +#define HANDSFREE_PROFILE_ID 0x111e +#define HID_PROFILE_ID 0x1124 +#define CIP_PROFILE_ID 0x1128 + +/* + * Attribute identifier codes + */ +#define SDP_SERVER_RECORD_HANDLE 0x0000 + +/* + * Possible values for attribute-id are listed below. + * See SDP Spec, section "Service Attribute Definitions" for more details. + */ +#define SDP_ATTR_RECORD_HANDLE 0x0000 +#define SDP_ATTR_SVCLASS_ID_LIST 0x0001 +#define SDP_ATTR_RECORD_STATE 0x0002 +#define SDP_ATTR_SERVICE_ID 0x0003 +#define SDP_ATTR_PROTO_DESC_LIST 0x0004 +#define SDP_ATTR_BROWSE_GRP_LIST 0x0005 +#define SDP_ATTR_LANG_BASE_ATTR_ID_LIST 0x0006 +#define SDP_ATTR_SVCINFO_TTL 0x0007 +#define SDP_ATTR_SERVICE_AVAILABILITY 0x0008 +#define SDP_ATTR_PFILE_DESC_LIST 0x0009 +#define SDP_ATTR_DOC_URL 0x000A +#define SDP_ATTR_CLNT_EXEC_URL 0x000B +#define SDP_ATTR_ICON_URL 0x000C + +#define SDP_ATTR_IP_SUBNET 0x0200 +#define SDP_ATTR_SERVICE_VERSION 0x0300 +#define SDP_EXTERNAL_NETWORK 0x0301 +#define SDP_ATTR_SUPPORTED_DATA_STORES_LIST 0x0301 +#define SDP_ATTR_REMOTE_AUDIO_VOLUME_CONTROL 0x0302 +#define SDP_ATTR_SUPPORTED_FORMATS_LIST 0x0303 +#define SDP_ATTR_SECURITY_DESC 0x030A +#define SDP_ATTR_NET_ACCESS_TYPE 0x030B +#define SDP_ATTR_MAX_NET_ACCESSRATE 0x030C +#define SDP_ATTR_IP4_SUBNET 0x030D +#define SDP_ATTR_IP6_SUBNET 0x030E +#define SDP_SUPPORTED_FEATURES 0x0311 + + +/* + * These identifiers are based on the SDP spec stating that + * "base attribute id of the primary (universal) language must be 0x0100" + */ +#define SDP_PRIMARY_LANG_BASE 0x0100 + +#define SDP_ATTR_SVCNAME_PRIMARY 0x0000 + SDP_PRIMARY_LANG_BASE +#define SDP_ATTR_SVCDESC_PRIMARY 0x0001 + SDP_PRIMARY_LANG_BASE +#define SDP_ATTR_PROVNAME_PRIMARY 0x0002 + SDP_PRIMARY_LANG_BASE + +/* + * Other languages should have their own offset; e.g.: + * #define XXXLangBase yyyy + * #define AttrServiceName_XXX 0x0000+XXXLangBase + * ... + */ + +/* + * These attributes are specific to the SDP server only; i.e., + * can be present only in the service record of the SDP server + */ +#define SDP_ATTR_VERSION_NUM_LIST 0x0200 +#define SDP_ATTR_SVCDB_STATE 0x0201 +#define SDP_ATTR_GROUP_ID 0x0200 + +/* + * The Data representation in SDP PDUs (pps 339, 340 of BT SDP Spec) + * These are the exact data type+size descriptor values + * that go into the PDU buffer. + * + * The datatype (leading 5bits) + size descriptor (last 3 bits) + * is 8 bits. The size descriptor is critical to extract the + * right number of bytes for the data value from the PDU. + * + * For most basic types, the datatype+size descriptor is + * straightforward. However for constructed types and strings, + * the size of the data is in the next "n" bytes following the + * 8 bits (datatype+size) descriptor. Exactly what the "n" is + * specified in the 3 bits of the data size descriptor. + * + * TextString and URLString can be of size 2^{8, 16, 32} bytes + * DataSequence and DataSequenceAlternates can be of size 2^{8, 16, 32} + * The size are computed post-facto in the API and are not known apriori + */ +#define SDP_DATA_NIL 0x00 +#define SDP_UINT8 0x08 +#define SDP_UINT16 0x09 +#define SDP_UINT32 0x0A +#define SDP_UINT64 0x0B +#define SDP_UINT128 0x0C +#define SDP_INT8 0x10 +#define SDP_INT16 0x11 +#define SDP_INT32 0x12 +#define SDP_INT64 0x13 +#define SDP_INT128 0x14 +#define SDP_UUID_UNSPEC 0x18 +#define SDP_UUID16 0x19 +#define SDP_UUID32 0x1A +#define SDP_UUID128 0x1C +#define SDP_TEXT_STR_UNSPEC 0x20 +#define SDP_TEXT_STR8 0x25 +#define SDP_TEXT_STR16 0x26 +#define SDP_TEXT_STR32 0x27 +#define SDP_BOOL 0x28 +#define SDP_SEQ_UNSPEC 0x30 +#define SDP_SEQ8 0x35 +#define SDP_SEQ16 0x36 +#define SDP_SEQ32 0x37 +#define SDP_ALT_UNSPEC 0x38 +#define SDP_ALT8 0x3D +#define SDP_ALT16 0x3E +#define SDP_ALT32 0x3F +#define SDP_URL_STR_UNSPEC 0x40 +#define SDP_URL_STR8 0x45 +#define SDP_URL_STR16 0x46 +#define SDP_URL_STR32 0x47 + +/* + * The PDU identifiers of SDP packets between client and server + */ +#define SDP_ERROR_RSP 0x01 +#define SDP_SVC_SEARCH_REQ 0x02 +#define SDP_SVC_SEARCH_RSP 0x03 +#define SDP_SVC_ATTR_REQ 0x04 +#define SDP_SVC_ATTR_RSP 0x05 +#define SDP_SVC_SEARCH_ATTR_REQ 0x06 +#define SDP_SVC_SEARCH_ATTR_RSP 0x07 + +/* + * Some additions to support service registration. + * These are outside the scope of the Bluetooth specification + */ +#define SDP_SVC_REGISTER_REQ 0x75 +#define SDP_SVC_REGISTER_RSP 0x76 +#define SDP_SVC_UPDATE_REQ 0x77 +#define SDP_SVC_UPDATE_RSP 0x78 +#define SDP_SVC_REMOVE_REQ 0x79 +#define SDP_SVC_REMOVE_RSP 0x80 + +/* + * Values of the flags parameter to sdp_record_register + */ +#define SDP_RECORD_PERSIST 0x01 + +/* + * Values of the flags parameter to sdp_connect + */ +#define SDP_RETRY_IF_BUSY 0x01 + +/* + * SDP Error codes + */ +#define SDP_INVALID_VERSION 0x0001 +#define SDP_INVALID_RECORD_HANDLE 0x0002 +#define SDP_INVALID_SYNTAX 0x0003 +#define SDP_INVALID_PDU_SIZE 0x0004 +#define SDP_INVALID_CSTATE 0x0005 + +/* + * SDP PDU + */ +typedef struct { + uint8_t pdu_id; + uint16_t tid; + uint16_t plen; +} __attribute__ ((packed)) sdp_pdu_hdr_t; + +/* + * Common definitions for attributes in the SDP. + * Should the type of any of these change, you need only make a change here. + */ +typedef struct { + char data[16]; +} uint128_t; + +typedef struct { + uint8_t type; + union { + uint16_t uuid16; + uint32_t uuid32; + uint128_t uuid128; + } value; +} uuid_t; + +#define SDP_IS_UUID(x) ((x) == SDP_UUID16 || (x) == SDP_UUID32 || (x) ==SDP_UUID128) + +typedef struct _sdp_list sdp_list_t; +struct _sdp_list { + sdp_list_t *next; + void *data; +}; + +/* + * User-visible strings can be in many languages + * in addition to the universal language. + * + * Language meta-data includes language code in ISO639 + * followed by the encoding format. The third field in this + * structure is the attribute offset for the language. + * User-visible strings in the specified language can be + * obtained at this offset. + */ +typedef struct { + uint16_t code_ISO639; + uint16_t encoding; + uint16_t base_offset; +} sdp_lang_attr_t; + +/* + * Profile descriptor is the Bluetooth profile metadata. If a + * service conforms to a well-known profile, then its profile + * identifier (UUID) is an attribute of the service. In addition, + * if the profile has a version number it is specified here. + */ +typedef struct { + uuid_t uuid; + uint16_t version; +} sdp_profile_desc_t; + +typedef struct { + uint8_t major; + uint8_t minor; +} sdp_version_t; + +typedef struct { + char *data; + int data_size; + int buf_size; +} sdp_buf_t; + +typedef struct { + uint32_t handle; + + /* + * Search pattern: a sequence of all UUIDs seen in this record + */ + sdp_list_t *pattern; + sdp_list_t *attrlist; +} sdp_record_t; + +typedef struct sdp_data_struct sdp_data_t; +struct sdp_data_struct { + uint8_t dtd; + uint16_t attrId; + union { + int8_t int8; + int16_t int16; + int32_t int32; + int64_t int64; + uint128_t int128; + uint8_t uint8; + uint16_t uint16; + uint32_t uint32; + uint64_t uint64; + uint128_t uint128; + uuid_t uuid; + char *str; + sdp_data_t *dataseq; + } val; + sdp_data_t *next; + int unitSize; +}; + +/* + * a session with an SDP server + */ +typedef struct { + int sock; + int state; + int local; + int flags; + uint16_t tid; // Current transaction ID +} sdp_session_t; + +#endif diff --git a/include/sdp_internal.h b/include/sdp_internal.h new file mode 100644 index 00000000..fabf7a0d --- /dev/null +++ b/include/sdp_internal.h @@ -0,0 +1,216 @@ +/* + Service Discovery Protocol (SDP) + Copyright (C) 2002 Maxim Krasnyansky , Stephen Crane + + Based on original SDP implementation by Nokia Corporation. + Copyright (C) 2001,2002 Nokia Corporation. + Original author Guruprasad Krishnamurthy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY CLAIM, + OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER + RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE + USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, COPYRIGHTS, + TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS SOFTWARE IS DISCLAIMED. +*/ + +/* + * $Id$ + */ + +#ifndef SDP_INTERNAL_H +#define SDP_INTERNAL_H + +#include +#include +#include +#include + +#define SDPINF(fmt, arg...) syslog(LOG_INFO, fmt "\n", ## arg) +#define SDPERR(fmt, arg...) syslog(LOG_ERR, "%s: " fmt "\n", __func__ , ## arg) + +#ifdef SDP_DEBUG +#define SDPDBG(fmt, arg...) syslog(LOG_DEBUG, "%s: " fmt "\n", __func__ , ## arg) +#else +#define SDPDBG(fmt...) +#endif + +#define SDP_BASIC_ATTR_PDUFORM_SIZE 32 +#define SDP_SEQ_PDUFORM_SIZE 128 +#define SDP_UUID_SEQ_SIZE 256 +#define SDP_MAX_ATTR_LEN 65535 + +/* + * Generate unique transaction identifiers + */ +static inline uint16_t sdp_gen_tid(sdp_session_t *session) +{ + return session->tid++; +} + +sdp_record_t *sdp_extract_pdu(const char *pdata, int *scanned); +sdp_data_t *sdp_extract_string(char *, int *); + +void sdp_data_print(sdp_data_t *data); +void sdp_print_service_attr(sdp_list_t *alist); + +int sdp_attrid_comp_func(const void *key1, const void *key2); + +void sdp_set_seq_len(char *ptr, int length); +void sdp_set_attrid(sdp_buf_t *pdu, uint16_t id); +void sdp_append_to_pdu(sdp_buf_t *dst, sdp_data_t *d); +void sdp_append_to_buf(sdp_buf_t *dst, char *data, int len); + +int sdp_gen_pdu(sdp_buf_t *pdu, sdp_data_t *data); +int sdp_gen_record_pdu(const sdp_record_t *rec, sdp_buf_t *pdu); + +int sdp_extract_seqtype(const char *buf, uint8_t *dtdp, int *seqlen); + +sdp_data_t *sdp_extract_attr(const char *pdata, int *extractedLength, sdp_record_t *rec); + +void sdp_pattern_add_uuid(sdp_record_t *rec, uuid_t *uuid); +void sdp_pattern_add_uuidseq(sdp_record_t *rec, sdp_list_t *seq); + +int sdp_send_req_w4_rsp(sdp_session_t *session, char *req, char *rsp, int reqsize, int *rspsize); + +typedef struct { + uint8_t length; + unsigned char data[16]; +} __attribute__ ((packed)) sdp_cstate_t; + +/* + * SDP unaligned access. + * based on linux/asm-/unaligned.h + */ +#if defined(__i386__) + +#define sdp_get_unaligned(ptr) (*(ptr)) +#define sdp_put_unaligned(val, ptr) ((void)( *(ptr) = (val) )) + +#else + +struct __una_u64 { uint64_t x; } __attribute__((packed)); +struct __una_u32 { uint32_t x; } __attribute__((packed)); +struct __una_u16 { uint16_t x; } __attribute__((packed)); + +static inline unsigned long long __uldq(const unsigned long *r11) +{ + const struct __una_u64 *ptr = (const struct __una_u64 *) r11; + return ptr->x; +} + +static inline unsigned long __uldl(const unsigned int * r11) +{ + const struct __una_u32 *ptr = (const struct __una_u32 *) r11; + return ptr->x; +} + +static inline unsigned long __uldw(const unsigned short * r11) +{ + const struct __una_u16 *ptr = (const struct __una_u16 *) r11; + return ptr->x; +} + +static inline void __ustq(unsigned long r5, unsigned long * r11) +{ + struct __una_u64 *ptr = (struct __una_u64 *) r11; + ptr->x = r5; +} + +static inline void __ustl(unsigned long r5, unsigned int * r11) +{ + struct __una_u32 *ptr = (struct __una_u32 *) r11; + ptr->x = r5; +} + +static inline void __ustw(unsigned long r5, unsigned short * r11) +{ + struct __una_u16 *ptr = (struct __una_u16 *) r11; + ptr->x = r5; +} + +static inline unsigned long long __sdp_get_unaligned(const void *ptr, size_t size) +{ + unsigned long long val = 0; + switch (size) { + case 1: + val = *(const unsigned char *)ptr; + break; + case 2: + val = __uldw((const unsigned short *)ptr); + break; + case 4: + val = __uldl((const unsigned int *)ptr); + break; + case 8: + val = __uldq((const unsigned long *)ptr); + break; + } + return val; +} + +static inline void __sdp_put_unaligned(unsigned long val, void *ptr, size_t size) +{ + switch (size) { + case 1: + *(unsigned char *)ptr = (val); + break; + case 2: + __ustw(val, (unsigned short *)ptr); + break; + case 4: + __ustl(val, (unsigned int *)ptr); + break; + case 8: + __ustq(val, (unsigned long *)ptr); + break; + } +} + +#define sdp_get_unaligned(ptr) \ + ((__typeof__(*(ptr)))__sdp_get_unaligned((ptr), sizeof(*(ptr)))) + +#define sdp_put_unaligned(x,ptr) \ + __sdp_put_unaligned((unsigned long)(x), (ptr), sizeof(*(ptr))) + +#endif + +#if __BYTE_ORDER == __BIG_ENDIAN +#define ntoh64(x) x +static inline void ntoh128(uint128_t *src, uint128_t *dst) +{ + int i; + for (i=0; i < 16; i++) + dst->data[i] = src->data[i]; +} +#else +static inline uint64_t ntoh64(uint64_t n) +{ + uint64_t h; + uint64_t tmp = ntohl(n & 0x00000000ffffffff); + h = ntohl(n >> 32); + h |= tmp << 32; + return h; +} + +static inline void ntoh128(uint128_t *src, uint128_t *dst) +{ + int i; + for (i=0; i < 16; i++) + dst->data[15 - i] = src->data[i]; +} +#endif + +#define hton64(x) ntoh64(x) +#define hton128(x,y) ntoh128(x,y) + +#endif diff --git a/include/sdp_lib.h b/include/sdp_lib.h new file mode 100644 index 00000000..4306eb55 --- /dev/null +++ b/include/sdp_lib.h @@ -0,0 +1,529 @@ +/* + Service Discovery Protocol (SDP) + Copyright (C) 2002 Maxim Krasnyansky , Stephen Crane + + Based on original SDP implementation by Nokia Corporation. + Copyright (C) 2001,2002 Nokia Corporation. + Original author Guruprasad Krishnamurthy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY CLAIM, + OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER + RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE + USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, COPYRIGHTS, + TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS SOFTWARE IS DISCLAIMED. + */ + +/* + * $Id$ + */ + +#ifndef SDP_LIB_H +#define SDP_LIB_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * SDP lists + */ +typedef void(*sdp_list_func_t)(void *, void *); +typedef void(*sdp_free_func_t)(void *); +typedef int (*sdp_comp_func_t)(const void *, const void *); + +sdp_list_t *sdp_list_append(sdp_list_t *list, void *d); +sdp_list_t *sdp_list_remove(sdp_list_t *list, void *d); +sdp_list_t *sdp_list_insert_sorted(sdp_list_t *list, void *data, sdp_comp_func_t f); +void sdp_list_free(sdp_list_t *list, sdp_free_func_t f); + +static inline int sdp_list_len(const sdp_list_t *list) +{ + int n = 0; + for (; list; list = list->next) + n++; + return n; +} + +static inline sdp_list_t *sdp_list_find(sdp_list_t *list, void *u, sdp_comp_func_t f) +{ + for (; list; list = list->next) + if (f(list->data, u) == 0) + return list; + return NULL; +} + +static inline void sdp_list_foreach(sdp_list_t *list, sdp_list_func_t f, void *u) +{ + for (; list; list = list->next) + f(list->data, u); +} + +/* + * create an L2CAP connection to a Bluetooth device + * + * INPUT: + * + * bdaddr_t *src: + * Address of the local device to use to make the connection + * (or BDADDR_ANY) + * + * bdaddr_t *dst: + * Address of the SDP server device + */ +sdp_session_t *sdp_connect(const bdaddr_t *src, const bdaddr_t *dst, uint32_t flags); +int sdp_close(sdp_session_t *session); + +static inline int sdp_get_socket(const sdp_session_t *s) +{ + return s->sock; +} + +/* + * find all devices in the piconet + */ +int sdp_general_inquiry(inquiry_info *ii, int dev_num, int duration, uint8_t *found); + +/* flexible extraction of basic attributes - Jean II */ +int sdp_get_int_attr(const sdp_record_t *rec, uint16_t attr, int *value); +int sdp_get_string_attr(const sdp_record_t *rec, uint16_t attr, char *value, int valuelen); + +/* + * Basic sdp data functions + */ +sdp_data_t *sdp_data_alloc(uint8_t dtd, const void *value); +void sdp_data_free(sdp_data_t *data); +sdp_data_t *sdp_data_get(const sdp_record_t *rec, uint16_t attr_id); + +sdp_data_t *sdp_seq_alloc(void **dtds, void **values, int len); +sdp_data_t *sdp_seq_append(sdp_data_t *seq, sdp_data_t *data); + +int sdp_attr_add(sdp_record_t *rec, uint16_t attr, sdp_data_t *data); +void sdp_attr_remove(sdp_record_t *rec, uint16_t attr); +void sdp_attr_replace(sdp_record_t *rec, uint16_t attr, sdp_data_t *data); +int sdp_set_uuidseq_attr(sdp_record_t *rec, uint16_t attr, sdp_list_t *seq); +int sdp_get_uuidseq_attr(const sdp_record_t *rec, uint16_t attr, sdp_list_t **seqp); + +/* + * NOTE that none of the functions below will update the SDP server, + * unless the {register, update}sdp_record_t() function is invoked. + * All functions which return an integer value, return 0 on success + * or -1 on failure. + */ + +/* + * Create an attribute and add it to the service record's attribute list. + * This consists of the data type descriptor of the attribute, + * the value of the attribute and the attribute identifier. + */ +int sdp_attr_add_new(sdp_record_t *rec, uint16_t attr, uint8_t dtd, const void *p); + +/* + * Set the information attributes of the service record. + * The set of attributes comprises service name, description + * and provider name + */ +void sdp_set_info_attr(sdp_record_t *rec, const char *name, const char *prov, const char *desc); + +/* + * Set the ServiceClassID attribute to the sequence specified by seq. + * Note that the identifiers need to be in sorted order from the most + * specific to the most generic service class that this service + * conforms to. + */ +static inline int sdp_set_service_classes(sdp_record_t *rec, sdp_list_t *seq) +{ + return sdp_set_uuidseq_attr(rec, SDP_ATTR_SVCLASS_ID_LIST, seq); +} + +/* + * Get the service classes to which the service conforms. + * + * When set, the list contains elements of ServiceClassIdentifer(uint16_t) + * ordered from most specific to most generic + */ +static inline int sdp_get_service_classes(const sdp_record_t *rec, sdp_list_t **seqp) +{ + return sdp_get_uuidseq_attr(rec, SDP_ATTR_SVCLASS_ID_LIST, seqp); +} + +/* + * Set the BrowseGroupList attribute to the list specified by seq. + * + * A service can belong to one or more service groups + * and the list comprises such group identifiers (UUIDs) + */ +static inline int sdp_set_browse_groups(sdp_record_t *rec, sdp_list_t *seq) +{ + return sdp_set_uuidseq_attr(rec, SDP_ATTR_BROWSE_GRP_LIST, seq); +} + +/* + * Set the access protocols of the record to those specified in proto + */ +int sdp_set_access_protos(sdp_record_t *rec, const sdp_list_t *proto); + +/* + * Get protocol port (i.e. PSM for L2CAP, Channel for RFCOMM) + */ +int sdp_get_proto_port(const sdp_list_t *list, int proto); + +/* + * Get protocol descriptor. + */ +sdp_data_t *sdp_get_proto_desc(sdp_list_t *list, int proto); + +/* + * Set the LanguageBase attributes to the values specified in list + * (a linked list of sdp_lang_attr_t objects, one for each language in + * which user-visible attributes are present). + */ +int sdp_set_lang_attr(sdp_record_t *rec, const sdp_list_t *list); + +/* + * Set the ServiceInfoTimeToLive attribute of the service. + * This is the number of seconds that this record is guaranteed + * not to change after being obtained by a client. + */ +static inline int sdp_set_service_ttl(sdp_record_t *rec, uint32_t ttl) +{ + return sdp_attr_add_new(rec, SDP_ATTR_SVCINFO_TTL, SDP_UINT32, &ttl); +} + +/* + * Set the ServiceRecordState attribute of a service. This is + * guaranteed to change if there is any kind of modification to + * the record. + */ +static inline int sdp_set_record_state(sdp_record_t *rec, uint32_t state) +{ + return sdp_attr_add_new(rec, SDP_ATTR_RECORD_STATE, SDP_UINT32, &state); +} + +/* + * Set the ServiceID attribute of a service. + */ +void sdp_set_service_id(sdp_record_t *rec, uuid_t uuid); + +/* + * Set the GroupID attribute of a service + */ +void sdp_set_group_id(sdp_record_t *rec, uuid_t grouuuid); + +/* + * Set the ServiceAvailability attribute of a service. + * + * Note that this represents the relative availability + * of the service: 0x00 means completely unavailable; + * 0xFF means maximum availability. + */ +static inline int sdp_set_service_avail(sdp_record_t *rec, uint8_t avail) +{ + return sdp_attr_add_new(rec, SDP_ATTR_SERVICE_AVAILABILITY, SDP_UINT8, &avail); +} + +/* + * Set the profile descriptor list attribute of a record. + * + * Each element in the list is an object of type + * sdp_profile_desc_t which is a definition of the + * Bluetooth profile that this service conforms to. + */ +int sdp_set_profile_descs(sdp_record_t *rec, const sdp_list_t *desc); + +/* + * Set URL attributes of a record. + * + * ClientExecutableURL: a URL to a client's platform specific (WinCE, + * PalmOS) executable code that can be used to access this service. + * + * DocumentationURL: a URL pointing to service documentation + * + * IconURL: a URL to an icon that can be used to represent this service. + * + * Note: pass NULL for any URLs that you don't want to set or remove + */ +void sdp_set_url_attr(sdp_record_t *rec, const char *clientExecURL, const char *docURL, const char *iconURL); + +/* + * a service search request. + * + * INPUT : + * + * sdp_list_t *search_list + * list containing elements of the search + * pattern. Each entry in the list is a UUID + * of the service to be searched + * + * uint16_t max_rec_num + * An integer specifying the maximum number of + * entries that the client can handle in the response. + * + * OUTPUT : + * + * int return value + * 0 + * The request completed successfully. This does not + * mean the requested services were found + * -1 + * The request completed unsuccessfully + * + * sdp_list_t *rsp_list + * This variable is set on a successful return if there are + * non-zero service handles. It is a singly linked list of + * service records (sdp_record_t) + */ +int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search_list, uint16_t max_rec_num, sdp_list_t **rsp_list); + +/* + * a service attribute request. + * + * INPUT : + * + * uint32_t handle + * The handle of the service for which the attribute(s) are + * requested + * + * sdp_attrreq_type_t reqtype + * Attribute identifiers are 16 bit unsigned integers specified + * in one of 2 ways described below : + * SDP_ATTR_REQ_INDIVIDUAL - 16bit individual identifiers + * They are the actual attribute identifiers in ascending order + * + * SDP_ATTR_REQ_RANGE - 32bit identifier range + * The high-order 16bits is the start of range + * the low-order 16bits are the end of range + * 0x0000 to 0xFFFF gets all attributes + * + * sdp_list_t *attrid_list + * Singly linked list containing attribute identifiers desired. + * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL) + * or a uint32_t(attrSpec=SDP_ATTR_REQ_RANGE) + * + * OUTPUT : + * int return value + * 0 + * The request completed successfully. This does not + * mean the requested services were found + * -1 + * The request completed unsuccessfully due to a timeout + */ + +typedef enum { + /* + * Attributes are specified as individual elements + */ + SDP_ATTR_REQ_INDIVIDUAL = 1, + /* + * Attributes are specified as a range + */ + SDP_ATTR_REQ_RANGE +} sdp_attrreq_type_t; + +sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list); + +/* + * This is a service search request combined with the service + * attribute request. First a service class match is done and + * for matching service, requested attributes are extracted + * + * INPUT : + * + * sdp_list_t *search_list + * Singly linked list containing elements of the search + * pattern. Each entry in the list is a UUID(DataTypeSDP_UUID16) + * of the service to be searched + * + * AttributeSpecification attrSpec + * Attribute identifiers are 16 bit unsigned integers specified + * in one of 2 ways described below : + * SDP_ATTR_REQ_INDIVIDUAL - 16bit individual identifiers + * They are the actual attribute identifiers in ascending order + * + * SDP_ATTR_REQ_RANGE - 32bit identifier range + * The high-order 16bits is the start of range + * the low-order 16bits are the end of range + * 0x0000 to 0xFFFF gets all attributes + * + * sdp_list_t *attrid_list + * Singly linked list containing attribute identifiers desired. + * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL) + * or a uint32_t(attrSpec=SDP_ATTR_REQ_RANGE) + * + * OUTPUT : + * int return value + * 0 + * The request completed successfully. This does not + * mean the requested services were found + * -1 + * The request completed unsuccessfully due to a timeout + * + * sdp_list_t *rsp_list + * This variable is set on a successful return to point to + * service(s) found. Each element of this list is of type + * sdp_record_t *. + */ +int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search_list, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list, sdp_list_t **rsp_list); + +/* + * Allocate/free a service record and its attributes + */ +sdp_record_t *sdp_record_alloc(void); +void sdp_record_free(sdp_record_t *rec); + +/* + * Register a service record. + * + * Note: It is the responsbility of the Service Provider to create the + * record first and set its attributes using setXXX() methods. + * + * The service provider must then call sdp_record_register() to make + * the service record visible to SDP clients. + */ +int sdp_record_register(sdp_session_t *sess, sdp_record_t *rec, uint8_t flags); + +/* + * Unregister a service record. + */ +int sdp_record_unregister(sdp_session_t *sess, sdp_record_t *rec); + +/* + * Update an existing service record. (Calling this function + * before a previous call to sdp_record_register() will result + * in an error.) + */ +int sdp_record_update(sdp_session_t *sess, const sdp_record_t *rec); + +void sdp_record_print(const sdp_record_t *rec); + +/* + * UUID functions + */ +uuid_t *sdp_uuid16_create(uuid_t *uuid, uint16_t data); +uuid_t *sdp_uuid32_create(uuid_t *uuid, uint32_t data); +uuid_t *sdp_uuid128_create(uuid_t *uuid, const void *data); +int sdp_uuid16_cmp(const void *p1, const void *p2); +int sdp_uuid128_cmp(const void *p1, const void *p2); +uuid_t *sdp_uuid_to_uuid128(uuid_t *uuid); +void sdp_uuid16_to_uuid128(uuid_t *uuid128, uuid_t *uuid16); +int sdp_uuid128_to_uuid(uuid_t *uuid); +int sdp_uuid_to_proto(uuid_t *uuid); +int sdp_uuid_extract(const char *buffer, uuid_t *uuid, int *scanned); +void sdp_uuid_print(const uuid_t *uuid); + +#define MAX_LEN_UUID_STR 37 +#define MAX_LEN_PROTOCOL_UUID_STR 8 +#define MAX_LEN_SERVICECLASS_UUID_STR 24 +#define MAX_LEN_PROFILEDESCRIPTOR_UUID_STR 22 + +int sdp_uuid2strn(const uuid_t *uuid, char *str, size_t n); +int sdp_proto_uuid2strn(const uuid_t *uuid, char *str, size_t n); +int sdp_svclass_uuid2strn(const uuid_t *uuid, char *str, size_t n); +int sdp_profile_uuid2strn(const uuid_t *uuid, char *str, size_t n); + +/* + * In all the sdp_get_XXX(handle, XXX *xxx) functions below, + * the XXX * is set to point to the value, should it exist + * and 0 is returned. If the value does not exist, -1 is + * returned and errno set to ENODATA. + * + * In all the methods below, the memory management rules are + * simple. Don't free anything! The pointer returned, in the + * case of constructed types, is a pointer to the contents + * of the sdp_record_t. + */ + +/* + * Get the access protocols from the service record + */ +int sdp_get_access_protos(const sdp_record_t *rec, sdp_list_t **protos); + +/* + * Extract the list of browse groups to which the service belongs. + * When set, seqp contains elements of GroupID (uint16_t) + */ +static inline int sdp_get_browse_groups(const sdp_record_t *rec, sdp_list_t **seqp) +{ + return sdp_get_uuidseq_attr(rec, SDP_ATTR_BROWSE_GRP_LIST, seqp); +} + +/* + * Extract language attribute meta-data of the service record. + * For each language in the service record, LangSeq has a struct of type + * sdp_lang_attr_t. + */ +int sdp_get_lang_attr(const sdp_record_t *rec, sdp_list_t **langSeq); + +/* + * Extract the Bluetooth profile descriptor sequence from a record. + * Each element in the list is of type sdp_profile_desc_t + * which contains the UUID of the profile and its version number + * (encoded as major and minor in the high-order 8bits + * and low-order 8bits respectively of the uint16_t) + */ +int sdp_get_profile_descs(const sdp_record_t *rec, sdp_list_t **profDesc); + +/* + * Extract SDP server version numbers + * + * Note: that this is an attribute of the SDP server only and + * contains a list of uint16_t each of which represent the + * major and minor SDP version numbers supported by this server + */ +int sdp_get_server_ver(const sdp_record_t *rec, sdp_list_t **pVnumList); + +int sdp_get_service_id(const sdp_record_t *rec, uuid_t *uuid); +int sdp_get_group_id(const sdp_record_t *rec, uuid_t *uuid); +int sdp_get_record_state(const sdp_record_t *rec, uint32_t *svcRecState); +int sdp_get_service_avail(const sdp_record_t *rec, uint8_t *svcAvail); +int sdp_get_service_ttl(const sdp_record_t *rec, uint32_t *svcTTLInfo); +int sdp_get_database_state(const sdp_record_t *rec, uint32_t *svcDBState); + +static inline int sdp_get_service_name(const sdp_record_t *rec, char *str, int len) +{ + return sdp_get_string_attr(rec, SDP_ATTR_SVCNAME_PRIMARY, str, len); +} + +static inline int sdp_get_service_desc(const sdp_record_t *rec, char *str, int len) +{ + return sdp_get_string_attr(rec, SDP_ATTR_SVCDESC_PRIMARY, str, len); +} + +static inline int sdp_get_provider_name(const sdp_record_t *rec, char *str, int len) +{ + return sdp_get_string_attr(rec, SDP_ATTR_PROVNAME_PRIMARY, str, len); +} + +static inline int sdp_get_doc_url(const sdp_record_t *rec, char *str, int len) +{ + return sdp_get_string_attr(rec, SDP_ATTR_DOC_URL, str, len); +} + +static inline int sdp_get_clnt_exec_url(const sdp_record_t *rec, char *str, int len) +{ + return sdp_get_string_attr(rec, SDP_ATTR_CLNT_EXEC_URL, str, len); +} + +static inline int sdp_get_icon_url(const sdp_record_t *rec, char *str, int len) +{ + return sdp_get_string_attr(rec, SDP_ATTR_ICON_URL, str, len); +} + +#ifdef __cplusplus +} +#endif + +#endif -- cgit From 51342992af3f09ffad66197aa84e5960e1fc4c28 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 31 Mar 2004 19:49:50 +0000 Subject: Cleaner way of creating the bluetooth include link --- include/Makefile.am | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/Makefile.am b/include/Makefile.am index f615705a..78afcf73 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -6,9 +6,9 @@ includedir = @includedir@/bluetooth include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h rfcomm.h sdp.h sdp_lib.h sdp_internal.h -bluetooth: - ln -s . bluetooth -all-local: bluetooth +all-local: + @if [ ! -e bluetooth ] ; then ln -s $(top_srcdir)/include bluetooth ; fi + clean-local: - rm -f bluetooth + @rm -f bluetooth -- cgit From cd92094bf45c07b666971d68b228d3340e974b5d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 31 Mar 2004 21:08:51 +0000 Subject: Add CMTP header file --- include/Makefile.am | 2 +- include/cmtp.h | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 include/cmtp.h (limited to 'include') diff --git a/include/Makefile.am b/include/Makefile.am index 78afcf73..22bce597 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -4,7 +4,7 @@ includedir = @includedir@/bluetooth -include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h rfcomm.h sdp.h sdp_lib.h sdp_internal.h +include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h rfcomm.h sdp.h sdp_lib.h sdp_internal.h cmtp.h all-local: diff --git a/include/cmtp.h b/include/cmtp.h new file mode 100644 index 00000000..55cc289d --- /dev/null +++ b/include/cmtp.h @@ -0,0 +1,67 @@ +/* + CMTP protocol definition for Linux Bluetooth stack (BlueZ). + Copyright (C) 2002-2003 Marcel Holtmann + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + SOFTWARE IS DISCLAIMED. +*/ + +#ifndef __CMTP_H +#define __CMTP_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define CMTP_MINIMUM_MTU 152 +#define CMTP_DEFAULT_MTU 672 + +/* CMTP ioctl defines */ +#define CMTPCONNADD _IOW('C', 200, int) +#define CMTPCONNDEL _IOW('C', 201, int) +#define CMTPGETCONNLIST _IOR('C', 210, int) +#define CMTPGETCONNINFO _IOR('C', 211, int) + +#define CMTP_LOOPBACK 0 + +struct cmtp_connadd_req { + int sock; // Connected socket + uint32_t flags; +}; + +struct cmtp_conndel_req { + bdaddr_t bdaddr; + uint32_t flags; +}; + +struct cmtp_conninfo { + bdaddr_t bdaddr; + uint32_t flags; + uint16_t state; + int num; +}; + +struct cmtp_connlist_req { + uint16_t cnum; + struct cmtp_conninfo *ci; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* __CMTP_H */ -- cgit From 66e912c137f52fcac7eab1a7d0d9da65b975b2cc Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 31 Mar 2004 21:56:37 +0000 Subject: Add BNEP header file --- include/Makefile.am | 2 +- include/bnep.h | 148 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 include/bnep.h (limited to 'include') diff --git a/include/Makefile.am b/include/Makefile.am index 22bce597..ec8835a2 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -4,7 +4,7 @@ includedir = @includedir@/bluetooth -include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h rfcomm.h sdp.h sdp_lib.h sdp_internal.h cmtp.h +include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h rfcomm.h sdp.h sdp_lib.h sdp_internal.h bnep.h cmtp.h all-local: diff --git a/include/bnep.h b/include/bnep.h new file mode 100644 index 00000000..0a6daa03 --- /dev/null +++ b/include/bnep.h @@ -0,0 +1,148 @@ +/* + BNEP protocol definition for Linux Bluetooth stack (BlueZ). + Copyright (C) 2002-2003 Maxim Krasnyansky + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License, version 2, as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* + * $Id$ + */ + +#ifndef __BNEP_H +#define __BNEP_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +/* BNEP UUIDs */ +#define BNEP_BASE_UUID 0x0000000000001000800000805F9B34FB +#define BNEP_UUID16 0x02 +#define BNEP_UUID32 0x04 +#define BNEP_UUID128 0x16 + +#define BNEP_SVC_PANU 0x1115 +#define BNEP_SVC_NAP 0x1116 +#define BNEP_SVC_GN 0x1117 + +/* BNEP packet types */ +#define BNEP_GENERAL 0x00 +#define BNEP_CONTROL 0x01 +#define BNEP_COMPRESSED 0x02 +#define BNEP_COMPRESSED_SRC_ONLY 0x03 +#define BNEP_COMPRESSED_DST_ONLY 0x04 + +/* BNEP control types */ +#define BNEP_CMD_NOT_UNDERSTOOD 0x00 +#define BNEP_SETUP_CONN_REQ 0x01 +#define BNEP_SETUP_CONN_RSP 0x02 +#define BNEP_FILTER_NET_TYPE_SET 0x03 +#define BNEP_FILTER_NET_TYPE_RSP 0x04 +#define BNEP_FILTER_MULT_ADDR_SET 0x05 +#define BNEP_FILTER_MULT_ADDR_RSP 0x06 + +/* BNEP response messages */ +#define BNEP_SUCCESS 0x00 + +#define BNEP_CONN_INVALID_DST 0x01 +#define BNEP_CONN_INVALID_SRC 0x02 +#define BNEP_CONN_INVALID_SVC 0x03 +#define BNEP_CONN_NOT_ALLOWED 0x04 + +#define BNEP_FILTER_UNSUPPORTED_REQ 0x01 +#define BNEP_FILTER_INVALID_RANGE 0x02 +#define BNEP_FILTER_INVALID_MCADDR 0x02 +#define BNEP_FILTER_LIMIT_REACHED 0x03 +#define BNEP_FILTER_DENIED_SECURITY 0x04 + +/* L2CAP settings */ +#define BNEP_MTU 1691 +#define BNEP_FLUSH_TO 0xffff +#define BNEP_CONNECT_TO 15 +#define BNEP_FILTER_TO 15 + +#ifndef BNEP_PSM +#define BNEP_PSM 0x0f +#endif + +/* BNEP headers */ +#define BNEP_TYPE_MASK 0x7f +#define BNEP_EXT_HEADER 0x80 + +struct bnep_setup_conn_req { + uint8_t type; + uint8_t ctrl; + uint8_t uuid_size; + uint8_t service[0]; +} __attribute__((packed)); + +struct bnep_set_filter_req { + uint8_t type; + uint8_t ctrl; + uint16_t len; + uint8_t list[0]; +} __attribute__((packed)); + +struct bnep_control_rsp { + uint8_t type; + uint8_t ctrl; + uint16_t resp; +} __attribute__((packed)); + +struct bnep_ext_hdr { + uint8_t type; + uint8_t len; + uint8_t data[0]; +} __attribute__((packed)); + +/* BNEP ioctl defines */ +#define BNEPCONNADD _IOW('B', 200, int) +#define BNEPCONNDEL _IOW('B', 201, int) +#define BNEPGETCONNLIST _IOR('B', 210, int) +#define BNEPGETCONNINFO _IOR('B', 211, int) + +struct bnep_connadd_req { + int sock; // Connected socket + uint32_t flags; + uint16_t role; + char device[16]; // Name of the Ethernet device +}; + +struct bnep_conndel_req { + uint32_t flags; + uint8_t dst[ETH_ALEN]; +}; + +struct bnep_conninfo { + uint32_t flags; + uint16_t role; + uint16_t state; + uint8_t dst[ETH_ALEN]; + char device[16]; +}; + +struct bnep_connlist_req { + uint32_t cnum; + struct bnep_conninfo *ci; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* __BNEP_H */ -- cgit From 99c36169b28df63153d24d1824bd276e68f5f140 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 1 Apr 2004 14:01:15 +0000 Subject: Increase size of UUID string representation --- include/sdp_lib.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 4306eb55..763f80fa 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -426,8 +426,8 @@ void sdp_uuid_print(const uuid_t *uuid); #define MAX_LEN_UUID_STR 37 #define MAX_LEN_PROTOCOL_UUID_STR 8 -#define MAX_LEN_SERVICECLASS_UUID_STR 24 -#define MAX_LEN_PROFILEDESCRIPTOR_UUID_STR 22 +#define MAX_LEN_SERVICECLASS_UUID_STR 28 +#define MAX_LEN_PROFILEDESCRIPTOR_UUID_STR 28 int sdp_uuid2strn(const uuid_t *uuid, char *str, size_t n); int sdp_proto_uuid2strn(const uuid_t *uuid, char *str, size_t n); -- cgit From 764abe23a0d4ede999f1f34ee0e310c0eeaaff79 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 3 Apr 2004 05:11:38 +0000 Subject: Update copyright information --- include/bluetooth.h | 58 +++++++------- include/bnep.h | 51 +++++++------ include/cmtp.h | 50 +++++++------ include/hci.h | 108 +++++++++++++------------- include/hci_lib.h | 58 +++++++------- include/hci_uart.h | 62 ++++++++------- include/hci_vhci.h | 59 ++++++++------- include/l2cap.h | 200 +++++++++++++++++++++++++------------------------ include/rfcomm.h | 96 ++++++++++++------------ include/sco.h | 51 ++++++------- include/sdp.h | 66 +++++++++------- include/sdp_internal.h | 84 ++++++++++++--------- include/sdp_lib.h | 76 ++++++++++--------- 13 files changed, 542 insertions(+), 477 deletions(-) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index f4ceaae5..8690f456 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -1,28 +1,30 @@ -/* - BlueZ - Bluetooth protocol stack for Linux - Copyright (C) 2000-2001 Qualcomm Incorporated - - Written 2000,2001 by Maxim Krasnyansky - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - SOFTWARE IS DISCLAIMED. -*/ - /* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2000-2001 Qualcomm Incorporated + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * * $Id$ */ @@ -104,11 +106,11 @@ static inline void bacpy(bdaddr_t *dst, const bdaddr_t *src) void baswap(bdaddr_t *dst, const bdaddr_t *src); bdaddr_t *strtoba(const char *str); -char *batostr(const bdaddr_t *ba); -int ba2str(const bdaddr_t *ba, char *str); -int str2ba(const char *str, bdaddr_t *ba); +char *batostr(const bdaddr_t *ba); +int ba2str(const bdaddr_t *ba, char *str); +int str2ba(const char *str, bdaddr_t *ba); -int bt_error(uint16_t code); +int bt_error(uint16_t code); char *bt_compidtostr(int id); #ifdef __cplusplus diff --git a/include/bnep.h b/include/bnep.h index 0a6daa03..05ecbfed 100644 --- a/include/bnep.h +++ b/include/bnep.h @@ -1,23 +1,30 @@ /* - BNEP protocol definition for Linux Bluetooth stack (BlueZ). - Copyright (C) 2002-2003 Maxim Krasnyansky - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License, version 2, as - published by the Free Software Foundation. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* - * $Id$ + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id$ */ #ifndef __BNEP_H @@ -117,10 +124,10 @@ struct bnep_ext_hdr { #define BNEPGETCONNINFO _IOR('B', 211, int) struct bnep_connadd_req { - int sock; // Connected socket + int sock; /* Connected socket */ uint32_t flags; uint16_t role; - char device[16]; // Name of the Ethernet device + char device[16]; /* Name of the Ethernet device */ }; struct bnep_conndel_req { @@ -131,7 +138,7 @@ struct bnep_conndel_req { struct bnep_conninfo { uint32_t flags; uint16_t role; - uint16_t state; + uint16_t state; uint8_t dst[ETH_ALEN]; char device[16]; }; diff --git a/include/cmtp.h b/include/cmtp.h index 55cc289d..0883556f 100644 --- a/include/cmtp.h +++ b/include/cmtp.h @@ -1,24 +1,30 @@ -/* - CMTP protocol definition for Linux Bluetooth stack (BlueZ). - Copyright (C) 2002-2003 Marcel Holtmann - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - SOFTWARE IS DISCLAIMED. -*/ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2002-2004 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id$ + */ #ifndef __CMTP_H #define __CMTP_H @@ -39,7 +45,7 @@ extern "C" { #define CMTP_LOOPBACK 0 struct cmtp_connadd_req { - int sock; // Connected socket + int sock; /* Connected socket */ uint32_t flags; }; diff --git a/include/hci.h b/include/hci.h index fee39c20..fc57bbca 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1,28 +1,30 @@ -/* - BlueZ - Bluetooth protocol stack for Linux - Copyright (C) 2000-2001 Qualcomm Incorporated - - Written 2000,2001 by Maxim Krasnyansky - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - SOFTWARE IS DISCLAIMED. -*/ - /* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2000-2001 Qualcomm Incorporated + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * * $Id$ */ @@ -33,7 +35,7 @@ extern "C" { #endif -#define HCI_MAX_DEV 16 +#define HCI_MAX_DEV 16 #define HCI_MAX_ACL_SIZE 1024 #define HCI_MAX_SCO_SIZE 255 @@ -42,7 +44,7 @@ extern "C" { /* HCI dev events */ #define HCI_DEV_REG 1 -#define HCI_DEV_UNREG 2 +#define HCI_DEV_UNREG 2 #define HCI_DEV_UP 3 #define HCI_DEV_DOWN 4 #define HCI_DEV_SUSPEND 5 @@ -52,8 +54,8 @@ extern "C" { #define HCI_VHCI 0 #define HCI_USB 1 #define HCI_PCCARD 2 -#define HCI_UART 3 -#define HCI_RS232 4 +#define HCI_UART 3 +#define HCI_RS232 4 #define HCI_PCI 5 /* HCI device flags */ @@ -72,40 +74,40 @@ enum { }; /* HCI ioctl defines */ -#define HCIDEVUP _IOW('H', 201, int) -#define HCIDEVDOWN _IOW('H', 202, int) -#define HCIDEVRESET _IOW('H', 203, int) -#define HCIDEVRESTAT _IOW('H', 204, int) - -#define HCIGETDEVLIST _IOR('H', 210, int) -#define HCIGETDEVINFO _IOR('H', 211, int) -#define HCIGETCONNLIST _IOR('H', 212, int) -#define HCIGETCONNINFO _IOR('H', 213, int) - -#define HCISETRAW _IOW('H', 220, int) -#define HCISETSCAN _IOW('H', 221, int) -#define HCISETAUTH _IOW('H', 222, int) -#define HCISETENCRYPT _IOW('H', 223, int) -#define HCISETPTYPE _IOW('H', 224, int) -#define HCISETLINKPOL _IOW('H', 225, int) -#define HCISETLINKMODE _IOW('H', 226, int) -#define HCISETACLMTU _IOW('H', 227, int) -#define HCISETSCOMTU _IOW('H', 228, int) - -#define HCIINQUIRY _IOR('H', 240, int) +#define HCIDEVUP _IOW('H', 201, int) +#define HCIDEVDOWN _IOW('H', 202, int) +#define HCIDEVRESET _IOW('H', 203, int) +#define HCIDEVRESTAT _IOW('H', 204, int) + +#define HCIGETDEVLIST _IOR('H', 210, int) +#define HCIGETDEVINFO _IOR('H', 211, int) +#define HCIGETCONNLIST _IOR('H', 212, int) +#define HCIGETCONNINFO _IOR('H', 213, int) + +#define HCISETRAW _IOW('H', 220, int) +#define HCISETSCAN _IOW('H', 221, int) +#define HCISETAUTH _IOW('H', 222, int) +#define HCISETENCRYPT _IOW('H', 223, int) +#define HCISETPTYPE _IOW('H', 224, int) +#define HCISETLINKPOL _IOW('H', 225, int) +#define HCISETLINKMODE _IOW('H', 226, int) +#define HCISETACLMTU _IOW('H', 227, int) +#define HCISETSCOMTU _IOW('H', 228, int) + +#define HCIINQUIRY _IOR('H', 240, int) /* HCI timeouts */ -#define HCI_CONN_TIMEOUT (HZ * 40) -#define HCI_DISCONN_TIMEOUT (HZ * 2) +#define HCI_CONN_TIMEOUT (HZ * 40) +#define HCI_DISCONN_TIMEOUT (HZ * 2) #define HCI_CONN_IDLE_TIMEOUT (HZ * 60) #ifndef __NO_HCI_DEFS /* HCI Packet types */ #define HCI_COMMAND_PKT 0x01 -#define HCI_ACLDATA_PKT 0x02 -#define HCI_SCODATA_PKT 0x03 +#define HCI_ACLDATA_PKT 0x02 +#define HCI_SCODATA_PKT 0x03 #define HCI_EVENT_PKT 0x04 #define HCI_UNKNOWN_PKT 0xff diff --git a/include/hci_lib.h b/include/hci_lib.h index 6b7b6f63..e048375e 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -1,29 +1,31 @@ -/* - BlueZ - Bluetooth protocol stack for Linux - Copyright (C) 2000-2001 Qualcomm Incorporated - - Written 2000,2001 by Maxim Krasnyansky - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - SOFTWARE IS DISCLAIMED. -*/ - /* - * $Id$ + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2000-2001 Qualcomm Incorporated + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id$ */ #ifndef __HCI_LIB_H @@ -64,7 +66,7 @@ int hci_devinfo(int dev_id, struct hci_dev_info *di); int hci_devba(int dev_id, bdaddr_t *ba); int hci_devid(const char *str); -// deprecated: preserve compatibility +/* deprecated: preserve compatibility */ int hci_local_name(int dd, int len, char *name, int to); int hci_read_local_name(int dd, int len, char *name, int to); int hci_write_local_name(int dd, const char *name, int to); @@ -82,7 +84,7 @@ int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to); int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to); int hci_authenticate_link(int dd, uint16_t handle, int to); int hci_encrypt_link(int dd, uint16_t handle, int on, int to); -// role == 0 is master, 1 is slave +/* role == 0 is master, 1 is slave */ int hci_switch_role(int dd, bdaddr_t peer, int role, int to); int hci_park_mode(int dd, uint16_t handle, uint16_t max_interval, uint16_t min_interval, int to); int hci_exit_park_mode(int dd, uint16_t handle, int to); @@ -108,7 +110,7 @@ char *lmp_featurestostr(uint8_t *features, char *pref, int width); static inline void hci_set_bit(int nr, void *addr) { - *((uint32_t *) addr + (nr >> 5)) |= (1 << (nr & 31)); + *((uint32_t *) addr + (nr >> 5)) |= (1 << (nr & 31)); } static inline void hci_clear_bit(int nr, void *addr) diff --git a/include/hci_uart.h b/include/hci_uart.h index e609ed47..0cc97794 100644 --- a/include/hci_uart.h +++ b/include/hci_uart.h @@ -1,34 +1,39 @@ -/* - BlueZ - Bluetooth protocol stack for Linux - Copyright (C) 2000-2001 Qualcomm Incorporated - - Written 2000,2001 by Maxim Krasnyansky - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - SOFTWARE IS DISCLAIMED. -*/ - /* - * $Id$ + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id$ */ #ifndef __HCI_UART_H #define __HCI_UART_H +#ifdef __cplusplus +extern "C" { +#endif + #ifndef N_HCI #define N_HCI 15 #endif @@ -40,6 +45,11 @@ /* UART protocols */ #define HCI_UART_H4 0 #define HCI_UART_BCSP 1 -#define HCI_UART_NCSP 2 +#define HCI_UART_3WIRE 2 +#define HCI_UART_H4DS 3 + +#ifdef __cplusplus +} +#endif #endif /* __HCI_UART_H */ diff --git a/include/hci_vhci.h b/include/hci_vhci.h index 4eee6656..1f5c0efe 100644 --- a/include/hci_vhci.h +++ b/include/hci_vhci.h @@ -1,35 +1,44 @@ -/* - BlueZ - Bluetooth protocol stack for Linux - Copyright (C) 2000-2001 Qualcomm Incorporated - - Written 2000,2001 by Maxim Krasnyansky - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - SOFTWARE IS DISCLAIMED. -*/ - /* - * $Id$ + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id$ */ #ifndef __HCI_VHCI_H #define __HCI_VHCI_H +#ifdef __cplusplus +extern "C" { +#endif + #define VHCI_DEV "/dev/vhci" #define VHCI_MINOR 250 +#ifdef __cplusplus +} +#endif + #endif /* __HCI_VHCI_H */ diff --git a/include/l2cap.h b/include/l2cap.h index a5110a24..d06eb800 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -1,28 +1,30 @@ -/* - BlueZ - Bluetooth protocol stack for Linux - Copyright (C) 2000-2001 Qualcomm Incorporated - - Written 2000,2001 by Maxim Krasnyansky - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - SOFTWARE IS DISCLAIMED. -*/ - /* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2000-2001 Qualcomm Incorporated + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * * $Id$ */ @@ -37,7 +39,7 @@ extern "C" { #define L2CAP_DEFAULT_MTU 672 #define L2CAP_DEFAULT_FLUSH_TO 0xFFFF -#define L2CAP_CONN_TIMEOUT (HZ * 40) +#define L2CAP_CONN_TIMEOUT (HZ * 40) /* L2CAP socket address */ struct sockaddr_l2 { @@ -81,87 +83,87 @@ struct l2cap_qos { #define L2CAP_SERV_GUARANTEED 0x02 /* L2CAP command codes */ -#define L2CAP_COMMAND_REJ 0x01 -#define L2CAP_CONN_REQ 0x02 -#define L2CAP_CONN_RSP 0x03 -#define L2CAP_CONF_REQ 0x04 -#define L2CAP_CONF_RSP 0x05 -#define L2CAP_DISCONN_REQ 0x06 -#define L2CAP_DISCONN_RSP 0x07 -#define L2CAP_ECHO_REQ 0x08 -#define L2CAP_ECHO_RSP 0x09 -#define L2CAP_INFO_REQ 0x0a -#define L2CAP_INFO_RSP 0x0b +#define L2CAP_COMMAND_REJ 0x01 +#define L2CAP_CONN_REQ 0x02 +#define L2CAP_CONN_RSP 0x03 +#define L2CAP_CONF_REQ 0x04 +#define L2CAP_CONF_RSP 0x05 +#define L2CAP_DISCONN_REQ 0x06 +#define L2CAP_DISCONN_RSP 0x07 +#define L2CAP_ECHO_REQ 0x08 +#define L2CAP_ECHO_RSP 0x09 +#define L2CAP_INFO_REQ 0x0a +#define L2CAP_INFO_RSP 0x0b /* L2CAP structures */ typedef struct { - uint16_t len; - uint16_t cid; -} __attribute__ ((packed)) l2cap_hdr; -#define L2CAP_HDR_SIZE 4 + uint16_t len; + uint16_t cid; +} __attribute__ ((packed)) l2cap_hdr; +#define L2CAP_HDR_SIZE 4 typedef struct { - uint8_t code; - uint8_t ident; - uint16_t len; -} __attribute__ ((packed)) l2cap_cmd_hdr; -#define L2CAP_CMD_HDR_SIZE 4 + uint8_t code; + uint8_t ident; + uint16_t len; +} __attribute__ ((packed)) l2cap_cmd_hdr; +#define L2CAP_CMD_HDR_SIZE 4 typedef struct { - uint16_t reason; -} __attribute__ ((packed)) l2cap_cmd_rej; -#define L2CAP_CMD_REJ_SIZE 2 + uint16_t reason; +} __attribute__ ((packed)) l2cap_cmd_rej; +#define L2CAP_CMD_REJ_SIZE 2 typedef struct { - uint16_t psm; - uint16_t scid; -} __attribute__ ((packed)) l2cap_conn_req; -#define L2CAP_CONN_REQ_SIZE 4 + uint16_t psm; + uint16_t scid; +} __attribute__ ((packed)) l2cap_conn_req; +#define L2CAP_CONN_REQ_SIZE 4 typedef struct { - uint16_t dcid; - uint16_t scid; - uint16_t result; - uint16_t status; -} __attribute__ ((packed)) l2cap_conn_rsp; -#define L2CAP_CONN_RSP_SIZE 8 + uint16_t dcid; + uint16_t scid; + uint16_t result; + uint16_t status; +} __attribute__ ((packed)) l2cap_conn_rsp; +#define L2CAP_CONN_RSP_SIZE 8 /* connect result */ -#define L2CAP_CR_SUCCESS 0x0000 -#define L2CAP_CR_PEND 0x0001 -#define L2CAP_CR_BAD_PSM 0x0002 -#define L2CAP_CR_SEC_BLOCK 0x0003 -#define L2CAP_CR_NO_MEM 0x0004 +#define L2CAP_CR_SUCCESS 0x0000 +#define L2CAP_CR_PEND 0x0001 +#define L2CAP_CR_BAD_PSM 0x0002 +#define L2CAP_CR_SEC_BLOCK 0x0003 +#define L2CAP_CR_NO_MEM 0x0004 /* connect status */ -#define L2CAP_CS_NO_INFO 0x0000 -#define L2CAP_CS_AUTHEN_PEND 0x0001 -#define L2CAP_CS_AUTHOR_PEND 0x0002 +#define L2CAP_CS_NO_INFO 0x0000 +#define L2CAP_CS_AUTHEN_PEND 0x0001 +#define L2CAP_CS_AUTHOR_PEND 0x0002 typedef struct { - uint16_t dcid; - uint16_t flags; - uint8_t data[0]; -} __attribute__ ((packed)) l2cap_conf_req; -#define L2CAP_CONF_REQ_SIZE 4 + uint16_t dcid; + uint16_t flags; + uint8_t data[0]; +} __attribute__ ((packed)) l2cap_conf_req; +#define L2CAP_CONF_REQ_SIZE 4 typedef struct { - uint16_t scid; - uint16_t flags; - uint16_t result; - uint8_t data[0]; -} __attribute__ ((packed)) l2cap_conf_rsp; -#define L2CAP_CONF_RSP_SIZE 6 + uint16_t scid; + uint16_t flags; + uint16_t result; + uint8_t data[0]; +} __attribute__ ((packed)) l2cap_conf_rsp; +#define L2CAP_CONF_RSP_SIZE 6 #define L2CAP_CONF_SUCCESS 0x00 #define L2CAP_CONF_UNACCEPT 0x01 typedef struct { - uint8_t type; - uint8_t len; - uint8_t val[0]; -} __attribute__ ((packed)) l2cap_conf_opt; -#define L2CAP_CONF_OPT_SIZE 2 + uint8_t type; + uint8_t len; + uint8_t val[0]; +} __attribute__ ((packed)) l2cap_conf_opt; +#define L2CAP_CONF_OPT_SIZE 2 #define L2CAP_CONF_MTU 0x01 #define L2CAP_CONF_FLUSH_TO 0x02 @@ -170,29 +172,29 @@ typedef struct { #define L2CAP_CONF_MAX_SIZE 22 typedef struct { - uint16_t dcid; - uint16_t scid; -} __attribute__ ((packed)) l2cap_disconn_req; -#define L2CAP_DISCONN_REQ_SIZE 4 + uint16_t dcid; + uint16_t scid; +} __attribute__ ((packed)) l2cap_disconn_req; +#define L2CAP_DISCONN_REQ_SIZE 4 typedef struct { - uint16_t dcid; - uint16_t scid; -} __attribute__ ((packed)) l2cap_disconn_rsp; -#define L2CAP_DISCONN_RSP_SIZE 4 + uint16_t dcid; + uint16_t scid; +} __attribute__ ((packed)) l2cap_disconn_rsp; +#define L2CAP_DISCONN_RSP_SIZE 4 typedef struct { - uint16_t type; - uint8_t data[0]; -} __attribute__ ((packed)) l2cap_info_req; -#define L2CAP_INFO_REQ_SIZE 2 + uint16_t type; + uint8_t data[0]; +} __attribute__ ((packed)) l2cap_info_req; +#define L2CAP_INFO_REQ_SIZE 2 typedef struct { - uint16_t type; - uint16_t result; - uint8_t data[0]; -} __attribute__ ((packed)) l2cap_info_rsp; -#define L2CAP_INFO_RSP_SIZE 4 + uint16_t type; + uint16_t result; + uint8_t data[0]; +} __attribute__ ((packed)) l2cap_info_rsp; +#define L2CAP_INFO_RSP_SIZE 4 #ifdef __cplusplus } diff --git a/include/rfcomm.h b/include/rfcomm.h index f04ace71..bb79a7a2 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -1,27 +1,29 @@ -/* - RFCOMM protocol definition for Linux Bluetooth stack (BlueZ). - Copyright (C) 2002-2003 Maxim Krasnyansky - Copyright (C) 2002-2003 Marcel Holtmann - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - SOFTWARE IS DISCLAIMED. -*/ - /* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * * $Id$ */ @@ -33,22 +35,22 @@ extern "C" { #endif /* RFCOMM defaults */ -#define RFCOMM_DEFAULT_MTU 127 +#define RFCOMM_DEFAULT_MTU 127 #define RFCOMM_PSM 3 -#define RFCOMM_CONN_TIMEOUT (HZ * 30) -#define RFCOMM_DISC_TIMEOUT (HZ * 20) +#define RFCOMM_CONN_TIMEOUT (HZ * 30) +#define RFCOMM_DISC_TIMEOUT (HZ * 20) /* RFCOMM socket address */ struct sockaddr_rc { - sa_family_t rc_family; - bdaddr_t rc_bdaddr; - uint8_t rc_channel; + sa_family_t rc_family; + bdaddr_t rc_bdaddr; + uint8_t rc_channel; }; /* RFCOMM TTY support */ -#define RFCOMM_MAX_DEV 256 +#define RFCOMM_MAX_DEV 256 #define RFCOMMCREATEDEV _IOW('R', 200, int) #define RFCOMMRELEASEDEV _IOW('R', 201, int) @@ -56,29 +58,29 @@ struct sockaddr_rc { #define RFCOMMGETDEVINFO _IOR('R', 211, int) struct rfcomm_dev_req { - int16_t dev_id; - uint32_t flags; - bdaddr_t src; - bdaddr_t dst; - uint8_t channel; + int16_t dev_id; + uint32_t flags; + bdaddr_t src; + bdaddr_t dst; + uint8_t channel; }; -#define RFCOMM_REUSE_DLC 0 -#define RFCOMM_RELEASE_ONHUP 1 -#define RFCOMM_HANGUP_NOW 2 -#define RFCOMM_TTY_ATTACHED 3 +#define RFCOMM_REUSE_DLC 0 +#define RFCOMM_RELEASE_ONHUP 1 +#define RFCOMM_HANGUP_NOW 2 +#define RFCOMM_TTY_ATTACHED 3 struct rfcomm_dev_info { - int16_t id; - uint32_t flags; - uint16_t state; - bdaddr_t src; - bdaddr_t dst; - uint8_t channel; + int16_t id; + uint32_t flags; + uint16_t state; + bdaddr_t src; + bdaddr_t dst; + uint8_t channel; }; struct rfcomm_dev_list_req { - uint16_t dev_num; - struct rfcomm_dev_info dev_info[0]; + uint16_t dev_num; + struct rfcomm_dev_info dev_info[0]; }; #ifdef __cplusplus diff --git a/include/sco.h b/include/sco.h index d8bc54b6..0d0ac123 100644 --- a/include/sco.h +++ b/include/sco.h @@ -1,28 +1,29 @@ -/* - BlueZ - Bluetooth protocol stack for Linux - Copyright (C) 2000-2001 Qualcomm Incorporated - - Written 2000,2001 by Maxim Krasnyansky - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - SOFTWARE IS DISCLAIMED. -*/ - /* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * * $Id$ */ @@ -38,7 +39,7 @@ extern "C" { #define SCO_DEFAULT_FLUSH_TO 0xFFFF #define SCO_CONN_TIMEOUT (HZ * 40) -#define SCO_DISCONN_TIMEOUT (HZ * 2) +#define SCO_DISCONN_TIMEOUT (HZ * 2) #define SCO_CONN_IDLE_TIMEOUT (HZ * 60) /* SCO socket address */ diff --git a/include/sdp.h b/include/sdp.h index 77564850..13205b9b 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -1,34 +1,40 @@ /* - Service Discovery Protocol (SDP) - Copyright (C) 2002 Maxim Krasnyansky - - Based on original SDP implementation by Nokia Corporation. - Copyright (C) 2001,2002 Nokia Corporation. - Original author Guruprasad Krishnamurthy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY CLAIM, - OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER - RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE - USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, COPYRIGHTS, - TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS SOFTWARE IS DISCLAIMED. -*/ - -/* - * $Id$ + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2001-2002 Nokia Corporation + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2003 Stephen Crane + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id$ */ -#ifndef SDP_H -#define SDP_H +#ifndef __SDP_H +#define __SDP_H + +#ifdef __cplusplus +extern "C" { +#endif #include @@ -393,4 +399,8 @@ typedef struct { uint16_t tid; // Current transaction ID } sdp_session_t; +#ifdef __cplusplus +} #endif + +#endif /* __SDP_H */ diff --git a/include/sdp_internal.h b/include/sdp_internal.h index fabf7a0d..defc300a 100644 --- a/include/sdp_internal.h +++ b/include/sdp_internal.h @@ -1,34 +1,40 @@ /* - Service Discovery Protocol (SDP) - Copyright (C) 2002 Maxim Krasnyansky , Stephen Crane - - Based on original SDP implementation by Nokia Corporation. - Copyright (C) 2001,2002 Nokia Corporation. - Original author Guruprasad Krishnamurthy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY CLAIM, - OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER - RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE - USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, COPYRIGHTS, - TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS SOFTWARE IS DISCLAIMED. -*/ - -/* - * $Id$ + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2001-2002 Nokia Corporation + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2003 Stephen Crane + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id$ */ -#ifndef SDP_INTERNAL_H -#define SDP_INTERNAL_H +#ifndef __SDP_INTERNAL_H +#define __SDP_INTERNAL_H + +#ifdef __cplusplus +extern "C" { +#endif #include #include @@ -142,16 +148,16 @@ static inline unsigned long long __sdp_get_unaligned(const void *ptr, size_t siz { unsigned long long val = 0; switch (size) { - case 1: + case 1: val = *(const unsigned char *)ptr; break; - case 2: + case 2: val = __uldw((const unsigned short *)ptr); break; - case 4: + case 4: val = __uldl((const unsigned int *)ptr); break; - case 8: + case 8: val = __uldq((const unsigned long *)ptr); break; } @@ -163,7 +169,7 @@ static inline void __sdp_put_unaligned(unsigned long val, void *ptr, size_t size switch (size) { case 1: *(unsigned char *)ptr = (val); - break; + break; case 2: __ustw(val, (unsigned short *)ptr); break; @@ -177,10 +183,10 @@ static inline void __sdp_put_unaligned(unsigned long val, void *ptr, size_t size } #define sdp_get_unaligned(ptr) \ - ((__typeof__(*(ptr)))__sdp_get_unaligned((ptr), sizeof(*(ptr)))) + ((__typeof__(*(ptr)))__sdp_get_unaligned((ptr), sizeof(*(ptr)))) #define sdp_put_unaligned(x,ptr) \ - __sdp_put_unaligned((unsigned long)(x), (ptr), sizeof(*(ptr))) + __sdp_put_unaligned((unsigned long)(x), (ptr), sizeof(*(ptr))) #endif @@ -189,7 +195,7 @@ static inline void __sdp_put_unaligned(unsigned long val, void *ptr, size_t size static inline void ntoh128(uint128_t *src, uint128_t *dst) { int i; - for (i=0; i < 16; i++) + for (i = 0; i < 16; i++) dst->data[i] = src->data[i]; } #else @@ -205,7 +211,7 @@ static inline uint64_t ntoh64(uint64_t n) static inline void ntoh128(uint128_t *src, uint128_t *dst) { int i; - for (i=0; i < 16; i++) + for (i = 0; i < 16; i++) dst->data[15 - i] = src->data[i]; } #endif @@ -213,4 +219,8 @@ static inline void ntoh128(uint128_t *src, uint128_t *dst) #define hton64(x) ntoh64(x) #define hton128(x,y) ntoh128(x,y) +#ifdef __cplusplus +} #endif + +#endif /* __SDP_INTERNAL_H */ diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 763f80fa..d2753912 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -1,34 +1,36 @@ /* - Service Discovery Protocol (SDP) - Copyright (C) 2002 Maxim Krasnyansky , Stephen Crane - - Based on original SDP implementation by Nokia Corporation. - Copyright (C) 2001,2002 Nokia Corporation. - Original author Guruprasad Krishnamurthy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY CLAIM, - OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER - RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE - USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, COPYRIGHTS, - TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS SOFTWARE IS DISCLAIMED. - */ - -/* - * $Id$ - */ - -#ifndef SDP_LIB_H -#define SDP_LIB_H + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2001-2002 Nokia Corporation + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2003 Stephen Crane + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id$ + */ + +#ifndef __SDP_LIB_H +#define __SDP_LIB_H #include #include @@ -494,36 +496,36 @@ int sdp_get_database_state(const sdp_record_t *rec, uint32_t *svcDBState); static inline int sdp_get_service_name(const sdp_record_t *rec, char *str, int len) { - return sdp_get_string_attr(rec, SDP_ATTR_SVCNAME_PRIMARY, str, len); + return sdp_get_string_attr(rec, SDP_ATTR_SVCNAME_PRIMARY, str, len); } static inline int sdp_get_service_desc(const sdp_record_t *rec, char *str, int len) { - return sdp_get_string_attr(rec, SDP_ATTR_SVCDESC_PRIMARY, str, len); + return sdp_get_string_attr(rec, SDP_ATTR_SVCDESC_PRIMARY, str, len); } static inline int sdp_get_provider_name(const sdp_record_t *rec, char *str, int len) { - return sdp_get_string_attr(rec, SDP_ATTR_PROVNAME_PRIMARY, str, len); + return sdp_get_string_attr(rec, SDP_ATTR_PROVNAME_PRIMARY, str, len); } static inline int sdp_get_doc_url(const sdp_record_t *rec, char *str, int len) { - return sdp_get_string_attr(rec, SDP_ATTR_DOC_URL, str, len); + return sdp_get_string_attr(rec, SDP_ATTR_DOC_URL, str, len); } static inline int sdp_get_clnt_exec_url(const sdp_record_t *rec, char *str, int len) { - return sdp_get_string_attr(rec, SDP_ATTR_CLNT_EXEC_URL, str, len); + return sdp_get_string_attr(rec, SDP_ATTR_CLNT_EXEC_URL, str, len); } static inline int sdp_get_icon_url(const sdp_record_t *rec, char *str, int len) { - return sdp_get_string_attr(rec, SDP_ATTR_ICON_URL, str, len); + return sdp_get_string_attr(rec, SDP_ATTR_ICON_URL, str, len); } #ifdef __cplusplus } #endif -#endif +#endif /* __SDP_LIB_H */ -- cgit From db3ac6f0370159237530248efa79557c2cd98499 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 3 Apr 2004 05:57:41 +0000 Subject: Don't install sdp_internal.h --- include/Makefile.am | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/Makefile.am b/include/Makefile.am index ec8835a2..bdb5e939 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -4,7 +4,9 @@ includedir = @includedir@/bluetooth -include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h rfcomm.h sdp.h sdp_lib.h sdp_internal.h bnep.h cmtp.h +include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h rfcomm.h sdp.h sdp_lib.h bnep.h cmtp.h + +noinst_HEADERS = sdp_internal.h all-local: -- cgit From ee63ac598e56142ba513729d6b69df04d233d186 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 3 Apr 2004 08:25:58 +0000 Subject: Add support for unaligned access --- include/bluetooth.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index 8690f456..3dc4b245 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -86,6 +86,19 @@ enum { #error "Unknown byte order" #endif +/* Bluetooth unaligned access */ +#if defined(__i386__) +#define bt_get_unaligned(ptr) (*(ptr)) +#define bt_put_unaligned(val, ptr) ((void)( *(ptr) = (val) )) +#else +#define bt_get_unaligned(ptr) \ + ({ __typeof__(*(ptr)) __tmp; memcpy(&__tmp, (ptr), sizeof(*(ptr))); __tmp; }) +#define bt_put_unaligned(val, ptr) \ + ({ __typeof__(*(ptr)) __tmp = (val); \ + memcpy((ptr), &__tmp, sizeof(*(ptr))); \ + (void)0; }) +#endif + /* BD Address */ typedef struct { uint8_t b[6]; -- cgit From 4f6e2df58332458dd32f62fe452a99114c7d85d0 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 3 Apr 2004 09:21:06 +0000 Subject: Move some internal functions to public --- include/sdp_internal.h | 38 -------------------------------------- include/sdp_lib.h | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 38 deletions(-) (limited to 'include') diff --git a/include/sdp_internal.h b/include/sdp_internal.h index defc300a..5d6ed7f9 100644 --- a/include/sdp_internal.h +++ b/include/sdp_internal.h @@ -55,44 +55,6 @@ extern "C" { #define SDP_UUID_SEQ_SIZE 256 #define SDP_MAX_ATTR_LEN 65535 -/* - * Generate unique transaction identifiers - */ -static inline uint16_t sdp_gen_tid(sdp_session_t *session) -{ - return session->tid++; -} - -sdp_record_t *sdp_extract_pdu(const char *pdata, int *scanned); -sdp_data_t *sdp_extract_string(char *, int *); - -void sdp_data_print(sdp_data_t *data); -void sdp_print_service_attr(sdp_list_t *alist); - -int sdp_attrid_comp_func(const void *key1, const void *key2); - -void sdp_set_seq_len(char *ptr, int length); -void sdp_set_attrid(sdp_buf_t *pdu, uint16_t id); -void sdp_append_to_pdu(sdp_buf_t *dst, sdp_data_t *d); -void sdp_append_to_buf(sdp_buf_t *dst, char *data, int len); - -int sdp_gen_pdu(sdp_buf_t *pdu, sdp_data_t *data); -int sdp_gen_record_pdu(const sdp_record_t *rec, sdp_buf_t *pdu); - -int sdp_extract_seqtype(const char *buf, uint8_t *dtdp, int *seqlen); - -sdp_data_t *sdp_extract_attr(const char *pdata, int *extractedLength, sdp_record_t *rec); - -void sdp_pattern_add_uuid(sdp_record_t *rec, uuid_t *uuid); -void sdp_pattern_add_uuidseq(sdp_record_t *rec, sdp_list_t *seq); - -int sdp_send_req_w4_rsp(sdp_session_t *session, char *req, char *rsp, int reqsize, int *rspsize); - -typedef struct { - uint8_t length; - unsigned char data[16]; -} __attribute__ ((packed)) sdp_cstate_t; - /* * SDP unaligned access. * based on linux/asm-/unaligned.h diff --git a/include/sdp_lib.h b/include/sdp_lib.h index d2753912..715f98cf 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -524,6 +524,44 @@ static inline int sdp_get_icon_url(const sdp_record_t *rec, char *str, int len) return sdp_get_string_attr(rec, SDP_ATTR_ICON_URL, str, len); } +/* + * Generate unique transaction identifiers + */ +static inline uint16_t sdp_gen_tid(sdp_session_t *session) +{ + return session->tid++; +} + +sdp_record_t *sdp_extract_pdu(const char *pdata, int *scanned); +sdp_data_t *sdp_extract_string(char *, int *); + +void sdp_data_print(sdp_data_t *data); +void sdp_print_service_attr(sdp_list_t *alist); + +int sdp_attrid_comp_func(const void *key1, const void *key2); + +void sdp_set_seq_len(char *ptr, int length); +void sdp_set_attrid(sdp_buf_t *pdu, uint16_t id); +void sdp_append_to_pdu(sdp_buf_t *dst, sdp_data_t *d); +void sdp_append_to_buf(sdp_buf_t *dst, char *data, int len); + +int sdp_gen_pdu(sdp_buf_t *pdu, sdp_data_t *data); +int sdp_gen_record_pdu(const sdp_record_t *rec, sdp_buf_t *pdu); + +int sdp_extract_seqtype(const char *buf, uint8_t *dtdp, int *seqlen); + +sdp_data_t *sdp_extract_attr(const char *pdata, int *extractedLength, sdp_record_t *rec); + +void sdp_pattern_add_uuid(sdp_record_t *rec, uuid_t *uuid); +void sdp_pattern_add_uuidseq(sdp_record_t *rec, sdp_list_t *seq); + +int sdp_send_req_w4_rsp(sdp_session_t *session, char *req, char *rsp, int reqsize, int *rspsize); + +typedef struct { + uint8_t length; + unsigned char data[16]; +} __attribute__ ((packed)) sdp_cstate_t; + #ifdef __cplusplus } #endif -- cgit From 6caf64335ab07e1bd138e11a1823ba9baa209fef Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 24 Apr 2004 12:09:53 +0000 Subject: Add features and packet types from EDR prototyping specification --- include/hci.h | 33 +++++++++++++++++++++++++++------ include/hci_lib.h | 2 ++ 2 files changed, 29 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index fc57bbca..ce5080ef 100644 --- a/include/hci.h +++ b/include/hci.h @@ -112,17 +112,31 @@ enum { #define HCI_UNKNOWN_PKT 0xff /* HCI Packet types */ -#define HCI_DM1 0x0008 -#define HCI_DM3 0x0400 -#define HCI_DM5 0x4000 -#define HCI_DH1 0x0010 -#define HCI_DH3 0x0800 -#define HCI_DH5 0x8000 +#define HCI_2DH1 0x0002 +#define HCI_3DH1 0x0004 +#define HCI_DM1 0x0008 +#define HCI_DH1 0x0010 +#define HCI_2DH3 0x0100 +#define HCI_3DH3 0x0200 +#define HCI_DM3 0x0400 +#define HCI_DH3 0x0800 +#define HCI_2DH5 0x1000 +#define HCI_3DH5 0x2000 +#define HCI_DM5 0x4000 +#define HCI_DH5 0x8000 #define HCI_HV1 0x0020 #define HCI_HV2 0x0040 #define HCI_HV3 0x0080 +#define HCI_EV3 0x0008 +#define HCI_EV4 0x0010 +#define HCI_EV5 0x0020 +#define HCI_2EV3 0x0040 +#define HCI_3EV3 0x0080 +#define HCI_2EV5 0x0100 +#define HCI_3EV5 0x0200 + #define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3) #define ACL_PTYPE_MASK (~SCO_PTYPE_MASK) @@ -204,6 +218,8 @@ enum { #define LMP_TRSP_SCO 0x08 #define LMP_BCAST_ENC 0x80 +#define LMP_EDR_ACL_2M 0x02 +#define LMP_EDR_ACL_3M 0x04 #define LMP_ENH_ISCAN 0x08 #define LMP_ILACE_ISCAN 0x10 #define LMP_ILACE_PSCAN 0x20 @@ -214,9 +230,14 @@ enum { #define LMP_EV5 0x02 #define LMP_AFH_CAP_SLV 0x08 #define LMP_AFH_CLS_SLV 0x10 +#define LMP_EDR_3SLOT 0x80 +#define LMP_EDR_5SLOT 0x01 #define LMP_AFH_CAP_MST 0x08 #define LMP_AFH_CLS_MST 0x10 +#define LMP_EDR_ESCO_2M 0x20 +#define LMP_EDR_ESCO_3M 0x40 +#define LMP_EDR_3S_ESCO 0x80 #define LMP_EXT_FEAT 0x80 diff --git a/include/hci_lib.h b/include/hci_lib.h index e048375e..70d39264 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -96,6 +96,8 @@ char *hci_dtypetostr(int type); char *hci_dflagstostr(uint32_t flags); char *hci_ptypetostr(unsigned int ptype); int hci_strtoptype(char *str, unsigned int *val); +char *hci_scoptypetostr(unsigned int ptype); +int hci_strtoscoptype(char *str, unsigned int *val); char *hci_lptostr(unsigned int ptype); int hci_strtolp(char *str, unsigned int *val); char *hci_lmtostr(unsigned int ptype); -- cgit From 4b647efc5c26a0aedfd43fcc7914d31d5bf3799d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 25 Apr 2004 15:07:23 +0000 Subject: Add support for inquiry_mode and inquiry_info_with_rssi --- include/hci.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index ce5080ef..1b46cec7 100644 --- a/include/hci.h +++ b/include/hci.h @@ -674,6 +674,23 @@ typedef struct { } __attribute__ ((packed)) write_current_iac_lap_cp; #define WRITE_CURRENT_IAC_LAP_CP_SIZE 1+3*MAX_IAC_LAP +#define OCF_READ_INQUIRY_MODE 0x0044 +typedef struct { + uint8_t status; + uint8_t mode; +} __attribute__ ((packed)) read_inquiry_mode_rp; +#define READ_INQUIRY_MODE_RP_SIZE 2 + +#define OCF_WRITE_INQUIRY_MODE 0x0045 +typedef struct { + uint8_t mode; +} __attribute__ ((packed)) write_inquiry_mode_cp; +#define WRITE_INQUIRY_MODE_CP_SIZE 1 +typedef struct { + uint8_t status; +} __attribute__ ((packed)) write_inquiry_mode_rp; +#define WRITE_INQUIRY_MODE_RP_SIZE 1 + /* Informational Parameters */ #define OGF_INFO_PARAM 0x04 @@ -921,6 +938,17 @@ typedef struct { } __attribute__ ((packed)) evt_qos_violation; #define EVT_QOS_VIOLATION_SIZE 2 +#define EVT_INQUIRY_RESULT_WITH_RSSI 0x02 +typedef struct { + bdaddr_t bdaddr; + uint8_t pscan_rep_mode; + uint8_t pscan_period_mode; + uint8_t dev_class[3]; + uint16_t clock_offset; + uint8_t rssi; +} __attribute__ ((packed)) inquiry_info_with_rssi; +#define INQUIRY_INFO_WITH_RSSI_SIZE 14 + #define EVT_TESTING 0xFE #define EVT_VENDOR 0xFF -- cgit From cf128e135d9f8e6f5e2c1b24539a5ca1950cec7f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 25 Apr 2004 15:31:49 +0000 Subject: Add extra comment --- include/cmtp.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/cmtp.h b/include/cmtp.h index 0883556f..f0981f2d 100644 --- a/include/cmtp.h +++ b/include/cmtp.h @@ -33,6 +33,7 @@ extern "C" { #endif +/* CMTP defaults */ #define CMTP_MINIMUM_MTU 152 #define CMTP_DEFAULT_MTU 672 -- cgit From 8b9071e009bb469a12095ae83178567d30e9177b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 25 Apr 2004 15:34:37 +0000 Subject: Add HIDP header file --- include/Makefile.am | 4 ++- include/hidp.h | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 include/hidp.h (limited to 'include') diff --git a/include/Makefile.am b/include/Makefile.am index bdb5e939..cbde42bf 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -4,7 +4,9 @@ includedir = @includedir@/bluetooth -include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h rfcomm.h sdp.h sdp_lib.h bnep.h cmtp.h +include_HEADERS = \ + bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h \ + l2cap.h sco.h rfcomm.h sdp.h sdp_lib.h bnep.h cmtp.h hidp.h noinst_HEADERS = sdp_internal.h diff --git a/include/hidp.h b/include/hidp.h new file mode 100644 index 00000000..f374b9e8 --- /dev/null +++ b/include/hidp.h @@ -0,0 +1,84 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2003-2004 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id$ + */ + +#ifndef __HIDP_H +#define __HIDP_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* HIDP defaults */ +#define HIDP_MINIMUM_MTU 48 +#define HIDP_DEFAULT_MTU 48 + +/* HIDP ioctl defines */ +#define HIDPCONNADD _IOW('H', 200, int) +#define HIDPCONNDEL _IOW('H', 201, int) +#define HIDPGETCONNLIST _IOR('H', 210, int) +#define HIDPGETCONNINFO _IOR('H', 211, int) + +#define HIDP_VIRTUAL_CABLE_UNPLUG 0 +#define HIDP_BLUETOOTH_VENDOR_ID 1 + +struct hidp_connadd_req { + int ctrl_sock; /* Connected control socket */ + int intr_sock; /* Connected interrupt socket */ + uint16_t parser; /* Parser version */ + uint16_t rd_size; /* Report descriptor size */ + uint8_t *rd_data; /* Report descriptor data */ + uint8_t country; + uint16_t vendor; + uint16_t product; + uint16_t version; + uint32_t flags; + uint32_t idle_to; + char name[128]; /* Device name */ +}; + +struct hidp_conndel_req { + bdaddr_t bdaddr; + uint32_t flags; +}; + +struct hidp_conninfo { + bdaddr_t bdaddr; + uint32_t flags; + uint16_t state; +}; + +struct hidp_connlist_req { + uint16_t cnum; + struct hidp_conninfo *ci; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* __HIDP_H */ -- cgit From d1577755011c1ea10d9752b6e984f36eea349171 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 25 Apr 2004 19:06:24 +0000 Subject: Add AFH related types --- include/hci.h | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 1b46cec7..5ab61c77 100644 --- a/include/hci.h +++ b/include/hci.h @@ -691,6 +691,23 @@ typedef struct { } __attribute__ ((packed)) write_inquiry_mode_rp; #define WRITE_INQUIRY_MODE_RP_SIZE 1 +#define OCF_READ_AFH_MODE 0x0048 +typedef struct { + uint8_t status; + uint8_t mode; +} __attribute__ ((packed)) read_afh_mode_rp; +#define READ_AFH_MODE_RP_SIZE 2 + +#define OCF_WRITE_AFH_MODE 0x0049 +typedef struct { + uint8_t mode; +} __attribute__ ((packed)) write_afh_mode_cp; +#define WRITE_AFH_MODE_CP_SIZE 1 +typedef struct { + uint8_t status; +} __attribute__ ((packed)) write_afh_mode_rp; +#define WRITE_AFH_MODE_RP_SIZE 1 + /* Informational Parameters */ #define OGF_INFO_PARAM 0x04 @@ -734,14 +751,14 @@ typedef struct { uint8_t status; uint16_t handle; uint8_t counter; -} __attribute__ ((packed)) read_failed_contact_counter_rp; +} __attribute__ ((packed)) read_failed_contact_counter_rp; #define READ_FAILED_CONTACT_COUNTER_RP_SIZE 4 #define OCF_RESET_FAILED_CONTACT_COUNTER 0x0002 typedef struct { uint8_t status; uint16_t handle; -} __attribute__ ((packed)) reset_failed_contact_counter_rp; +} __attribute__ ((packed)) reset_failed_contact_counter_rp; #define RESET_FAILED_CONTACT_COUNTER_RP_SIZE 4 #define OCF_GET_LINK_QUALITY 0x0003 @@ -749,7 +766,7 @@ typedef struct { uint8_t status; uint16_t handle; uint8_t link_quality; -} __attribute__ ((packed)) get_link_quality_rp; +} __attribute__ ((packed)) get_link_quality_rp; #define GET_LINK_QUALITY_RP_SIZE 4 #define OCF_READ_RSSI 0x0005 @@ -757,9 +774,18 @@ typedef struct { uint8_t status; uint16_t handle; int8_t rssi; -} __attribute__ ((packed)) read_rssi_rp; +} __attribute__ ((packed)) read_rssi_rp; #define READ_RSSI_RP_SIZE 4 +#define OCF_READ_AFH_MAP 0x0006 +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t mode; + uint8_t map[10]; +} __attribute__ ((packed)) read_afh_map_rp; +#define READ_AFH_MAP_RP_SIZE 14 + /* Testing commands */ #define OGF_TESTING_CMD 0x3e -- cgit From edb4586c5bd45aaa69c0910150f0012ca3251c7e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 2 May 2004 21:33:54 +0000 Subject: Add attribute id for additional protocol list --- include/sdp.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/sdp.h b/include/sdp.h index 13205b9b..e62ab876 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -150,6 +150,7 @@ extern "C" { #define SDP_ATTR_DOC_URL 0x000A #define SDP_ATTR_CLNT_EXEC_URL 0x000B #define SDP_ATTR_ICON_URL 0x000C +#define SDP_ATTR_ADD_PROTO_DESC_LIST 0x000D #define SDP_ATTR_IP_SUBNET 0x0200 #define SDP_ATTR_SERVICE_VERSION 0x0300 -- cgit From 233bd39dee08afc5176b203e6348184da56d7bff Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 2 May 2004 21:40:30 +0000 Subject: Add sdp_get_add_access_protos() function --- include/sdp_lib.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 715f98cf..0fa7cb7a 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -453,6 +453,11 @@ int sdp_profile_uuid2strn(const uuid_t *uuid, char *str, size_t n); */ int sdp_get_access_protos(const sdp_record_t *rec, sdp_list_t **protos); +/* + * Get the additional access protocols from the service record + */ +int sdp_get_add_access_protos(const sdp_record_t *rec, sdp_list_t **pap); + /* * Extract the list of browse groups to which the service belongs. * When set, seqp contains elements of GroupID (uint16_t) -- cgit From 2d0eb2ad3222761c5c410fc9340ff23ce58680ac Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 2 May 2004 21:50:20 +0000 Subject: Add HCRP related profile and service class id's --- include/sdp.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/sdp.h b/include/sdp.h index e62ab876..e28c4702 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -96,6 +96,9 @@ extern "C" { #define HANDSFREE_SVCLASS_ID 0x111e #define HANDSFREE_AUDIO_GW_SVCLASS_ID 0x111f #define HID_SVCLASS_ID 0x1124 +#define HCR_SVCLASS_ID 0x1125 +#define HCR_PRINT_SVCLASS_ID 0x1126 +#define HCR_SCAN_SVCLASS_ID 0x1127 #define CIP_SVCLASS_ID 0x1128 #define PNP_INFO_SVCLASS_ID 0x1200 #define GENERIC_NETWORKING_SVCLASS_ID 0x1201 @@ -126,6 +129,7 @@ extern "C" { #define IMAGING_RESPONDER_PROFILE_ID 0x111b #define HANDSFREE_PROFILE_ID 0x111e #define HID_PROFILE_ID 0x1124 +#define HCR_PROFILE_ID 0x1125 #define CIP_PROFILE_ID 0x1128 /* -- cgit From 6537173ad53f64d51bfa11788a3588c5fde27afc Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 2 May 2004 21:55:01 +0000 Subject: Add HCRP UUID defines --- include/sdp.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/sdp.h b/include/sdp.h index e28c4702..7a654fc4 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -68,6 +68,9 @@ extern "C" { #define WSP_UUID 0x000E #define BNEP_UUID 0x000F #define HIDP_UUID 0x0011 +#define HCRP_CTRL_UUID 0x0012 +#define HCRP_DATA_UUID 0x0014 +#define HCRP_NOTE_UUID 0x0016 #define CMTP_UUID 0x001B /* -- cgit From 55543cd15f83edbc560f45bd23adae86c511d7ac Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 8 May 2004 19:11:30 +0000 Subject: Update connection information --- include/hidp.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/hidp.h b/include/hidp.h index f374b9e8..894ddd1b 100644 --- a/include/hidp.h +++ b/include/hidp.h @@ -70,6 +70,10 @@ struct hidp_conninfo { bdaddr_t bdaddr; uint32_t flags; uint16_t state; + uint16_t vendor; + uint16_t product; + uint16_t version; + char name[128]; }; struct hidp_connlist_req { -- cgit From c7b26f3e5d03e1d54dfb945e5ca0c041da524348 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 8 May 2004 19:52:55 +0000 Subject: Add BDADDR_ALL constant --- include/bluetooth.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index 3dc4b245..412ccf61 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -105,6 +105,7 @@ typedef struct { } __attribute__((packed)) bdaddr_t; #define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}}) +#define BDADDR_ALL (&(bdaddr_t) {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}}) #define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}}) /* Copy, swap, convert BD Address */ -- cgit From 60def948f68b9c02a9bb508e662d172ccab7ab65 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 12 May 2004 13:27:50 +0000 Subject: Fix the event code of inquiry with RSSI --- include/hci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 5ab61c77..f498b16d 100644 --- a/include/hci.h +++ b/include/hci.h @@ -964,7 +964,7 @@ typedef struct { } __attribute__ ((packed)) evt_qos_violation; #define EVT_QOS_VIOLATION_SIZE 2 -#define EVT_INQUIRY_RESULT_WITH_RSSI 0x02 +#define EVT_INQUIRY_RESULT_WITH_RSSI 0x22 typedef struct { bdaddr_t bdaddr; uint8_t pscan_rep_mode; -- cgit From c420aef6fe7d316ee053e69f7e901db39443361b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 9 Jun 2004 13:59:03 +0000 Subject: Add defines for audio/video profiles --- include/sdp.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/sdp.h b/include/sdp.h index 7a654fc4..3ba10f20 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -88,6 +88,8 @@ extern "C" { #define IRMC_SYNC_CMD_SVCLASS_ID 0x1107 #define HEADSET_SVCLASS_ID 0x1108 #define CORDLESS_TELEPHONY_SVCLASS_ID 0x1109 +#define AUDIO_SOURCE_SVCLASS_ID 0x110a +#define AUDIO_SINK_SVCLASS_ID 0x110b #define INTERCOM_SVCLASS_ID 0x1110 #define FAX_SVCLASS_ID 0x1111 #define HEADSET_AGW_SVCLASS_ID 0x1112 @@ -108,6 +110,8 @@ extern "C" { #define GENERIC_FILETRANS_SVCLASS_ID 0x1202 #define GENERIC_AUDIO_SVCLASS_ID 0x1203 #define GENERIC_TELEPHONY_SVCLASS_ID 0x1204 +#define VIDEO_SOURCE_SVCLASS_ID 0x1303 +#define VIDEO_SINK_SVCLASS_ID 0x1304 /* * Standard profile descriptor identifiers; note these @@ -122,6 +126,7 @@ extern "C" { #define IRMC_SYNC_CMD_PROFILE_ID 0x1107 #define HEADSET_PROFILE_ID 0x1108 #define CORDLESS_TELEPHONY_PROFILE_ID 0x1109 +#define ADVANCED_AUDIO_PROFILE_ID 0x110d #define INTERCOM_PROFILE_ID 0x1110 #define FAX_PROFILE_ID 0x1111 #define HEADSET_AGW_PROFILE_ID 0x1112 -- cgit From 4691560c56de8c5cef68bd4acee97e53e193b717 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 9 Jun 2004 16:41:51 +0000 Subject: Add UUID's for AVCTP and AVDTP --- include/sdp.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/sdp.h b/include/sdp.h index 3ba10f20..8acd862e 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -71,6 +71,8 @@ extern "C" { #define HCRP_CTRL_UUID 0x0012 #define HCRP_DATA_UUID 0x0014 #define HCRP_NOTE_UUID 0x0016 +#define AVCTP_UUID 0x0017 +#define AVDTP_UUID 0x0019 #define CMTP_UUID 0x001B /* -- cgit From a4a1f2b6249f30899c8226d15d9006d878cf55b5 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 4 Jul 2004 15:32:57 +0000 Subject: Add subclass field --- include/hidp.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/hidp.h b/include/hidp.h index 894ddd1b..21b62513 100644 --- a/include/hidp.h +++ b/include/hidp.h @@ -44,7 +44,8 @@ extern "C" { #define HIDPGETCONNINFO _IOR('H', 211, int) #define HIDP_VIRTUAL_CABLE_UNPLUG 0 -#define HIDP_BLUETOOTH_VENDOR_ID 1 +#define HIDP_BOOT_PROTOCOL_MODE 1 +#define HIDP_BLUETOOTH_VENDOR_ID 9 struct hidp_connadd_req { int ctrl_sock; /* Connected control socket */ @@ -53,6 +54,7 @@ struct hidp_connadd_req { uint16_t rd_size; /* Report descriptor size */ uint8_t *rd_data; /* Report descriptor data */ uint8_t country; + uint8_t subclass; uint16_t vendor; uint16_t product; uint16_t version; -- cgit From f843c841cfdcb3bfd45ba136847421ad8e18efbe Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 4 Jul 2004 15:38:11 +0000 Subject: Add AVDTP protocol identifier --- include/bluetooth.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index 412ccf61..d6359938 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -52,6 +52,7 @@ extern "C" { #define BTPROTO_BNEP 4 #define BTPROTO_CMTP 5 #define BTPROTO_HIDP 6 +#define BTPROTO_AVDTP 7 #define SOL_HCI 0 #define SOL_L2CAP 6 -- cgit From 4f018af0f15901dcda46f6b93ebf9db7c0d1b993 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 9 Jul 2004 19:43:49 +0000 Subject: Add info type and info result definitions --- include/l2cap.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/l2cap.h b/include/l2cap.h index d06eb800..e2fa860e 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -196,6 +196,14 @@ typedef struct { } __attribute__ ((packed)) l2cap_info_rsp; #define L2CAP_INFO_RSP_SIZE 4 +/* info type */ +#define L2CAP_IT_CL_MTU 0x0001 +#define L2CAP_IT_FEAT_MASK 0x0002 + +/* info result */ +#define L2CAP_IR_SUCCESS 0x0000 +#define L2CAP_IR_NOTSUPP 0x0001 + #ifdef __cplusplus } #endif -- cgit From 0c8f74212a5345507db372c9ba78c63000971f89 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 9 Jul 2004 22:30:56 +0000 Subject: Add value for L2CAP_CONF_RFC_MODE --- include/l2cap.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/l2cap.h b/include/l2cap.h index e2fa860e..b5052dcf 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -168,6 +168,7 @@ typedef struct { #define L2CAP_CONF_MTU 0x01 #define L2CAP_CONF_FLUSH_TO 0x02 #define L2CAP_CONF_QOS 0x03 +#define L2CAP_CONF_RFC_MODE 0x04 #define L2CAP_CONF_MAX_SIZE 22 -- cgit From 0320edae7f734cbc1ad02b6221650ca577b46bc7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 10 Jul 2004 11:28:03 +0000 Subject: The RSSI value is signed and not unsigned --- include/hci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index f498b16d..6cc7e4bd 100644 --- a/include/hci.h +++ b/include/hci.h @@ -971,7 +971,7 @@ typedef struct { uint8_t pscan_period_mode; uint8_t dev_class[3]; uint16_t clock_offset; - uint8_t rssi; + int8_t rssi; } __attribute__ ((packed)) inquiry_info_with_rssi; #define INQUIRY_INFO_WITH_RSSI_SIZE 14 -- cgit From 3429ef600fcef09e96408f8b476ead6cb519cf83 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 21 Jul 2004 13:30:34 +0000 Subject: Make use of MAINTAINERCLEANFILES --- include/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/Makefile.am b/include/Makefile.am index cbde42bf..4ac8aada 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -10,9 +10,10 @@ include_HEADERS = \ noinst_HEADERS = sdp_internal.h +MAINTAINERCLEANFILES = Makefile.in all-local: - @if [ ! -e bluetooth ] ; then ln -s $(top_srcdir)/include bluetooth ; fi + @if [ ! -e bluetooth ] ; then $(LN_S) $(top_srcdir)/include bluetooth ; fi clean-local: @rm -f bluetooth -- cgit From 8b84723cea240cbd9e55ba2acd683fadb3a79282 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 11 Aug 2004 07:07:12 +0000 Subject: Use memmove for unaligned access, so gcc does not insert a __builtin_memcpy --- include/bluetooth.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index d6359938..e286ffb9 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -93,10 +93,10 @@ enum { #define bt_put_unaligned(val, ptr) ((void)( *(ptr) = (val) )) #else #define bt_get_unaligned(ptr) \ - ({ __typeof__(*(ptr)) __tmp; memcpy(&__tmp, (ptr), sizeof(*(ptr))); __tmp; }) + ({ __typeof__(*(ptr)) __tmp; memmove(&__tmp, (ptr), sizeof(*(ptr))); __tmp; }) #define bt_put_unaligned(val, ptr) \ ({ __typeof__(*(ptr)) __tmp = (val); \ - memcpy((ptr), &__tmp, sizeof(*(ptr))); \ + memmove((ptr), &__tmp, sizeof(*(ptr))); \ (void)0; }) #endif -- cgit From 02f41dc112d035da030b2c14f02baaae2f7c3c18 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 12 Aug 2004 21:22:37 +0000 Subject: Add architectures that can do unaligned access by themself --- include/bluetooth.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index e286ffb9..9304ddd6 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -88,7 +88,7 @@ enum { #endif /* Bluetooth unaligned access */ -#if defined(__i386__) +#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__s390__) #define bt_get_unaligned(ptr) (*(ptr)) #define bt_put_unaligned(val, ptr) ((void)( *(ptr) = (val) )) #else -- cgit From ea6bf1beea4d3fcc98e2e940e940735a5a0b3c5e Mon Sep 17 00:00:00 2001 From: Peter Kjellerstedt Date: Thu, 12 Aug 2004 21:59:42 +0000 Subject: The CRIS architecture handles unaligned accesses too. --- include/bluetooth.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index 9304ddd6..80a2d169 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -88,7 +88,7 @@ enum { #endif /* Bluetooth unaligned access */ -#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__s390__) +#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__s390__) || defined(__cris__) #define bt_get_unaligned(ptr) (*(ptr)) #define bt_put_unaligned(val, ptr) ((void)( *(ptr) = (val) )) #else -- cgit From a867781820a4b7a85031c54fe38399c33affdb9c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 6 Oct 2004 17:39:53 +0000 Subject: Add support for the kernel security manager --- include/hci.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 6cc7e4bd..6cabc0b4 100644 --- a/include/hci.h +++ b/include/hci.h @@ -70,7 +70,9 @@ enum { HCI_ENCRYPT, HCI_INQUIRY, - HCI_RAW + HCI_RAW, + + HCI_SECMGR }; /* HCI ioctl defines */ @@ -94,6 +96,8 @@ enum { #define HCISETACLMTU _IOW('H', 227, int) #define HCISETSCOMTU _IOW('H', 228, int) +#define HCISETSECMGR _IOW('H', 230, int) + #define HCIINQUIRY _IOR('H', 240, int) /* HCI timeouts */ -- cgit From 735e59b37803748fea1077de064b285f78de1c10 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 13 Oct 2004 12:03:16 +0000 Subject: Add SIM Access types --- include/sdp.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/sdp.h b/include/sdp.h index 8acd862e..7c529de1 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -107,6 +107,7 @@ extern "C" { #define HCR_PRINT_SVCLASS_ID 0x1126 #define HCR_SCAN_SVCLASS_ID 0x1127 #define CIP_SVCLASS_ID 0x1128 +#define SAP_SVCLASS_ID 0x112d #define PNP_INFO_SVCLASS_ID 0x1200 #define GENERIC_NETWORKING_SVCLASS_ID 0x1201 #define GENERIC_FILETRANS_SVCLASS_ID 0x1202 @@ -141,6 +142,7 @@ extern "C" { #define HID_PROFILE_ID 0x1124 #define HCR_PROFILE_ID 0x1125 #define CIP_PROFILE_ID 0x1128 +#define SAP_PROFILE_ID 0x112d /* * Attribute identifier codes -- cgit From 81c45f31a8b4897e0a6267fb3a84b3f6b73557b7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 23 Oct 2004 17:51:55 +0000 Subject: For vendor packets set bit 0 in the packet type bitmask of the filter --- include/hci.h | 2 +- include/hci_lib.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 6cabc0b4..00f2d21a 100644 --- a/include/hci.h +++ b/include/hci.h @@ -113,7 +113,7 @@ enum { #define HCI_ACLDATA_PKT 0x02 #define HCI_SCODATA_PKT 0x03 #define HCI_EVENT_PKT 0x04 -#define HCI_UNKNOWN_PKT 0xff +#define HCI_VENDOR_PKT 0xff /* HCI Packet types */ #define HCI_2DH1 0x0002 diff --git a/include/hci_lib.h b/include/hci_lib.h index 70d39264..49857768 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -132,19 +132,19 @@ static inline void hci_filter_clear(struct hci_filter *f) } static inline void hci_filter_set_ptype(int t, struct hci_filter *f) { - hci_set_bit((t & HCI_FLT_TYPE_BITS), &f->type_mask); + hci_set_bit((t == HCI_VENDOR_PKT) ? 0 : (t & HCI_FLT_TYPE_BITS), &f->type_mask); } static inline void hci_filter_clear_ptype(int t, struct hci_filter *f) { - hci_clear_bit((t & HCI_FLT_TYPE_BITS), &f->type_mask); + hci_clear_bit((t == HCI_VENDOR_PKT) ? 0 : (t & HCI_FLT_TYPE_BITS), &f->type_mask); } static inline int hci_filter_test_ptype(int t, struct hci_filter *f) { - return hci_test_bit((t & HCI_FLT_TYPE_BITS), &f->type_mask); + return hci_test_bit((t == HCI_VENDOR_PKT) ? 0 : (t & HCI_FLT_TYPE_BITS), &f->type_mask); } static inline void hci_filter_all_ptypes(struct hci_filter *f) { - memset((void *)&f->type_mask, 0xff, sizeof(f->type_mask)); + memset((void *) &f->type_mask, 0xff, sizeof(f->type_mask)); } static inline void hci_filter_set_event(int e, struct hci_filter *f) { @@ -160,7 +160,7 @@ static inline int hci_filter_test_event(int e, struct hci_filter *f) } static inline void hci_filter_all_events(struct hci_filter *f) { - memset((void *)f->event_mask, 0xff, sizeof(f->event_mask)); + memset((void *) f->event_mask, 0xff, sizeof(f->event_mask)); } static inline void hci_filter_set_opcode(int opcode, struct hci_filter *f) { -- cgit From cc0deab6cac822b062e1c6ab7322d1e1d75d463e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 25 Oct 2004 06:44:47 +0000 Subject: Cleanup the API to prevent endian bugs --- include/hci_lib.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index 49857768..8c321d90 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -58,20 +58,20 @@ int hci_close_dev(int dd); int hci_send_cmd(int dd, uint16_t ogf, uint16_t ocf, uint8_t plen, void *param); int hci_send_req(int dd, struct hci_request *req, int timeout); -int hci_create_connection(int dd, const bdaddr_t *ba, uint16_t ptype, uint16_t clkoffset, uint8_t rswitch, uint16_t *handle, int to); +int hci_create_connection(int dd, const bdaddr_t *bdaddr, uint16_t ptype, uint16_t clkoffset, uint8_t rswitch, uint16_t *handle, int to); int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to); int hci_inquiry(int dev_id, int len, int num_rsp, const uint8_t *lap, inquiry_info **ii, long flags); int hci_devinfo(int dev_id, struct hci_dev_info *di); -int hci_devba(int dev_id, bdaddr_t *ba); +int hci_devba(int dev_id, bdaddr_t *bdaddr); int hci_devid(const char *str); /* deprecated: preserve compatibility */ int hci_local_name(int dd, int len, char *name, int to); int hci_read_local_name(int dd, int len, char *name, int to); int hci_write_local_name(int dd, const char *name, int to); -int hci_remote_name(int dd, const bdaddr_t *ba, int len, char *name, int to); -int hci_read_remote_name(int dd, const bdaddr_t *ba, int len, char *name, int to); +int hci_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to); +int hci_read_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to); int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); int hci_read_clock_offset(int dd, uint16_t handle, uint16_t *clkoffset, int to); @@ -83,9 +83,9 @@ int hci_write_voice_setting(int dd, uint16_t vs, int to); int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to); int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to); int hci_authenticate_link(int dd, uint16_t handle, int to); -int hci_encrypt_link(int dd, uint16_t handle, int on, int to); +int hci_encrypt_link(int dd, uint16_t handle, uint8_t encrypt, int to); /* role == 0 is master, 1 is slave */ -int hci_switch_role(int dd, bdaddr_t peer, int role, int to); +int hci_switch_role(int dd, bdaddr_t *bdaddr, uint8_t role, int to); int hci_park_mode(int dd, uint16_t handle, uint16_t max_interval, uint16_t min_interval, int to); int hci_exit_park_mode(int dd, uint16_t handle, int to); -- cgit From 1a04074615c182634202f03fd74a73f62107b93c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 25 Oct 2004 07:36:45 +0000 Subject: Add functions for reading and writing the inquiry mode --- include/hci_lib.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index 8c321d90..e40a1afd 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -88,6 +88,8 @@ int hci_encrypt_link(int dd, uint16_t handle, uint8_t encrypt, int to); int hci_switch_role(int dd, bdaddr_t *bdaddr, uint8_t role, int to); int hci_park_mode(int dd, uint16_t handle, uint16_t max_interval, uint16_t min_interval, int to); int hci_exit_park_mode(int dd, uint16_t handle, int to); +int hci_read_inquiry_mode(int dd, uint8_t *mode, int to); +int hci_write_inquiry_mode(int dd, uint8_t mode, int to); int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg); int hci_get_route(bdaddr_t *bdaddr); -- cgit From e1650950c01cf268c61b332efbb9b5b3f731a158 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 29 Oct 2004 02:44:56 +0000 Subject: Add RFCOMM socket options --- include/l2cap.h | 2 +- include/rfcomm.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/l2cap.h b/include/l2cap.h index b5052dcf..e76f9020 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -48,7 +48,7 @@ struct sockaddr_l2 { bdaddr_t l2_bdaddr; }; -/* Socket options */ +/* L2CAP socket options */ #define L2CAP_OPTIONS 0x01 struct l2cap_options { uint16_t omtu; diff --git a/include/rfcomm.h b/include/rfcomm.h index bb79a7a2..8cb8ac47 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -49,6 +49,14 @@ struct sockaddr_rc { uint8_t rc_channel; }; +/* RFCOMM socket options */ +#define RFCOMM_LM 0x03 +#define RFCOMM_LM_MASTER 0x0001 +#define RFCOMM_LM_AUTH 0x0002 +#define RFCOMM_LM_ENCRYPT 0x0004 +#define RFCOMM_LM_TRUSTED 0x0008 +#define RFCOMM_LM_RELIABLE 0x0010 + /* RFCOMM TTY support */ #define RFCOMM_MAX_DEV 256 -- cgit From 9427f5dc51c6962692eecd7250f2a1130dbc49ad Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 4 Nov 2004 11:21:34 +0000 Subject: Add hci_change_link_key() function --- include/hci.h | 13 +++++++++++++ include/hci_lib.h | 1 + 2 files changed, 14 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 00f2d21a..c8c3aa16 100644 --- a/include/hci.h +++ b/include/hci.h @@ -370,6 +370,12 @@ typedef struct { } __attribute__ ((packed)) set_conn_encrypt_cp; #define SET_CONN_ENCRYPT_CP_SIZE 3 +#define OCF_CHANGE_CONN_LINK_KEY 0x0015 +typedef struct { + uint16_t handle; +} __attribute__ ((packed)) change_conn_link_key_cp; +#define CHANGE_CONN_LINK_KEY_CP_SIZE 2 + #define OCF_REMOTE_NAME_REQ 0x0019 typedef struct { bdaddr_t bdaddr; @@ -860,6 +866,13 @@ typedef struct { } __attribute__ ((packed)) evt_encrypt_change; #define EVT_ENCRYPT_CHANGE_SIZE 5 +#define EVT_CHANGE_CONN_LINK_KEY_COMPLETE 0x09 +typedef struct { + uint8_t status; + uint16_t handle; +} __attribute__ ((packed)) evt_change_conn_link_key_complete; +#define EVT_CHANGE_CONN_LINK_KEY_COMPLETE_SIZE 3 + #define EVT_READ_REMOTE_FEATURES_COMPLETE 0x0B typedef struct { uint8_t status; diff --git a/include/hci_lib.h b/include/hci_lib.h index e40a1afd..0d9867f9 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -84,6 +84,7 @@ int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to); int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to); int hci_authenticate_link(int dd, uint16_t handle, int to); int hci_encrypt_link(int dd, uint16_t handle, uint8_t encrypt, int to); +int hci_change_link_key(int dd, uint16_t handle, int to); /* role == 0 is master, 1 is slave */ int hci_switch_role(int dd, bdaddr_t *bdaddr, uint8_t role, int to); int hci_park_mode(int dd, uint16_t handle, uint16_t max_interval, uint16_t min_interval, int to); -- cgit From 34fb9e62566cddafd8d4fea40e368434859ae25a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 8 Nov 2004 21:51:52 +0000 Subject: Change HCI_KEY_MISSING to HCI_PIN_OR_KEY_MISSING --- include/hci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index c8c3aa16..2f959fe2 100644 --- a/include/hci.h +++ b/include/hci.h @@ -150,7 +150,7 @@ enum { #define HCI_HARDWARE_FAILURE 0x03 #define HCI_PAGE_TIMEOUT 0x04 #define HCI_AUTHENTICATION_FAILURE 0x05 -#define HCI_KEY_MISSING 0x06 +#define HCI_PIN_OR_KEY_MISSING 0x06 #define HCI_MEMORY_FULL 0x07 #define HCI_CONNECTION_TIMEOUT 0x08 #define HCI_MAX_NUMBER_OF_CONNECTIONS 0x09 -- cgit From c3b2524a78dc4d27025f6cd3c8f4c56f5de012ee Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 9 Nov 2004 00:05:01 +0000 Subject: Add the missing HCI error codes --- include/hci.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 2f959fe2..e7f04596 100644 --- a/include/hci.h +++ b/include/hci.h @@ -186,6 +186,15 @@ enum { #define HCI_QOS_NOT_SUPPORTED 0x27 #define HCI_INSTANT_PASSED 0x28 #define HCI_PAIRING_NOT_SUPPORTED 0x29 +#define HCI_TRANSACTION_COLLISION 0x2a +#define HCI_QOS_UNACCEPTABLE_PARAMETER 0x2c +#define HCI_QOS_REJECTED 0x2d +#define HCI_CLASSIFICATION_NOT_SUPPORTED 0x2e +#define HCI_INSUFFICIENT_SECURITY 0x2f +#define HCI_PARAMETER_OUT_OF_RANGE 0x30 +#define HCI_ROLE_SWITCH_PENDING 0x32 +#define HCI_SLOT_VIOLATION 0x34 +#define HCI_ROLE_SWITCH_FAILED 0x35 /* ACL flags */ #define ACL_CONT 0x01 -- cgit From 5106bfbab293c6168eeb0f036a37efc548a632b4 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 9 Nov 2004 12:46:34 +0000 Subject: Add definition for the SECURE link mode --- include/hci.h | 1 + include/l2cap.h | 1 + include/rfcomm.h | 1 + 3 files changed, 3 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index e7f04596..5e874e07 100644 --- a/include/hci.h +++ b/include/hci.h @@ -267,6 +267,7 @@ enum { #define HCI_LM_ENCRYPT 0x0004 #define HCI_LM_TRUSTED 0x0008 #define HCI_LM_RELIABLE 0x0010 +#define HCI_LM_SECURE 0x0020 /* ----- HCI Commands ----- */ diff --git a/include/l2cap.h b/include/l2cap.h index e76f9020..025d0f66 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -67,6 +67,7 @@ struct l2cap_conninfo { #define L2CAP_LM_ENCRYPT 0x0004 #define L2CAP_LM_TRUSTED 0x0008 #define L2CAP_LM_RELIABLE 0x0010 +#define L2CAP_LM_SECURE 0x0020 #define L2CAP_QOS 0x04 struct l2cap_qos { diff --git a/include/rfcomm.h b/include/rfcomm.h index 8cb8ac47..02775d50 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -56,6 +56,7 @@ struct sockaddr_rc { #define RFCOMM_LM_ENCRYPT 0x0004 #define RFCOMM_LM_TRUSTED 0x0008 #define RFCOMM_LM_RELIABLE 0x0010 +#define RFCOMM_LM_SECURE 0x0020 /* RFCOMM TTY support */ #define RFCOMM_MAX_DEV 256 -- cgit From 0bae50cd5c691f338f6fa820a8b803a45c0de181 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 9 Nov 2004 21:33:17 +0000 Subject: Add hci_{read|write}_afh_mode() functions --- include/hci_lib.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index 0d9867f9..356e4edd 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -91,6 +91,8 @@ int hci_park_mode(int dd, uint16_t handle, uint16_t max_interval, uint16_t min_i int hci_exit_park_mode(int dd, uint16_t handle, int to); int hci_read_inquiry_mode(int dd, uint8_t *mode, int to); int hci_write_inquiry_mode(int dd, uint8_t mode, int to); +int hci_read_afh_mode(int dd, uint8_t *mode, int to); +int hci_write_afh_mode(int dd, uint8_t mode, int to); int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg); int hci_get_route(bdaddr_t *bdaddr); -- cgit From 213febe584cdd8c7b5fd2defc2d56f0c84677e51 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 9 Nov 2004 22:29:55 +0000 Subject: Add hci_read_afh_map() function --- include/hci_lib.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index 356e4edd..095a0b80 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -93,6 +93,7 @@ int hci_read_inquiry_mode(int dd, uint8_t *mode, int to); int hci_write_inquiry_mode(int dd, uint8_t mode, int to); int hci_read_afh_mode(int dd, uint8_t *mode, int to); int hci_write_afh_mode(int dd, uint8_t mode, int to); +int hci_read_afh_map(int dd, uint16_t handle, uint8_t *mode, uint8_t *map, int to); int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg); int hci_get_route(bdaddr_t *bdaddr); -- cgit From 0792c0b319112503dd5129f05536f3c6ae4c746c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 9 Nov 2004 22:52:40 +0000 Subject: Add hci_set_afh_classification() function --- include/hci.h | 10 ++++++++++ include/hci_lib.h | 1 + 2 files changed, 11 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 5e874e07..683c988f 100644 --- a/include/hci.h +++ b/include/hci.h @@ -694,6 +694,16 @@ typedef struct { } __attribute__ ((packed)) write_current_iac_lap_cp; #define WRITE_CURRENT_IAC_LAP_CP_SIZE 1+3*MAX_IAC_LAP +#define OCF_SET_AFH_CLASSIFICATION 0x003F +typedef struct { + uint8_t map[10]; +} __attribute__ ((packed)) set_afh_classification_cp; +#define SET_AFH_CLASSIFICATION_CP_SIZE 10 +typedef struct { + uint8_t status; +} __attribute__ ((packed)) set_afh_classification_rp; +#define SET_AFH_CLASSIFICATION_RP_SIZE 1 + #define OCF_READ_INQUIRY_MODE 0x0044 typedef struct { uint8_t status; diff --git a/include/hci_lib.h b/include/hci_lib.h index 095a0b80..b8dbd432 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -93,6 +93,7 @@ int hci_read_inquiry_mode(int dd, uint8_t *mode, int to); int hci_write_inquiry_mode(int dd, uint8_t mode, int to); int hci_read_afh_mode(int dd, uint8_t *mode, int to); int hci_write_afh_mode(int dd, uint8_t mode, int to); +int hci_set_afh_classification(int dd, uint8_t *map, int to); int hci_read_afh_map(int dd, uint16_t handle, uint8_t *mode, uint8_t *map, int to); int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg); -- cgit From 113e48df05d54510646b3dcf33a1df2c60e3461f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 13 Nov 2004 12:54:41 +0000 Subject: The cnum value must be uint32_t to match the kernel interface --- include/cmtp.h | 2 +- include/hidp.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/cmtp.h b/include/cmtp.h index f0981f2d..3f8e943c 100644 --- a/include/cmtp.h +++ b/include/cmtp.h @@ -63,7 +63,7 @@ struct cmtp_conninfo { }; struct cmtp_connlist_req { - uint16_t cnum; + uint32_t cnum; struct cmtp_conninfo *ci; }; diff --git a/include/hidp.h b/include/hidp.h index 21b62513..7f27fde1 100644 --- a/include/hidp.h +++ b/include/hidp.h @@ -79,7 +79,7 @@ struct hidp_conninfo { }; struct hidp_connlist_req { - uint16_t cnum; + uint32_t cnum; struct hidp_conninfo *ci; }; -- cgit From 0ea7064b34d9f03e9aa7d8abeb7c0e6bcc8a37ac Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 29 Nov 2004 03:48:21 +0000 Subject: Add service classes and profile ids for WAP --- include/sdp.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/sdp.h b/include/sdp.h index 7c529de1..712e42e7 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -95,6 +95,8 @@ extern "C" { #define INTERCOM_SVCLASS_ID 0x1110 #define FAX_SVCLASS_ID 0x1111 #define HEADSET_AGW_SVCLASS_ID 0x1112 +#define WAP_SVCLASS_ID 0x1113 +#define WAP_CLIENT_SVCLASS_ID 0x1114 #define PANU_SVCLASS_ID 0x1115 #define NAP_SVCLASS_ID 0x1116 #define GN_SVCLASS_ID 0x1117 @@ -133,6 +135,8 @@ extern "C" { #define INTERCOM_PROFILE_ID 0x1110 #define FAX_PROFILE_ID 0x1111 #define HEADSET_AGW_PROFILE_ID 0x1112 +#define WAP_PROFILE_ID 0x1113 +#define WAP_CLIENT_PROFILE_ID 0x1114 #define PANU_PROFILE_ID 0x1115 #define NAP_PROFILE_ID 0x1116 #define GN_PROFILE_ID 0x1117 -- cgit From 6864c723272d4790a2fec4a1c23fa5e46ac15e5f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 7 Dec 2004 11:29:58 +0000 Subject: Update the UUID constants and its translations --- include/sdp.h | 126 ++++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 91 insertions(+), 35 deletions(-) (limited to 'include') diff --git a/include/sdp.h b/include/sdp.h index 712e42e7..8f832ea6 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -54,26 +54,27 @@ extern "C" { * Protocol UUIDs */ #define SDP_UUID 0x0001 -#define RFCOMM_UUID 0x0003 -#define TCS_BIN_UUID 0x0005 -#define L2CAP_UUID 0x0100 -#define IP_UUID 0x0009 #define UDP_UUID 0x0002 +#define RFCOMM_UUID 0x0003 #define TCP_UUID 0x0004 #define TCS_BIN_UUID 0x0005 #define TCS_AT_UUID 0x0006 #define OBEX_UUID 0x0008 -#define FTP_UUID 0x000A -#define HTTP_UUID 0x000C -#define WSP_UUID 0x000E -#define BNEP_UUID 0x000F +#define IP_UUID 0x0009 +#define FTP_UUID 0x000a +#define HTTP_UUID 0x000c +#define WSP_UUID 0x000e +#define BNEP_UUID 0x000f +#define UPNP_UUID 0x0010 #define HIDP_UUID 0x0011 #define HCRP_CTRL_UUID 0x0012 #define HCRP_DATA_UUID 0x0014 #define HCRP_NOTE_UUID 0x0016 #define AVCTP_UUID 0x0017 #define AVDTP_UUID 0x0019 -#define CMTP_UUID 0x001B +#define CMTP_UUID 0x001b +#define UDI_UUID 0x001d +#define L2CAP_UUID 0x0100 /* * Service class identifiers of standard services and service groups @@ -92,6 +93,10 @@ extern "C" { #define CORDLESS_TELEPHONY_SVCLASS_ID 0x1109 #define AUDIO_SOURCE_SVCLASS_ID 0x110a #define AUDIO_SINK_SVCLASS_ID 0x110b +#define AV_REMOTE_TARGET_SVCLASS_ID 0x110c +#define ADVANCED_AUDIO_SVCLASS_ID 0x110d +#define AV_REMOTE_SVCLASS_ID 0x110e +#define VIDEO_CONF_SVCLASS_ID 0x110f #define INTERCOM_SVCLASS_ID 0x1110 #define FAX_SVCLASS_ID 0x1111 #define HEADSET_AGW_SVCLASS_ID 0x1112 @@ -100,21 +105,38 @@ extern "C" { #define PANU_SVCLASS_ID 0x1115 #define NAP_SVCLASS_ID 0x1116 #define GN_SVCLASS_ID 0x1117 +#define DIRECT_PRINTING_SVCLASS_ID 0x1118 +#define REFERENCE_PRINTING_SVCLASS_ID 0x1119 #define IMAGING_SVCLASS_ID 0x111a #define IMAGING_RESPONDER_SVCLASS_ID 0x111b +#define IMAGING_ARCHIVE_SVCLASS_ID 0x111c +#define IMAGING_REFOBJS_SVCLASS_ID 0x111d #define HANDSFREE_SVCLASS_ID 0x111e -#define HANDSFREE_AUDIO_GW_SVCLASS_ID 0x111f +#define HANDSFREE_AGW_SVCLASS_ID 0x111f +#define DIRECT_PRT_REFOBJS_SVCLASS_ID 0x1120 +#define REFLECTED_UI_SVCLASS_ID 0x1121 +#define BASIC_PRINTING_SVCLASS_ID 0x1122 +#define PRINTING_STATUS_SVCLASS_ID 0x1123 #define HID_SVCLASS_ID 0x1124 #define HCR_SVCLASS_ID 0x1125 #define HCR_PRINT_SVCLASS_ID 0x1126 #define HCR_SCAN_SVCLASS_ID 0x1127 #define CIP_SVCLASS_ID 0x1128 +#define VIDEO_CONF_GW_SVCLASS_ID 0x1129 +#define UDI_MT_SVCLASS_ID 0x112a +#define UDI_TA_SVCLASS_ID 0x112b +#define AV_SVCLASS_ID 0x112c #define SAP_SVCLASS_ID 0x112d #define PNP_INFO_SVCLASS_ID 0x1200 #define GENERIC_NETWORKING_SVCLASS_ID 0x1201 #define GENERIC_FILETRANS_SVCLASS_ID 0x1202 #define GENERIC_AUDIO_SVCLASS_ID 0x1203 #define GENERIC_TELEPHONY_SVCLASS_ID 0x1204 +#define UPNP_SVCLASS_ID 0x1205 +#define UPNP_IP_SVCLASS_ID 0x1206 +#define UPNP_PAN_SVCLASS_ID 0x1300 +#define UPNP_LAP_SVCLASS_ID 0x1301 +#define UPNP_L2CAP_SVCLASS_ID 0x1302 #define VIDEO_SOURCE_SVCLASS_ID 0x1303 #define VIDEO_SINK_SVCLASS_ID 0x1304 @@ -122,31 +144,65 @@ extern "C" { * Standard profile descriptor identifiers; note these * may be identical to some of the service classes defined above */ -#define SERIAL_PORT_PROFILE_ID 0x1101 -#define LAN_ACCESS_PROFILE_ID 0x1102 -#define DIALUP_NET_PROFILE_ID 0x1103 -#define IRMC_SYNC_PROFILE_ID 0x1104 -#define OBEX_OBJPUSH_PROFILE_ID 0x1105 -#define OBEX_FILETRANS_PROFILE_ID 0x1106 -#define IRMC_SYNC_CMD_PROFILE_ID 0x1107 -#define HEADSET_PROFILE_ID 0x1108 -#define CORDLESS_TELEPHONY_PROFILE_ID 0x1109 -#define ADVANCED_AUDIO_PROFILE_ID 0x110d -#define INTERCOM_PROFILE_ID 0x1110 -#define FAX_PROFILE_ID 0x1111 -#define HEADSET_AGW_PROFILE_ID 0x1112 -#define WAP_PROFILE_ID 0x1113 -#define WAP_CLIENT_PROFILE_ID 0x1114 -#define PANU_PROFILE_ID 0x1115 -#define NAP_PROFILE_ID 0x1116 -#define GN_PROFILE_ID 0x1117 -#define IMAGING_PROFILE_ID 0x111a -#define IMAGING_RESPONDER_PROFILE_ID 0x111b -#define HANDSFREE_PROFILE_ID 0x111e -#define HID_PROFILE_ID 0x1124 -#define HCR_PROFILE_ID 0x1125 -#define CIP_PROFILE_ID 0x1128 -#define SAP_PROFILE_ID 0x112d +#define SDP_SERVER_PROFILE_ID SDP_SERVER_SVCLASS_ID +#define BROWSE_GRP_DESC_PROFILE_ID BROWSE_GRP_DESC_SVCLASS_ID +#define SERIAL_PORT_PROFILE_ID SERIAL_PORT_SVCLASS_ID +#define LAN_ACCESS_PROFILE_ID LAN_ACCESS_SVCLASS_ID +#define DIALUP_NET_PROFILE_ID DIALUP_NET_SVCLASS_ID +#define IRMC_SYNC_PROFILE_ID IRMC_SYNC_SVCLASS_ID +#define OBEX_OBJPUSH_PROFILE_ID OBEX_OBJPUSH_SVCLASS_ID +#define OBEX_FILETRANS_PROFILE_ID OBEX_FILETRANS_SVCLASS_ID +#define IRMC_SYNC_CMD_PROFILE_ID IRMC_SYNC_CMD_SVCLASS_ID +#define HEADSET_PROFILE_ID HEADSET_SVCLASS_ID +#define CORDLESS_TELEPHONY_PROFILE_ID CORDLESS_TELEPHONY_SVCLASS_ID +#define AUDIO_SOURCE_PROFILE_ID AUDIO_SOURCE_SVCLASS_ID +#define AUDIO_SINK_PROFILE_ID AUDIO_SINK_SVCLASS_ID +#define AV_REMOTE_TARGET_PROFILE_ID AV_REMOTE_TARGET_SVCLASS_ID +#define ADVANCED_AUDIO_PROFILE_ID ADVANCED_AUDIO_SVCLASS_ID +#define AV_REMOTE_PROFILE_ID AV_REMOTE_SVCLASS_ID +#define VIDEO_CONF_PROFILE_ID VIDEO_CONF_SVCLASS_ID +#define INTERCOM_PROFILE_ID INTERCOM_SVCLASS_ID +#define FAX_PROFILE_ID FAX_SVCLASS_ID +#define HEADSET_AGW_PROFILE_ID HEADSET_AGW_SVCLASS_ID +#define WAP_PROFILE_ID WAP_SVCLASS_ID +#define WAP_CLIENT_PROFILE_ID WAP_CLIENT_SVCLASS_ID +#define PANU_PROFILE_ID PANU_SVCLASS_ID +#define NAP_PROFILE_ID NAP_SVCLASS_ID +#define GN_PROFILE_ID GN_SVCLASS_ID +#define DIRECT_PRINTING_PROFILE_ID DIRECT_PRINTING_SVCLASS_ID +#define REFERENCE_PRINTING_PROFILE_ID REFERENCE_PRINTING_SVCLASS_ID +#define IMAGING_PROFILE_ID IMAGING_SVCLASS_ID +#define IMAGING_RESPONDER_PROFILE_ID IMAGING_RESPONDER_SVCLASS_ID +#define IMAGING_ARCHIVE_PROFILE_ID IMAGING_ARCHIVE_SVCLASS_ID +#define IMAGING_REFOBJS_PROFILE_ID IMAGING_REFOBJS_SVCLASS_ID +#define HANDSFREE_PROFILE_ID HANDSFREE_SVCLASS_ID +#define HANDSFREE_AGW_PROFILE_ID HANDSFREE_AGW_SVCLASS_ID +#define DIRECT_PRT_REFOBJS_PROFILE_ID DIRECT_PRT_REFOBJS_SVCLASS_ID +#define REFLECTED_UI_PROFILE_ID REFLECTED_UI_SVCLASS_ID +#define BASIC_PRINTING_PROFILE_ID BASIC_PRINTING_SVCLASS_ID +#define PRINTING_STATUS_PROFILE_ID PRINTING_STATUS_SVCLASS_ID +#define HID_PROFILE_ID HID_SVCLASS_ID +#define HCR_PROFILE_ID HCR_SCAN_SVCLASS_ID +#define HCR_PRINT_PROFILE_ID HCR_PRINT_SVCLASS_ID +#define HCR_SCAN_PROFILE_ID HCR_SCAN_SVCLASS_ID +#define CIP_PROFILE_ID CIP_SVCLASS_ID +#define VIDEO_CONF_GW_PROFILE_ID VIDEO_CONF_GW_SVCLASS_ID +#define UDI_MT_PROFILE_ID UDI_MT_SVCLASS_ID +#define UDI_TA_PROFILE_ID UDI_TA_SVCLASS_ID +#define AV_PROFILE_ID AV_SVCLASS_ID +#define SAP_PROFILE_ID SAP_SVCLASS_ID +#define PNP_INFO_PROFILE_ID PNP_INFO_SVCLASS_ID +#define GENERIC_NETWORKING_PROFILE_ID GENERIC_NETWORKING_SVCLASS_ID +#define GENERIC_FILETRANS_PROFILE_ID GENERIC_FILETRANS_SVCLASS_ID +#define GENERIC_AUDIO_PROFILE_ID GENERIC_AUDIO_SVCLASS_ID +#define GENERIC_TELEPHONY_PROFILE_ID GENERIC_TELEPHONY_SVCLASS_ID +#define UPNP_PROFILE_ID UPNP_SVCLASS_ID +#define UPNP_IP_PROFILE_ID UPNP_IP_SVCLASS_ID +#define UPNP_PAN_PROFILE_ID UPNP_PAN_SVCLASS_ID +#define UPNP_LAP_PROFILE_ID UPNP_LAP_SVCLASS_ID +#define UPNP_L2CAP_PROFILE_ID UPNP_L2CAP_SVCLASS_ID +#define VIDEO_SOURCE_PROFILE_ID VIDEO_SOURCE_SVCLASS_ID +#define VIDEO_SINK_PROFILE_ID VIDEO_SINK_SVCLASS_ID /* * Attribute identifier codes -- cgit From 2fda2326e810170225ddc7bf0c43479b617a1a5f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 7 Dec 2004 12:17:16 +0000 Subject: Cleanup attribute definitions --- include/sdp.h | 97 ++++++++++++++++++++++++++++++----------------------------- 1 file changed, 50 insertions(+), 47 deletions(-) (limited to 'include') diff --git a/include/sdp.h b/include/sdp.h index 8f832ea6..4b966618 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -207,44 +207,62 @@ extern "C" { /* * Attribute identifier codes */ -#define SDP_SERVER_RECORD_HANDLE 0x0000 +#define SDP_SERVER_RECORD_HANDLE 0x0000 /* - * Possible values for attribute-id are listed below. + * Possible values for attribute-id are listed below. * See SDP Spec, section "Service Attribute Definitions" for more details. */ -#define SDP_ATTR_RECORD_HANDLE 0x0000 -#define SDP_ATTR_SVCLASS_ID_LIST 0x0001 -#define SDP_ATTR_RECORD_STATE 0x0002 -#define SDP_ATTR_SERVICE_ID 0x0003 -#define SDP_ATTR_PROTO_DESC_LIST 0x0004 -#define SDP_ATTR_BROWSE_GRP_LIST 0x0005 -#define SDP_ATTR_LANG_BASE_ATTR_ID_LIST 0x0006 -#define SDP_ATTR_SVCINFO_TTL 0x0007 -#define SDP_ATTR_SERVICE_AVAILABILITY 0x0008 -#define SDP_ATTR_PFILE_DESC_LIST 0x0009 -#define SDP_ATTR_DOC_URL 0x000A -#define SDP_ATTR_CLNT_EXEC_URL 0x000B -#define SDP_ATTR_ICON_URL 0x000C -#define SDP_ATTR_ADD_PROTO_DESC_LIST 0x000D - +#define SDP_ATTR_RECORD_HANDLE 0x0000 +#define SDP_ATTR_SVCLASS_ID_LIST 0x0001 +#define SDP_ATTR_RECORD_STATE 0x0002 +#define SDP_ATTR_SERVICE_ID 0x0003 +#define SDP_ATTR_PROTO_DESC_LIST 0x0004 +#define SDP_ATTR_BROWSE_GRP_LIST 0x0005 +#define SDP_ATTR_LANG_BASE_ATTR_ID_LIST 0x0006 +#define SDP_ATTR_SVCINFO_TTL 0x0007 +#define SDP_ATTR_SERVICE_AVAILABILITY 0x0008 +#define SDP_ATTR_PFILE_DESC_LIST 0x0009 +#define SDP_ATTR_DOC_URL 0x000a +#define SDP_ATTR_CLNT_EXEC_URL 0x000b +#define SDP_ATTR_ICON_URL 0x000c +#define SDP_ATTR_ADD_PROTO_DESC_LIST 0x000d + +#define SDP_ATTR_GROUP_ID 0x0200 #define SDP_ATTR_IP_SUBNET 0x0200 +#define SDP_ATTR_VERSION_NUM_LIST 0x0200 +#define SDP_ATTR_SVCDB_STATE 0x0201 + #define SDP_ATTR_SERVICE_VERSION 0x0300 -#define SDP_EXTERNAL_NETWORK 0x0301 +#define SDP_ATTR_EXTERNAL_NETWORK 0x0301 #define SDP_ATTR_SUPPORTED_DATA_STORES_LIST 0x0301 +#define SDP_ATTR_FAX_CLASS1_SUPPORT 0x0302 #define SDP_ATTR_REMOTE_AUDIO_VOLUME_CONTROL 0x0302 +#define SDP_ATTR_FAX_CLASS20_SUPPORT 0x0303 #define SDP_ATTR_SUPPORTED_FORMATS_LIST 0x0303 -#define SDP_ATTR_SECURITY_DESC 0x030A -#define SDP_ATTR_NET_ACCESS_TYPE 0x030B -#define SDP_ATTR_MAX_NET_ACCESSRATE 0x030C -#define SDP_ATTR_IP4_SUBNET 0x030D -#define SDP_ATTR_IP6_SUBNET 0x030E -#define SDP_SUPPORTED_FEATURES 0x0311 - +#define SDP_ATTR_FAX_CLASS2_SUPPORT 0x0304 +#define SDP_ATTR_AUDIO_FEEDBACK_SUPPORT 0x0305 +#define SDP_ATTR_NETWORK_ADDRESS 0x0306 +#define SDP_ATTR_WAP_GATEWAY 0x0307 +#define SDP_ATTR_HOMEPAGE_URL 0x0308 +#define SDP_ATTR_WAP_STACK_TYPE 0x0309 +#define SDP_ATTR_SECURITY_DESC 0x030a +#define SDP_ATTR_NET_ACCESS_TYPE 0x030b +#define SDP_ATTR_MAX_NET_ACCESSRATE 0x030c +#define SDP_ATTR_IP4_SUBNET 0x030d +#define SDP_ATTR_IP6_SUBNET 0x030e +#define SDP_ATTR_SUPPORTED_CAPABILITIES 0x0310 +#define SDP_ATTR_SUPPORTED_FEATURES 0x0311 +#define SDP_ATTR_SUPPORTED_FUNCTIONS 0x0312 +#define SDP_ATTR_TOTAL_IMAGING_DATA_CAPACITY 0x0313 /* * These identifiers are based on the SDP spec stating that * "base attribute id of the primary (universal) language must be 0x0100" + * + * Other languages should have their own offset; e.g.: + * #define XXXLangBase yyyy + * #define AttrServiceName_XXX 0x0000+XXXLangBase */ #define SDP_PRIMARY_LANG_BASE 0x0100 @@ -252,21 +270,6 @@ extern "C" { #define SDP_ATTR_SVCDESC_PRIMARY 0x0001 + SDP_PRIMARY_LANG_BASE #define SDP_ATTR_PROVNAME_PRIMARY 0x0002 + SDP_PRIMARY_LANG_BASE -/* - * Other languages should have their own offset; e.g.: - * #define XXXLangBase yyyy - * #define AttrServiceName_XXX 0x0000+XXXLangBase - * ... - */ - -/* - * These attributes are specific to the SDP server only; i.e., - * can be present only in the service record of the SDP server - */ -#define SDP_ATTR_VERSION_NUM_LIST 0x0200 -#define SDP_ATTR_SVCDB_STATE 0x0201 -#define SDP_ATTR_GROUP_ID 0x0200 - /* * The Data representation in SDP PDUs (pps 339, 340 of BT SDP Spec) * These are the exact data type+size descriptor values @@ -371,7 +374,7 @@ typedef struct { /* * Common definitions for attributes in the SDP. - * Should the type of any of these change, you need only make a change here. + * Should the type of any of these change, you need only make a change here. */ typedef struct { char data[16]; @@ -398,10 +401,10 @@ struct _sdp_list { * User-visible strings can be in many languages * in addition to the universal language. * - * Language meta-data includes language code in ISO639 - * followed by the encoding format. The third field in this - * structure is the attribute offset for the language. - * User-visible strings in the specified language can be + * Language meta-data includes language code in ISO639 + * followed by the encoding format. The third field in this + * structure is the attribute offset for the language. + * User-visible strings in the specified language can be * obtained at this offset. */ typedef struct { @@ -411,8 +414,8 @@ typedef struct { } sdp_lang_attr_t; /* - * Profile descriptor is the Bluetooth profile metadata. If a - * service conforms to a well-known profile, then its profile + * Profile descriptor is the Bluetooth profile metadata. If a + * service conforms to a well-known profile, then its profile * identifier (UUID) is an attribute of the service. In addition, * if the profile has a version number it is specified here. */ -- cgit From 01a43396075f47dffb2d6fffc9a2d3bb713a7f8d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 7 Dec 2004 12:44:48 +0000 Subject: Add Device ID and HID attribute definitions --- include/sdp.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'include') diff --git a/include/sdp.h b/include/sdp.h index 4b966618..7cb11bd8 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -256,6 +256,29 @@ extern "C" { #define SDP_ATTR_SUPPORTED_FUNCTIONS 0x0312 #define SDP_ATTR_TOTAL_IMAGING_DATA_CAPACITY 0x0313 +#define SDP_ATTR_SPECIFICATION_ID 0x0200 +#define SDP_ATTR_VENDOR_ID 0x0201 +#define SDP_ATTR_PRODUCT_ID 0x0202 +#define SDP_ATTR_VERSION 0x0203 +#define SDP_ATTR_PRIMARY_RECORD 0x0204 +#define SDP_ATTR_VENDOR_ID_SOURCE 0x0205 + +#define SDP_ATTR_HID_DEVICE_RELEASE_NUMBER 0x0200 +#define SDP_ATTR_HID_PARSER_VERSION 0x0201 +#define SDP_ATTR_HID_DEVICE_SUBCLASS 0x0202 +#define SDP_ATTR_HID_COUNTRY_CODE 0x0203 +#define SDP_ATTR_HID_VIRTUAL_CABLE 0x0204 +#define SDP_ATTR_HID_RECONNECT_INITIATE 0x0205 +#define SDP_ATTR_HID_DESCRIPTOR_LIST 0x0206 +#define SDP_ATTR_HID_LANG_ID_BASE_LIST 0x0207 +#define SDP_ATTR_HID_SDP_DISABLE 0x0208 +#define SDP_ATTR_HID_BATTERY_POWER 0x0209 +#define SDP_ATTR_HID_REMOTE_WAKEUP 0x020a +#define SDP_ATTR_HID_PROFILE_VERSION 0x020b +#define SDP_ATTR_HID_SUPERVISION_TIMEOUT 0x020c +#define SDP_ATTR_HID_NORMALLY_CONNECTABLE 0x020d +#define SDP_ATTR_HID_BOOT_DEVICE 0x020e + /* * These identifiers are based on the SDP spec stating that * "base attribute id of the primary (universal) language must be 0x0100" -- cgit From 984277aa49d35e4033f6c65266096364ac3243ed Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 25 Dec 2004 17:26:06 +0000 Subject: Update socket option definitions --- include/l2cap.h | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'include') diff --git a/include/l2cap.h b/include/l2cap.h index 025d0f66..6fa155f1 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -54,11 +54,13 @@ struct l2cap_options { uint16_t omtu; uint16_t imtu; uint16_t flush_to; + uint8_t mode; }; #define L2CAP_CONNINFO 0x02 struct l2cap_conninfo { uint16_t hci_handle; + uint8_t dev_class[3]; }; #define L2CAP_LM 0x03 @@ -69,20 +71,6 @@ struct l2cap_conninfo { #define L2CAP_LM_RELIABLE 0x0010 #define L2CAP_LM_SECURE 0x0020 -#define L2CAP_QOS 0x04 -struct l2cap_qos { - uint16_t service_type; - uint32_t token_rate; - uint32_t token_bucket_size; - uint32_t peak_bandwidth; - uint32_t latency; - uint32_t delay_variation; -}; - -#define L2CAP_SERV_NO_TRAFFIC 0x00 -#define L2CAP_SERV_BEST_EFFORT 0x01 -#define L2CAP_SERV_GUARANTEED 0x02 - /* L2CAP command codes */ #define L2CAP_COMMAND_REJ 0x01 #define L2CAP_CONN_REQ 0x02 @@ -156,8 +144,10 @@ typedef struct { } __attribute__ ((packed)) l2cap_conf_rsp; #define L2CAP_CONF_RSP_SIZE 6 -#define L2CAP_CONF_SUCCESS 0x00 -#define L2CAP_CONF_UNACCEPT 0x01 +#define L2CAP_CONF_SUCCESS 0x0000 +#define L2CAP_CONF_UNACCEPT 0x0001 +#define L2CAP_CONF_REJECT 0x0002 +#define L2CAP_CONF_UNKNOWN 0x0003 typedef struct { uint8_t type; @@ -169,6 +159,7 @@ typedef struct { #define L2CAP_CONF_MTU 0x01 #define L2CAP_CONF_FLUSH_TO 0x02 #define L2CAP_CONF_QOS 0x03 +#define L2CAP_CONF_RFC 0x04 #define L2CAP_CONF_RFC_MODE 0x04 #define L2CAP_CONF_MAX_SIZE 22 -- cgit From 8661484ddc5d79689c6a3d1dd41102ca9e89a8cf Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 25 Dec 2004 17:35:34 +0000 Subject: Update connection information definitions --- include/l2cap.h | 12 ++++++------ include/rfcomm.h | 6 ++++++ include/sco.h | 5 +++-- 3 files changed, 15 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/l2cap.h b/include/l2cap.h index 6fa155f1..7029c32c 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -51,16 +51,16 @@ struct sockaddr_l2 { /* L2CAP socket options */ #define L2CAP_OPTIONS 0x01 struct l2cap_options { - uint16_t omtu; - uint16_t imtu; - uint16_t flush_to; - uint8_t mode; + uint16_t omtu; + uint16_t imtu; + uint16_t flush_to; + uint8_t mode; }; #define L2CAP_CONNINFO 0x02 struct l2cap_conninfo { - uint16_t hci_handle; - uint8_t dev_class[3]; + uint16_t hci_handle; + uint8_t dev_class[3]; }; #define L2CAP_LM 0x03 diff --git a/include/rfcomm.h b/include/rfcomm.h index 02775d50..d4cfc056 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -50,6 +50,12 @@ struct sockaddr_rc { }; /* RFCOMM socket options */ +#define RFCOMM_CONNINFO 0x02 +struct rfcomm_conninfo { + uint16_t hci_handle; + uint8_t dev_class[3]; +}; + #define RFCOMM_LM 0x03 #define RFCOMM_LM_MASTER 0x0001 #define RFCOMM_LM_AUTH 0x0002 diff --git a/include/sco.h b/include/sco.h index 0d0ac123..09ab395e 100644 --- a/include/sco.h +++ b/include/sco.h @@ -51,12 +51,13 @@ struct sockaddr_sco { /* set/get sockopt defines */ #define SCO_OPTIONS 0x01 struct sco_options { - uint16_t mtu; + uint16_t mtu; }; #define SCO_CONNINFO 0x02 struct sco_conninfo { - uint16_t hci_handle; + uint16_t hci_handle; + uint8_t dev_class[3]; }; #ifdef __cplusplus -- cgit From 6c2fed4529b256285e495ccdb066de331db42ff4 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 13 Jan 2005 20:05:05 +0000 Subject: Remove deprecated functions --- include/hci_lib.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index b8dbd432..5c83b5e8 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -67,10 +67,8 @@ int hci_devba(int dev_id, bdaddr_t *bdaddr); int hci_devid(const char *str); /* deprecated: preserve compatibility */ -int hci_local_name(int dd, int len, char *name, int to); int hci_read_local_name(int dd, int len, char *name, int to); int hci_write_local_name(int dd, const char *name, int to); -int hci_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to); int hci_read_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to); int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); @@ -102,18 +100,18 @@ int hci_get_route(bdaddr_t *bdaddr); char *hci_dtypetostr(int type); char *hci_dflagstostr(uint32_t flags); char *hci_ptypetostr(unsigned int ptype); -int hci_strtoptype(char *str, unsigned int *val); +int hci_strtoptype(char *str, unsigned int *val); char *hci_scoptypetostr(unsigned int ptype); -int hci_strtoscoptype(char *str, unsigned int *val); +int hci_strtoscoptype(char *str, unsigned int *val); char *hci_lptostr(unsigned int ptype); -int hci_strtolp(char *str, unsigned int *val); +int hci_strtolp(char *str, unsigned int *val); char *hci_lmtostr(unsigned int ptype); -int hci_strtolm(char *str, unsigned int *val); +int hci_strtolm(char *str, unsigned int *val); char *hci_vertostr(unsigned int ver); -int hci_strtover(char *str, unsigned int *ver); +int hci_strtover(char *str, unsigned int *ver); char *lmp_vertostr(unsigned int ver); -int lmp_strtover(char *str, unsigned int *ver); +int lmp_strtover(char *str, unsigned int *ver); char *lmp_featurestostr(uint8_t *features, char *pref, int width); -- cgit From 32c8a21b7da2397da204015f4bf45983226cbed9 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 13 Jan 2005 20:16:40 +0000 Subject: Add function for reading the RSSI and the link quality --- include/hci.h | 6 +++--- include/hci_lib.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 683c988f..54bb8849 100644 --- a/include/hci.h +++ b/include/hci.h @@ -791,13 +791,13 @@ typedef struct { } __attribute__ ((packed)) reset_failed_contact_counter_rp; #define RESET_FAILED_CONTACT_COUNTER_RP_SIZE 4 -#define OCF_GET_LINK_QUALITY 0x0003 +#define OCF_READ_LINK_QUALITY 0x0003 typedef struct { uint8_t status; uint16_t handle; uint8_t link_quality; -} __attribute__ ((packed)) get_link_quality_rp; -#define GET_LINK_QUALITY_RP_SIZE 4 +} __attribute__ ((packed)) read_link_quality_rp; +#define READ_LINK_QUALITY_RP_SIZE 4 #define OCF_READ_RSSI 0x0005 typedef struct { diff --git a/include/hci_lib.h b/include/hci_lib.h index 5c83b5e8..969db1f2 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -92,6 +92,8 @@ int hci_write_inquiry_mode(int dd, uint8_t mode, int to); int hci_read_afh_mode(int dd, uint8_t *mode, int to); int hci_write_afh_mode(int dd, uint8_t mode, int to); int hci_set_afh_classification(int dd, uint8_t *map, int to); +int hci_read_link_quality(int dd, uint16_t handle, uint8_t *link_quality, int to); +int hci_read_rssi(int dd, uint16_t handle, int8_t *rssi, int to); int hci_read_afh_map(int dd, uint16_t handle, uint8_t *mode, uint8_t *map, int to); int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg); -- cgit From 3d400b430ca82b915570be699d98b10648c593ac Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 13 Jan 2005 22:37:58 +0000 Subject: Add link supervision timeout functions --- include/hci.h | 5 +++++ include/hci_lib.h | 2 ++ 2 files changed, 7 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 54bb8849..a5435cd1 100644 --- a/include/hci.h +++ b/include/hci.h @@ -677,6 +677,11 @@ typedef struct { uint16_t link_sup_to; } __attribute__ ((packed)) write_link_supervision_timeout_cp; #define WRITE_LINK_SUPERVISION_TIMEOUT_CP_SIZE 4 +typedef struct { + uint8_t status; + uint16_t handle; +} __attribute__ ((packed)) write_link_supervision_timeout_rp; +#define WRITE_LINK_SUPERVISION_TIMEOUT_RP_SIZE 3 #define MAX_IAC_LAP 0x40 #define OCF_READ_CURRENT_IAC_LAP 0x0039 diff --git a/include/hci_lib.h b/include/hci_lib.h index 969db1f2..2edc9e0e 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -91,6 +91,8 @@ int hci_read_inquiry_mode(int dd, uint8_t *mode, int to); int hci_write_inquiry_mode(int dd, uint8_t mode, int to); int hci_read_afh_mode(int dd, uint8_t *mode, int to); int hci_write_afh_mode(int dd, uint8_t mode, int to); +int hci_read_link_supervision_timeout(int dd, uint16_t handle, uint16_t *timeout, int to); +int hci_write_link_supervision_timeout(int dd, uint16_t handle, uint16_t timeout, int to); int hci_set_afh_classification(int dd, uint8_t *map, int to); int hci_read_link_quality(int dd, uint16_t handle, uint8_t *link_quality, int to); int hci_read_rssi(int dd, uint16_t handle, int8_t *rssi, int to); -- cgit From ef8d27c6202740ad13ec702f6a29a1a71be5acc4 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 13 Jan 2005 22:38:50 +0000 Subject: Remove comments --- include/hci_lib.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index 2edc9e0e..7e6acfaf 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -66,7 +66,6 @@ int hci_devinfo(int dev_id, struct hci_dev_info *di); int hci_devba(int dev_id, bdaddr_t *bdaddr); int hci_devid(const char *str); -/* deprecated: preserve compatibility */ int hci_read_local_name(int dd, int len, char *name, int to); int hci_write_local_name(int dd, const char *name, int to); int hci_read_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to); @@ -83,7 +82,6 @@ int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to); int hci_authenticate_link(int dd, uint16_t handle, int to); int hci_encrypt_link(int dd, uint16_t handle, uint8_t encrypt, int to); int hci_change_link_key(int dd, uint16_t handle, int to); -/* role == 0 is master, 1 is slave */ int hci_switch_role(int dd, bdaddr_t *bdaddr, uint8_t role, int to); int hci_park_mode(int dd, uint16_t handle, uint16_t max_interval, uint16_t min_interval, int to); int hci_exit_park_mode(int dd, uint16_t handle, int to); -- cgit From 84cc44acd712f84ff544b7e1b96d1410c732dc8c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 13 Jan 2005 22:57:36 +0000 Subject: Add function for reading the transmit power level --- include/hci_lib.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index 7e6acfaf..3c44bd8a 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -89,6 +89,7 @@ int hci_read_inquiry_mode(int dd, uint8_t *mode, int to); int hci_write_inquiry_mode(int dd, uint8_t mode, int to); int hci_read_afh_mode(int dd, uint8_t *mode, int to); int hci_write_afh_mode(int dd, uint8_t mode, int to); +int hci_read_transmit_power_level(int dd, uint16_t handle, uint8_t type, uint8_t *level, int to); int hci_read_link_supervision_timeout(int dd, uint16_t handle, uint16_t *timeout, int to); int hci_write_link_supervision_timeout(int dd, uint16_t handle, uint16_t timeout, int to); int hci_set_afh_classification(int dd, uint8_t *map, int to); -- cgit From ef5f2b1b3adbc8509dc47a4c53f31e6e9f867d0b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 20 Jan 2005 18:14:19 +0000 Subject: Use better way for unaligned access --- include/bluetooth.h | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index 80a2d169..142f6064 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -88,17 +88,21 @@ enum { #endif /* Bluetooth unaligned access */ -#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__s390__) || defined(__cris__) -#define bt_get_unaligned(ptr) (*(ptr)) -#define bt_put_unaligned(val, ptr) ((void)( *(ptr) = (val) )) -#else -#define bt_get_unaligned(ptr) \ - ({ __typeof__(*(ptr)) __tmp; memmove(&__tmp, (ptr), sizeof(*(ptr))); __tmp; }) -#define bt_put_unaligned(val, ptr) \ - ({ __typeof__(*(ptr)) __tmp = (val); \ - memmove((ptr), &__tmp, sizeof(*(ptr))); \ - (void)0; }) -#endif +#define bt_get_unaligned(ptr) \ +({ \ + struct __attribute__((packed)) { \ + typeof(*(ptr)) __v; \ + } *__p = (ptr); \ + __p->__v; \ +}) + +#define bt_put_unaligned(val, ptr) \ +do { \ + struct __attribute__((packed)) { \ + typeof(*(ptr)) __v; \ + } *__p = (ptr); \ + __p->__v = (val); \ +} while(0) /* BD Address */ typedef struct { -- cgit From badafc6e227a175022370017008f0d839ec90b25 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 23 Jan 2005 08:10:42 +0000 Subject: Add functions hci_{local|remote}_name() --- include/hci_lib.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index 3c44bd8a..f6259f51 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -97,6 +97,9 @@ int hci_read_link_quality(int dd, uint16_t handle, uint8_t *link_quality, int to int hci_read_rssi(int dd, uint16_t handle, int8_t *rssi, int to); int hci_read_afh_map(int dd, uint16_t handle, uint8_t *mode, uint8_t *map, int to); +int hci_local_name(int dd, int len, char *name, int to); +int hci_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to); + int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg); int hci_get_route(bdaddr_t *bdaddr); -- cgit From 43e67213704bfbc638eec70a87001f7c69c33447 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 23 Jan 2005 14:35:11 +0000 Subject: Remove sdp_{get|put}_unaligned definition --- include/sdp_internal.h | 97 -------------------------------------------------- 1 file changed, 97 deletions(-) (limited to 'include') diff --git a/include/sdp_internal.h b/include/sdp_internal.h index 5d6ed7f9..2e0e343b 100644 --- a/include/sdp_internal.h +++ b/include/sdp_internal.h @@ -55,103 +55,6 @@ extern "C" { #define SDP_UUID_SEQ_SIZE 256 #define SDP_MAX_ATTR_LEN 65535 -/* - * SDP unaligned access. - * based on linux/asm-/unaligned.h - */ -#if defined(__i386__) - -#define sdp_get_unaligned(ptr) (*(ptr)) -#define sdp_put_unaligned(val, ptr) ((void)( *(ptr) = (val) )) - -#else - -struct __una_u64 { uint64_t x; } __attribute__((packed)); -struct __una_u32 { uint32_t x; } __attribute__((packed)); -struct __una_u16 { uint16_t x; } __attribute__((packed)); - -static inline unsigned long long __uldq(const unsigned long *r11) -{ - const struct __una_u64 *ptr = (const struct __una_u64 *) r11; - return ptr->x; -} - -static inline unsigned long __uldl(const unsigned int * r11) -{ - const struct __una_u32 *ptr = (const struct __una_u32 *) r11; - return ptr->x; -} - -static inline unsigned long __uldw(const unsigned short * r11) -{ - const struct __una_u16 *ptr = (const struct __una_u16 *) r11; - return ptr->x; -} - -static inline void __ustq(unsigned long r5, unsigned long * r11) -{ - struct __una_u64 *ptr = (struct __una_u64 *) r11; - ptr->x = r5; -} - -static inline void __ustl(unsigned long r5, unsigned int * r11) -{ - struct __una_u32 *ptr = (struct __una_u32 *) r11; - ptr->x = r5; -} - -static inline void __ustw(unsigned long r5, unsigned short * r11) -{ - struct __una_u16 *ptr = (struct __una_u16 *) r11; - ptr->x = r5; -} - -static inline unsigned long long __sdp_get_unaligned(const void *ptr, size_t size) -{ - unsigned long long val = 0; - switch (size) { - case 1: - val = *(const unsigned char *)ptr; - break; - case 2: - val = __uldw((const unsigned short *)ptr); - break; - case 4: - val = __uldl((const unsigned int *)ptr); - break; - case 8: - val = __uldq((const unsigned long *)ptr); - break; - } - return val; -} - -static inline void __sdp_put_unaligned(unsigned long val, void *ptr, size_t size) -{ - switch (size) { - case 1: - *(unsigned char *)ptr = (val); - break; - case 2: - __ustw(val, (unsigned short *)ptr); - break; - case 4: - __ustl(val, (unsigned int *)ptr); - break; - case 8: - __ustq(val, (unsigned long *)ptr); - break; - } -} - -#define sdp_get_unaligned(ptr) \ - ((__typeof__(*(ptr)))__sdp_get_unaligned((ptr), sizeof(*(ptr)))) - -#define sdp_put_unaligned(x,ptr) \ - __sdp_put_unaligned((unsigned long)(x), (ptr), sizeof(*(ptr))) - -#endif - #if __BYTE_ORDER == __BIG_ENDIAN #define ntoh64(x) x static inline void ntoh128(uint128_t *src, uint128_t *dst) -- cgit From b4790da2d46a5f39d0fdc7fd836ec23b1b483f7e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 23 Jan 2005 14:36:19 +0000 Subject: Fixup the unaligned access --- include/bluetooth.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index 142f6064..86d3f1d2 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -92,7 +92,7 @@ enum { ({ \ struct __attribute__((packed)) { \ typeof(*(ptr)) __v; \ - } *__p = (ptr); \ + } *__p = (void *) (ptr); \ __p->__v; \ }) @@ -100,7 +100,7 @@ enum { do { \ struct __attribute__((packed)) { \ typeof(*(ptr)) __v; \ - } *__p = (ptr); \ + } *__p = (void *) (ptr); \ __p->__v = (val); \ } while(0) -- cgit From 654f832d98530b05dc7ffaefff5950a32de76b3c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 23 Jan 2005 22:49:48 +0000 Subject: Remove sdp_internal.h --- include/Makefile.am | 2 -- include/sdp_internal.h | 91 -------------------------------------------------- 2 files changed, 93 deletions(-) delete mode 100644 include/sdp_internal.h (limited to 'include') diff --git a/include/Makefile.am b/include/Makefile.am index 4ac8aada..5710846d 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -8,8 +8,6 @@ include_HEADERS = \ bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h \ l2cap.h sco.h rfcomm.h sdp.h sdp_lib.h bnep.h cmtp.h hidp.h -noinst_HEADERS = sdp_internal.h - MAINTAINERCLEANFILES = Makefile.in all-local: diff --git a/include/sdp_internal.h b/include/sdp_internal.h deleted file mode 100644 index 2e0e343b..00000000 --- a/include/sdp_internal.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2001-2002 Nokia Corporation - * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann - * Copyright (C) 2002-2003 Stephen Crane - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. - * - * - * $Id$ - */ - -#ifndef __SDP_INTERNAL_H -#define __SDP_INTERNAL_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include -#include - -#define SDPINF(fmt, arg...) syslog(LOG_INFO, fmt "\n", ## arg) -#define SDPERR(fmt, arg...) syslog(LOG_ERR, "%s: " fmt "\n", __func__ , ## arg) - -#ifdef SDP_DEBUG -#define SDPDBG(fmt, arg...) syslog(LOG_DEBUG, "%s: " fmt "\n", __func__ , ## arg) -#else -#define SDPDBG(fmt...) -#endif - -#define SDP_BASIC_ATTR_PDUFORM_SIZE 32 -#define SDP_SEQ_PDUFORM_SIZE 128 -#define SDP_UUID_SEQ_SIZE 256 -#define SDP_MAX_ATTR_LEN 65535 - -#if __BYTE_ORDER == __BIG_ENDIAN -#define ntoh64(x) x -static inline void ntoh128(uint128_t *src, uint128_t *dst) -{ - int i; - for (i = 0; i < 16; i++) - dst->data[i] = src->data[i]; -} -#else -static inline uint64_t ntoh64(uint64_t n) -{ - uint64_t h; - uint64_t tmp = ntohl(n & 0x00000000ffffffff); - h = ntohl(n >> 32); - h |= tmp << 32; - return h; -} - -static inline void ntoh128(uint128_t *src, uint128_t *dst) -{ - int i; - for (i = 0; i < 16; i++) - dst->data[15 - i] = src->data[i]; -} -#endif - -#define hton64(x) ntoh64(x) -#define hton128(x,y) ntoh128(x,y) - -#ifdef __cplusplus -} -#endif - -#endif /* __SDP_INTERNAL_H */ -- cgit From 1e2dec5679c175fc52d2e19ebe06b9e1a7b05461 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 25 Jan 2005 21:36:28 +0000 Subject: Add hci_read_clock() function --- include/hci.h | 14 ++++++++++++++ include/hci_lib.h | 1 + 2 files changed, 15 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index a5435cd1..640e22da 100644 --- a/include/hci.h +++ b/include/hci.h @@ -821,6 +821,20 @@ typedef struct { } __attribute__ ((packed)) read_afh_map_rp; #define READ_AFH_MAP_RP_SIZE 14 +#define OCF_READ_CLOCK 0x0007 +typedef struct { + uint16_t handle; + uint8_t which_clock; +} __attribute__ ((packed)) read_clock_cp; +#define READ_CLOCK_CP_SIZE 3 +typedef struct { + uint8_t status; + uint16_t handle; + uint32_t clock; + uint16_t accuracy; +} __attribute__ ((packed)) read_clock_rp; +#define READ_CLOCK_RP_SIZE 9 + /* Testing commands */ #define OGF_TESTING_CMD 0x3e diff --git a/include/hci_lib.h b/include/hci_lib.h index f6259f51..ed7ad291 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -96,6 +96,7 @@ int hci_set_afh_classification(int dd, uint8_t *map, int to); int hci_read_link_quality(int dd, uint16_t handle, uint8_t *link_quality, int to); int hci_read_rssi(int dd, uint16_t handle, int8_t *rssi, int to); int hci_read_afh_map(int dd, uint16_t handle, uint8_t *mode, uint8_t *map, int to); +int hci_read_clock(int dd, uint16_t handle, uint8_t which, uint32_t *clock, uint16_t *accuracy, int to); int hci_local_name(int dd, int len, char *name, int to); int hci_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to); -- cgit From f1d23ac858b0593afe27e6b8e00a55d92804a6bb Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 29 Jan 2005 03:08:19 +0000 Subject: Update the copyright year --- include/bluetooth.h | 2 +- include/bnep.h | 2 +- include/cmtp.h | 2 +- include/hci.h | 2 +- include/hci_lib.h | 2 +- include/hci_uart.h | 2 +- include/hci_vhci.h | 2 +- include/hidp.h | 2 +- include/l2cap.h | 2 +- include/rfcomm.h | 2 +- include/sco.h | 2 +- include/sdp.h | 2 +- include/sdp_lib.h | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index 86d3f1d2..a005c1c7 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/bnep.h b/include/bnep.h index 05ecbfed..88b922bc 100644 --- a/include/bnep.h +++ b/include/bnep.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/cmtp.h b/include/cmtp.h index 3f8e943c..ae987da0 100644 --- a/include/cmtp.h +++ b/include/cmtp.h @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hci.h b/include/hci.h index 640e22da..d2efb5fe 100644 --- a/include/hci.h +++ b/include/hci.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hci_lib.h b/include/hci_lib.h index ed7ad291..7c53f0ed 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hci_uart.h b/include/hci_uart.h index 0cc97794..c7575586 100644 --- a/include/hci_uart.h +++ b/include/hci_uart.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hci_vhci.h b/include/hci_vhci.h index 1f5c0efe..88f86562 100644 --- a/include/hci_vhci.h +++ b/include/hci_vhci.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hidp.h b/include/hidp.h index 7f27fde1..e485eeea 100644 --- a/include/hidp.h +++ b/include/hidp.h @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2003-2004 Marcel Holtmann + * Copyright (C) 2003-2005 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/l2cap.h b/include/l2cap.h index 7029c32c..1425ab6a 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/rfcomm.h b/include/rfcomm.h index d4cfc056..2a1263d6 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/sco.h b/include/sco.h index 09ab395e..d07b0153 100644 --- a/include/sco.h +++ b/include/sco.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/sdp.h b/include/sdp.h index 7cb11bd8..7f8ff538 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -4,7 +4,7 @@ * * Copyright (C) 2001-2002 Nokia Corporation * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * Copyright (C) 2002-2003 Stephen Crane * * diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 0fa7cb7a..53c74d3f 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -4,7 +4,7 @@ * * Copyright (C) 2001-2002 Nokia Corporation * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * Copyright (C) 2002-2003 Stephen Crane * * -- cgit From e6589c0f2a6d1dd3060a86a27d859c8fb08bf278 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 29 Jan 2005 03:24:48 +0000 Subject: Add functions for reading the BD_ADDR and the features --- include/hci.h | 3 +++ include/hci_lib.h | 2 ++ 2 files changed, 5 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index d2efb5fe..6e41642b 100644 --- a/include/hci.h +++ b/include/hci.h @@ -762,6 +762,7 @@ typedef struct { uint8_t status; uint8_t features[8]; } __attribute__ ((packed)) read_local_features_rp; +#define READ_LOCAL_FEATURES_RP_SIZE 9 #define OCF_READ_BUFFER_SIZE 0x0005 typedef struct { @@ -771,12 +772,14 @@ typedef struct { uint16_t acl_max_pkt; uint16_t sco_max_pkt; } __attribute__ ((packed)) read_buffer_size_rp; +#define READ_BUFFER_SIZE_RP_SIZE 8 #define OCF_READ_BD_ADDR 0x0009 typedef struct { uint8_t status; bdaddr_t bdaddr; } __attribute__ ((packed)) read_bd_addr_rp; +#define READ_BD_ADDR_RP_SIZE 7 /* Status params */ #define OGF_STATUS_PARAM 0x05 diff --git a/include/hci_lib.h b/include/hci_lib.h index 7c53f0ed..1e5ecc96 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -73,6 +73,8 @@ int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to) int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); int hci_read_clock_offset(int dd, uint16_t handle, uint16_t *clkoffset, int to); int hci_read_local_version(int dd, struct hci_version *ver, int to); +int hci_read_local_features(int dd, uint8_t *features, int to); +int hci_read_bd_addr(int dd, bdaddr_t *bdaddr, int to); int hci_read_class_of_dev(int dd, uint8_t *cls, int to); int hci_write_class_of_dev(int dd, uint32_t cls, int to); int hci_read_voice_setting(int dd, uint16_t *vs, int to); -- cgit From c608311e7472325514f0578a20d59efc86792e39 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 11 Feb 2005 04:17:16 +0000 Subject: Add function for getting the remote name with a clock offset --- include/hci_lib.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index 1e5ecc96..e2f06fda 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -69,6 +69,7 @@ int hci_devid(const char *str); int hci_read_local_name(int dd, int len, char *name, int to); int hci_write_local_name(int dd, const char *name, int to); int hci_read_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to); +int hci_read_remote_name_with_clock_offset(int dd, const bdaddr_t *bdaddr, uint16_t clkoffset, int len, char *name, int to); int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); int hci_read_clock_offset(int dd, uint16_t handle, uint16_t *clkoffset, int to); -- cgit From ce742d95634d8a666a0f4df610c8eac4419d7716 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 22 Feb 2005 02:36:27 +0000 Subject: Fix IAC support --- include/hci.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 6e41642b..4ffa34fc 100644 --- a/include/hci.h +++ b/include/hci.h @@ -688,14 +688,14 @@ typedef struct { typedef struct { uint8_t status; uint8_t num_current_iac; - uint8_t lap[3][MAX_IAC_LAP]; + uint8_t lap[MAX_IAC_LAP][3]; } __attribute__ ((packed)) read_current_iac_lap_rp; #define READ_CURRENT_IAC_LAP_RP_SIZE 2+3*MAX_IAC_LAP #define OCF_WRITE_CURRENT_IAC_LAP 0x003A typedef struct { uint8_t num_current_iac; - uint8_t lap[3][MAX_IAC_LAP]; + uint8_t lap[MAX_IAC_LAP][3]; } __attribute__ ((packed)) write_current_iac_lap_cp; #define WRITE_CURRENT_IAC_LAP_CP_SIZE 1+3*MAX_IAC_LAP -- cgit From db01d7596aa2ba2e40df5d3c7ef9b7cd0489ecad Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 22 Feb 2005 02:37:49 +0000 Subject: The transmit power level is a signed integer --- include/hci_lib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index e2f06fda..d140444a 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -92,7 +92,7 @@ int hci_read_inquiry_mode(int dd, uint8_t *mode, int to); int hci_write_inquiry_mode(int dd, uint8_t mode, int to); int hci_read_afh_mode(int dd, uint8_t *mode, int to); int hci_write_afh_mode(int dd, uint8_t mode, int to); -int hci_read_transmit_power_level(int dd, uint16_t handle, uint8_t type, uint8_t *level, int to); +int hci_read_transmit_power_level(int dd, uint16_t handle, uint8_t type, int8_t *level, int to); int hci_read_link_supervision_timeout(int dd, uint16_t handle, uint16_t *timeout, int to); int hci_write_link_supervision_timeout(int dd, uint16_t handle, uint16_t timeout, int to); int hci_set_afh_classification(int dd, uint8_t *map, int to); -- cgit From 1ec0481800a50aa14afe0513f69b4c7c04d5962a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 22 Feb 2005 11:42:03 +0000 Subject: Support pscan_rep_mode for remote name request --- include/hci.h | 6 ++++++ include/hci_lib.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 4ffa34fc..b651e22d 100644 --- a/include/hci.h +++ b/include/hci.h @@ -395,6 +395,12 @@ typedef struct { } __attribute__ ((packed)) remote_name_req_cp; #define REMOTE_NAME_REQ_CP_SIZE 10 +#define OCF_REMOTE_NAME_REQ_CANCEL 0x001A +typedef struct { + bdaddr_t bdaddr; +} __attribute__ ((packed)) remote_name_req_cancel_cp; +#define REMOTE_NAME_REQ_CANCEL_CP_SIZE 6 + #define OCF_READ_REMOTE_FEATURES 0x001B typedef struct { uint16_t handle; diff --git a/include/hci_lib.h b/include/hci_lib.h index d140444a..b1ab43cd 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -69,7 +69,8 @@ int hci_devid(const char *str); int hci_read_local_name(int dd, int len, char *name, int to); int hci_write_local_name(int dd, const char *name, int to); int hci_read_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to); -int hci_read_remote_name_with_clock_offset(int dd, const bdaddr_t *bdaddr, uint16_t clkoffset, int len, char *name, int to); +int hci_read_remote_name_with_clock_offset(int dd, const bdaddr_t *bdaddr, uint8_t pscan_rep_mode, uint16_t clkoffset, int len, char *name, int to); +int hci_read_remote_name_cancel(int dd, const bdaddr_t *bdaddr, int to); int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); int hci_read_clock_offset(int dd, uint16_t handle, uint16_t *clkoffset, int to); -- cgit From 28b4f0aea5b15ed7c0acd17ab79705a38ffe7c2f Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Mon, 28 Feb 2005 12:19:25 +0000 Subject: fix incorrect doc comment --- include/sdp_lib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 53c74d3f..6a5d7d82 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -286,7 +286,7 @@ void sdp_set_url_attr(sdp_record_t *rec, const char *clientExecURL, const char * * sdp_list_t *rsp_list * This variable is set on a successful return if there are * non-zero service handles. It is a singly linked list of - * service records (sdp_record_t) + * service record handles (uint16_t) */ int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search_list, uint16_t max_rec_num, sdp_list_t **rsp_list); -- cgit From 8b11908eac4e0b4e14534ec2d44ae62806fdfd2f Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Wed, 2 Mar 2005 10:23:16 +0000 Subject: fix comments --- include/sdp_lib.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 6a5d7d82..7661d24e 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -393,7 +393,8 @@ void sdp_record_free(sdp_record_t *rec); * record first and set its attributes using setXXX() methods. * * The service provider must then call sdp_record_register() to make - * the service record visible to SDP clients. + * the service record visible to SDP clients. This function returns 0 + * on success or -1 on failure (and sets errno). */ int sdp_record_register(sdp_session_t *sess, sdp_record_t *rec, uint8_t flags); -- cgit From 9280b803576dc54bfc7f51c8e5154d1f29692991 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 27 Mar 2005 14:37:59 +0000 Subject: Add ba*printf() functions --- include/bluetooth.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index a005c1c7..d7747996 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -36,9 +36,9 @@ extern "C" { #endif #include +#include #include #include -#include #ifndef AF_BLUETOOTH #define AF_BLUETOOTH 31 @@ -129,6 +129,11 @@ char *batostr(const bdaddr_t *ba); int ba2str(const bdaddr_t *ba, char *str); int str2ba(const char *str, bdaddr_t *ba); +int baprintf(const char *format, ...); +int bafprintf(FILE *stream, const char *format, ...); +int basprintf(char *str, const char *format, ...); +int basnprintf(char *str, size_t size, const char *format, ...); + int bt_error(uint16_t code); char *bt_compidtostr(int id); -- cgit From 4c2d1cbe438713b5d6c350ee0983e1d312c69823 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 27 Mar 2005 14:43:44 +0000 Subject: Add ba2oui() function --- include/bluetooth.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index d7747996..276831ae 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -128,6 +128,7 @@ bdaddr_t *strtoba(const char *str); char *batostr(const bdaddr_t *ba); int ba2str(const bdaddr_t *ba, char *str); int str2ba(const char *str, bdaddr_t *ba); +int ba2oui(const bdaddr_t *ba, char *oui); int baprintf(const char *format, ...); int bafprintf(FILE *stream, const char *format, ...); -- cgit From 6ebd5cc786e2b2c4d0da4c69543a06e12deb7db7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 27 Mar 2005 19:16:49 +0000 Subject: Change the packet type mask --- include/hci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index b651e22d..f22a3daa 100644 --- a/include/hci.h +++ b/include/hci.h @@ -142,7 +142,7 @@ enum { #define HCI_3EV5 0x0200 #define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3) -#define ACL_PTYPE_MASK (~SCO_PTYPE_MASK) +#define ACL_PTYPE_MASK (HCI_DM1 | HCI_DH1 | HCI_DM3 | HCI_DH3 | HCI_DM5 | HCI_DM5) /* HCI Error codes */ #define HCI_UNKNOWN_COMMAND 0x01 -- cgit From 973c22b7aa5ba83bef47f2f523551ac81fb10fcb Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 27 Mar 2005 19:21:15 +0000 Subject: Fix a small typo --- include/hci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index f22a3daa..7311e169 100644 --- a/include/hci.h +++ b/include/hci.h @@ -142,7 +142,7 @@ enum { #define HCI_3EV5 0x0200 #define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3) -#define ACL_PTYPE_MASK (HCI_DM1 | HCI_DH1 | HCI_DM3 | HCI_DH3 | HCI_DM5 | HCI_DM5) +#define ACL_PTYPE_MASK (HCI_DM1 | HCI_DH1 | HCI_DM3 | HCI_DH3 | HCI_DM5 | HCI_DH5) /* HCI Error codes */ #define HCI_UNKNOWN_COMMAND 0x01 -- cgit From 2b77e2e8198e16cae6d1411c4ec65bf87d6c4dd7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 11 Apr 2005 14:37:24 +0000 Subject: Add inquiry info structure with RSSI and page scan mode --- include/hci.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 7311e169..3368121d 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1039,6 +1039,16 @@ typedef struct { int8_t rssi; } __attribute__ ((packed)) inquiry_info_with_rssi; #define INQUIRY_INFO_WITH_RSSI_SIZE 14 +typedef struct { + bdaddr_t bdaddr; + uint8_t pscan_rep_mode; + uint8_t pscan_period_mode; + uint8_t pscan_mode; + uint8_t dev_class[3]; + uint16_t clock_offset; + int8_t rssi; +} __attribute__ ((packed)) inquiry_info_with_rssi_and_pscan_mode; +#define INQUIRY_INFO_WITH_RSSI_AND_PSCAN_MODE_SIZE 15 #define EVT_TESTING 0xFE -- cgit From 9ecc944c96728a92691e02db0f01e092df92bed8 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 17 Apr 2005 20:35:47 +0000 Subject: Add definition for max slots change event --- include/hci.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 3368121d..7489c1c8 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1007,6 +1007,13 @@ typedef struct { } __attribute__ ((packed)) evt_link_key_notify; #define EVT_LINK_KEY_NOTIFY_SIZE 23 +#define EVT_MAX_SLOTS_CHANGE 0x1B +typedef struct { + uint16_t handle; + uint8_t max_slots; +} __attribute__ ((packed)) evt_max_slots_change; +#define EVT_MAX_SLOTS_CHANGE_SIZE 3 + #define EVT_READ_CLOCK_OFFSET_COMPLETE 0x1C typedef struct { uint8_t status; -- cgit From c875d7ca57c3e5bad8c8af080c7d33f85a499c07 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 17 Apr 2005 20:50:54 +0000 Subject: Add definition for page scan repetition mode change event --- include/hci.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 7489c1c8..5502e2b5 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1036,6 +1036,13 @@ typedef struct { } __attribute__ ((packed)) evt_qos_violation; #define EVT_QOS_VIOLATION_SIZE 2 +#define EVT_PSCAN_REP_MODE_CHANGE 0x20 +typedef struct { + bdaddr_t bdaddr; + uint8_t pscan_rep_mode; +} __attribute__ ((packed)) evt_pscan_rep_mode_change; +#define EVT_PSCAN_REP_MODE_CHANGE_SIZE 7 + #define EVT_INQUIRY_RESULT_WITH_RSSI 0x22 typedef struct { bdaddr_t bdaddr; -- cgit From 01aab15cf710601c93457042507b433474a78c04 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 17 Apr 2005 21:30:19 +0000 Subject: Add definition for remote extended features event --- include/hci.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 5502e2b5..3f811ffa 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1064,6 +1064,16 @@ typedef struct { } __attribute__ ((packed)) inquiry_info_with_rssi_and_pscan_mode; #define INQUIRY_INFO_WITH_RSSI_AND_PSCAN_MODE_SIZE 15 +#define EVT_READ_REMOTE_EXT_FEATURES_COMPLETE 0x23 +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t page_num; + uint8_t max_page_num; + uint8_t features[8]; +} __attribute__ ((packed)) evt_read_remote_ext_features_complete; +#define EVT_READ_REMOTE_EXT_FEATURES_COMPLETE_SIZE 13 + #define EVT_TESTING 0xFE #define EVT_VENDOR 0xFF -- cgit From 456c8fd652c0d96500adef3dd7abb067a000bc50 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 17 Apr 2005 21:45:50 +0000 Subject: Add definitions for local extended features and commands --- include/hci.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 3f811ffa..fce19b9c 100644 --- a/include/hci.h +++ b/include/hci.h @@ -407,6 +407,13 @@ typedef struct { } __attribute__ ((packed)) read_remote_features_cp; #define READ_REMOTE_FEATURES_CP_SIZE 2 +#define OCF_READ_REMOTE_EXT_FEATURES 0x001C +typedef struct { + uint16_t handle; + uint8_t page_num; +} __attribute__ ((packed)) read_remote_ext_features_cp; +#define READ_REMOTE_EXT_FEATURES_CP_SIZE 3 + #define OCF_READ_REMOTE_VERSION 0x001D typedef struct { uint16_t handle; @@ -763,6 +770,13 @@ typedef struct { } __attribute__ ((packed)) read_local_version_rp; #define READ_LOCAL_VERSION_RP_SIZE 9 +#define OCF_READ_LOCAL_COMMANDS 0x0002 +typedef struct { + uint8_t status; + uint8_t commands[64]; +} __attribute__ ((packed)) read_local_commands_rp; +#define READ_LOCAL_COMMANDS_RP_SIZE 65 + #define OCF_READ_LOCAL_FEATURES 0x0003 typedef struct { uint8_t status; @@ -770,6 +784,15 @@ typedef struct { } __attribute__ ((packed)) read_local_features_rp; #define READ_LOCAL_FEATURES_RP_SIZE 9 +#define OCF_READ_LOCAL_EXT_FEATURES 0x0004 +typedef struct { + uint8_t status; + uint8_t page_num; + uint8_t max_page_num; + uint8_t features[8]; +} __attribute__ ((packed)) read_local_ext_features_rp; +#define READ_LOCAL_EXT_FEATURES_RP_SIZE 11 + #define OCF_READ_BUFFER_SIZE 0x0005 typedef struct { uint8_t status; -- cgit From d213d431b00c0ab451257e688dfad9fb20037088 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 17 Apr 2005 22:34:04 +0000 Subject: Add definition for master link key command --- include/hci.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index fce19b9c..a0c85e74 100644 --- a/include/hci.h +++ b/include/hci.h @@ -386,6 +386,12 @@ typedef struct { } __attribute__ ((packed)) change_conn_link_key_cp; #define CHANGE_CONN_LINK_KEY_CP_SIZE 2 +#define OCF_MASTER_LINK_KEY 0x0017 +typedef struct { + uint8_t key_flag; +} __attribute__ ((packed)) master_link_key_cp; +#define MASTER_LINK_KEY_CP_SIZE 1 + #define OCF_REMOTE_NAME_REQ 0x0019 typedef struct { bdaddr_t bdaddr; @@ -785,6 +791,10 @@ typedef struct { #define READ_LOCAL_FEATURES_RP_SIZE 9 #define OCF_READ_LOCAL_EXT_FEATURES 0x0004 +typedef struct { + uint8_t page_num; +} __attribute__ ((packed)) read_local_ext_features_cp; +#define READ_LOCAL_EXT_FEATURES_CP_SIZE 1 typedef struct { uint8_t status; uint8_t page_num; -- cgit From 4582e03695aaf2f41e3d6341f9a49c383f103320 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 17 Apr 2005 22:38:24 +0000 Subject: Add definition for master link key complete event --- include/hci.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index a0c85e74..f20a64b3 100644 --- a/include/hci.h +++ b/include/hci.h @@ -954,6 +954,14 @@ typedef struct { } __attribute__ ((packed)) evt_change_conn_link_key_complete; #define EVT_CHANGE_CONN_LINK_KEY_COMPLETE_SIZE 3 +#define EVT_MASTER_LINK_KEY_COMPLETE 0x0A +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t key_flag; +} __attribute__ ((packed)) evt_master_link_key_complete; +#define EVT_MASTER_LINK_KEY_COMPLETE_SIZE 4 + #define EVT_READ_REMOTE_FEATURES_COMPLETE 0x0B typedef struct { uint8_t status; -- cgit From be2d979b6a592484862e78bed355d079f7eeb1e6 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 17 Apr 2005 23:14:52 +0000 Subject: Add funtions for reading local supported commands and extended features --- include/hci_lib.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index b1ab43cd..36347d5a 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -75,7 +75,9 @@ int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to) int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); int hci_read_clock_offset(int dd, uint16_t handle, uint16_t *clkoffset, int to); int hci_read_local_version(int dd, struct hci_version *ver, int to); +int hci_read_local_commands(int dd, uint8_t *commands, int to); int hci_read_local_features(int dd, uint8_t *features, int to); +int hci_read_local_ext_features(int dd, uint8_t page, uint8_t *max_page, uint8_t *features, int to); int hci_read_bd_addr(int dd, bdaddr_t *bdaddr, int to); int hci_read_class_of_dev(int dd, uint8_t *cls, int to); int hci_write_class_of_dev(int dd, uint32_t cls, int to); -- cgit From 0887d119a0b61e38cbd3d30e207c09eb5a5ff463 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 17 Apr 2005 23:31:54 +0000 Subject: Add function for remote extended features --- include/hci_lib.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index 36347d5a..2ffdef78 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -71,8 +71,9 @@ int hci_write_local_name(int dd, const char *name, int to); int hci_read_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to); int hci_read_remote_name_with_clock_offset(int dd, const bdaddr_t *bdaddr, uint8_t pscan_rep_mode, uint16_t clkoffset, int len, char *name, int to); int hci_read_remote_name_cancel(int dd, const bdaddr_t *bdaddr, int to); -int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); +int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); +int hci_read_remote_ext_features(int dd, uint16_t handle, uint8_t page, uint8_t *max_page, uint8_t *features, int to); int hci_read_clock_offset(int dd, uint16_t handle, uint16_t *clkoffset, int to); int hci_read_local_version(int dd, struct hci_version *ver, int to); int hci_read_local_commands(int dd, uint8_t *commands, int to); -- cgit From 8805ca9a84b178e5ae082c9a115ee55bbdae5263 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 18 Apr 2005 14:08:58 +0000 Subject: Add definitions for hardware error and flush occurred events --- include/hci.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index f20a64b3..aa0b7202 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1004,6 +1004,18 @@ typedef struct { } __attribute__ ((packed)) evt_cmd_status; #define EVT_CMD_STATUS_SIZE 4 +#define EVT_HARDWARE_ERROR 0x10 +typedef struct { + uint8_t code; +} __attribute__ ((packed)) evt_hardware_error; +#define EVT_HARDWARE_ERROR_SIZE 1 + +#define EVT_FLUSH_OCCURRED 0x11 +typedef struct { + uint16_t handle; +} __attribute__ ((packed)) evt_flush_occured; +#define EVT_FLUSH_OCCURRED_SIZE 2 + #define EVT_ROLE_CHANGE 0x12 typedef struct { uint8_t status; -- cgit From b68e3ca7a1e5f3215bfc4408c86059ed4f76f2fd Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 18 Apr 2005 14:13:33 +0000 Subject: Add definition for return link keys event --- include/hci.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index aa0b7202..9da3172f 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1040,6 +1040,13 @@ typedef struct { } __attribute__ ((packed)) evt_mode_change; #define EVT_MODE_CHANGE_SIZE 6 +#define EVT_RETURN_LINK_KEYS 0x15 +typedef struct { + uint8_t num_keys; + /* variable length part */ +} __attribute__ ((packed)) evt_return_link_keys; +#define EVT_RETURN_LINK_KEYS_SIZE 1 + #define EVT_PIN_CODE_REQ 0x16 typedef struct { bdaddr_t bdaddr; -- cgit From 845167a090206487c79d851d3989f5af188b708c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 18 Apr 2005 14:31:11 +0000 Subject: Add definitions for loopback command and data overflow events --- include/hci.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 9da3172f..8c208303 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1067,6 +1067,14 @@ typedef struct { } __attribute__ ((packed)) evt_link_key_notify; #define EVT_LINK_KEY_NOTIFY_SIZE 23 +#define EVT_LOOPBACK_COMMAND 0x19 + +#define EVT_DATA_BUFFER_OVERFLOW 0x1A +typedef struct { + uint8_t link_type; +} __attribute__ ((packed)) evt_data_buffer_overflow; +#define EVT_DATA_BUFFER_OVERFLOW_SIZE 1 + #define EVT_MAX_SLOTS_CHANGE 0x1B typedef struct { uint16_t handle; -- cgit From 788fef63f4ab0f7948726bbc4e442f4ede573285 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 18 Apr 2005 14:41:26 +0000 Subject: Add definition for flow specification complete event --- include/hci.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 8c208303..dfb866bd 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1111,6 +1111,16 @@ typedef struct { } __attribute__ ((packed)) evt_pscan_rep_mode_change; #define EVT_PSCAN_REP_MODE_CHANGE_SIZE 7 +#define EVT_FLOW_SPEC_COMPLETE 0x21 +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t flags; + uint8_t direction; + hci_qos qos; +} __attribute__ ((packed)) evt_flow_spec_complete; +#define EVT_FLOW_SPEC_COMPLETE_SIZE (5 + HCI_QOS_CP_SIZE) + #define EVT_INQUIRY_RESULT_WITH_RSSI 0x22 typedef struct { bdaddr_t bdaddr; -- cgit From ddcf94ef9f9f154b8263932a3c372894a61a2bff Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 18 Apr 2005 15:00:58 +0000 Subject: Add definitions for synchronous connection events --- include/hci.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index dfb866bd..af2e0dd1 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1152,6 +1152,31 @@ typedef struct { } __attribute__ ((packed)) evt_read_remote_ext_features_complete; #define EVT_READ_REMOTE_EXT_FEATURES_COMPLETE_SIZE 13 +#define EVT_SYNC_CONN_COMPLETE 0x2C +typedef struct { + uint8_t status; + uint16_t handle; + bdaddr_t bdaddr; + uint8_t link_type; + uint8_t trans_interval; + uint8_t retrans_window; + uint16_t rx_pkt_len; + uint16_t tx_pkt_len; + uint8_t air_mode; +} __attribute__ ((packed)) evt_sync_conn_complete; +#define EVT_SYNC_CONN_COMPLETE_SIZE 17 + +#define EVT_SYNC_CONN_CHANGED 0x2D +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t trans_interval; + uint8_t retrans_window; + uint16_t rx_pkt_len; + uint16_t tx_pkt_len; +} __attribute__ ((packed)) evt_sync_conn_changed; +#define EVT_SYNC_CONN_CHANGED_SIZE 9 + #define EVT_TESTING 0xFE #define EVT_VENDOR 0xFF -- cgit From fc64a954aa13eba73b3c24d20aac597576b0e840 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 18 Apr 2005 16:10:19 +0000 Subject: Add missing definitions for the link control commands --- include/hci.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index af2e0dd1..e13989ca 100644 --- a/include/hci.h +++ b/include/hci.h @@ -327,6 +327,12 @@ typedef struct { } __attribute__ ((packed)) add_sco_cp; #define ADD_SCO_CP_SIZE 4 +#define OCF_CREATE_CONN_CANCEL 0x0008 +typedef struct { + bdaddr_t bdaddr; +} __attribute__ ((packed)) create_conn_cancel_cp; +#define CREATE_CONN_CANCEL_CP_SIZE 6 + #define OCF_ACCEPT_CONN_REQ 0x0009 typedef struct { bdaddr_t bdaddr; @@ -432,6 +438,39 @@ typedef struct { } __attribute__ ((packed)) read_clock_offset_cp; #define READ_CLOCK_OFFSET_CP_SIZE 2 +#define OCF_READ_LMP_HANDLE 0x0020 + +#define OCF_SETUP_SYNC_CONN 0x0028 +typedef struct { + uint16_t handle; + uint32_t tx_bandwith; + uint32_t rx_bandwith; + uint16_t max_latency; + uint16_t voice_setting; + uint8_t retrans_effort; + uint16_t pkt_type; +} __attribute__ ((packed)) setup_sync_conn_cp; +#define SETUP_SYNC_CONN_CP_SIZE 17 + +#define OCF_ACCEPT_SYNC_CONN_REQ 0x0029 +typedef struct { + bdaddr_t bdaddr; + uint32_t tx_bandwith; + uint32_t rx_bandwith; + uint16_t max_latency; + uint16_t voice_setting; + uint8_t retrans_effort; + uint16_t pkt_type; +} __attribute__ ((packed)) accept_sync_conn_req_cp; +#define ACCEPT_SYNC_CONN_REQ_CP_SIZE 21 + +#define OCF_REJECT_SYNC_CONN_REQ 0x002A +typedef struct { + bdaddr_t bdaddr; + uint8_t reason; +} __attribute__ ((packed)) reject_sync_conn_req_cp; +#define REJECT_SYNC_CONN_REQ_CP_SIZE 7 + /* Link Policy */ #define OGF_LINK_POLICY 0x02 -- cgit From 7bf5fa8168f2b3da602189b962caa6fa81bb57ba Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 20 Apr 2005 12:23:13 +0000 Subject: Include stdio.h within bluetooth.h --- include/bluetooth.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index 276831ae..33d68a61 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -35,6 +35,7 @@ extern "C" { #endif +#include #include #include #include -- cgit From 18cd6ecb4eae48ffdcf6df2bbf5fd828459c6cec Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 27 Apr 2005 10:49:43 +0000 Subject: Include sys/socket.h in the header files --- include/hci.h | 2 ++ include/l2cap.h | 2 ++ include/rfcomm.h | 2 ++ 3 files changed, 6 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index e13989ca..2a7fc786 100644 --- a/include/hci.h +++ b/include/hci.h @@ -35,6 +35,8 @@ extern "C" { #endif +#include + #define HCI_MAX_DEV 16 #define HCI_MAX_ACL_SIZE 1024 diff --git a/include/l2cap.h b/include/l2cap.h index 1425ab6a..ae88c7a0 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -35,6 +35,8 @@ extern "C" { #endif +#include + /* L2CAP defaults */ #define L2CAP_DEFAULT_MTU 672 #define L2CAP_DEFAULT_FLUSH_TO 0xFFFF diff --git a/include/rfcomm.h b/include/rfcomm.h index 2a1263d6..8a1d56e9 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -34,6 +34,8 @@ extern "C" { #endif +#include + /* RFCOMM defaults */ #define RFCOMM_DEFAULT_MTU 127 -- cgit From f51d996c92192762463e69b5b68e497258588508 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 27 Apr 2005 12:01:19 +0000 Subject: Add definitions for stored link keys --- include/hci.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 2a7fc786..b797cae6 100644 --- a/include/hci.h +++ b/include/hci.h @@ -598,6 +598,43 @@ typedef struct { #define CONN_SETUP_AUTO_OFF 0x01 #define CONN_SETUP_AUTO_ON 0x02 +#define OCF_READ_STORED_LINK_KEY 0x000D +typedef struct { + bdaddr_t bdaddr; + uint8_t read_all; +} __attribute__ ((packed)) read_stored_link_key_cp; +#define READ_STORED_LINK_KEY_CP_SIZE 7 +typedef struct { + uint8_t status; + uint16_t max_keys; + uint16_t num_keys; +} __attribute__ ((packed)) read_stored_link_key_rp; +#define READ_STORED_LINK_KEY_RP_SIZE 5 + +#define OCF_WRITE_STORED_LINK_KEY 0x0011 +typedef struct { + uint8_t num_keys; + /* variable length part */ +} __attribute__ ((packed)) write_stored_link_key_cp; +#define WRITE_STORED_LINK_KEY_CP_SIZE 1 +typedef struct { + uint8_t status; + uint8_t num_keys; +} __attribute__ ((packed)) write_stored_link_key_rp; +#define READ_WRITE_LINK_KEY_RP_SIZE 2 + +#define OCF_DELETE_STORED_LINK_KEY 0x0012 +typedef struct { + bdaddr_t bdaddr; + uint8_t delete_all; +} __attribute__ ((packed)) delete_stored_link_key_cp; +#define DELETE_STORED_LINK_KEY_CP_SIZE 7 +typedef struct { + uint8_t status; + uint16_t num_keys; +} __attribute__ ((packed)) delete_stored_link_key_rp; +#define DELETE_STORED_LINK_KEY_RP_SIZE 3 + #define OCF_CHANGE_LOCAL_NAME 0x0013 typedef struct { uint8_t name[248]; -- cgit From 48954bd49fdd7189bb725038801f3ca0ff2f4d12 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 1 May 2005 14:52:53 +0000 Subject: Add functions for stored link keys --- include/hci_lib.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index 2ffdef78..7761bb99 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -86,6 +86,9 @@ int hci_read_voice_setting(int dd, uint16_t *vs, int to); int hci_write_voice_setting(int dd, uint16_t vs, int to); int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to); int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to); +int hci_read_stored_link_key(int dd, bdaddr_t *bdaddr, uint8_t all, int to); +int hci_write_stored_link_key(int dd, bdaddr_t *bdaddr, uint8_t *key, int to); +int hci_delete_stored_link_key(int dd, bdaddr_t *bdaddr, uint8_t all, int to); int hci_authenticate_link(int dd, uint16_t handle, int to); int hci_encrypt_link(int dd, uint16_t handle, uint8_t encrypt, int to); int hci_change_link_key(int dd, uint16_t handle, int to); -- cgit From a28f053fed22e73e57c701d146983e1fcd0dcac3 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 8 May 2005 12:24:54 +0000 Subject: Add definitions for reading/writing the PIN type and creating the unit key --- include/hci.h | 43 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index b797cae6..86ffe8c9 100644 --- a/include/hci.h +++ b/include/hci.h @@ -576,6 +576,12 @@ typedef struct { /* Host Controller and Baseband */ #define OGF_HOST_CTL 0x03 +#define OCF_SET_EVENT_MASK 0x0001 +typedef struct { + uint8_t mask[8]; +} __attribute__ ((packed)) set_event_mask_cp; +#define SET_EVENT_MASK_CP_SIZE 8 + #define OCF_RESET 0x0003 #define OCF_SET_EVENT_FLT 0x0005 @@ -587,16 +593,37 @@ typedef struct { #define SET_EVENT_FLT_CP_SIZE 2 /* Filter types */ -#define FLT_CLEAR_ALL 0x00 -#define FLT_INQ_RESULT 0x01 -#define FLT_CONN_SETUP 0x02 +#define FLT_CLEAR_ALL 0x00 +#define FLT_INQ_RESULT 0x01 +#define FLT_CONN_SETUP 0x02 +/* INQ_RESULT Condition types */ +#define INQ_RESULT_RETURN_ALL 0x00 +#define INQ_RESULT_RETURN_CLASS 0x01 +#define INQ_RESULT_RETURN_BDADDR 0x02 /* CONN_SETUP Condition types */ -#define CONN_SETUP_ALLOW_ALL 0x00 -#define CONN_SETUP_ALLOW_CLASS 0x01 -#define CONN_SETUP_ALLOW_BDADDR 0x02 +#define CONN_SETUP_ALLOW_ALL 0x00 +#define CONN_SETUP_ALLOW_CLASS 0x01 +#define CONN_SETUP_ALLOW_BDADDR 0x02 /* CONN_SETUP Conditions */ -#define CONN_SETUP_AUTO_OFF 0x01 -#define CONN_SETUP_AUTO_ON 0x02 +#define CONN_SETUP_AUTO_OFF 0x01 +#define CONN_SETUP_AUTO_ON 0x02 + +#define OCF_FLUSH 0x0008 + +#define OCF_READ_PIN_TYPE 0x0009 +typedef struct { + uint8_t status; + uint8_t pin_type; +} __attribute__ ((packed)) read_pin_type_rp; +#define READ_PIN_TYPE_RP_SIZE 2 + +#define OCF_WRITE_PIN_TYPE 0x000A +typedef struct { + uint8_t pin_type; +} __attribute__ ((packed)) write_pin_type_cp; +#define WRITE_PIN_TYPE_CP_SIZE 1 + +#define OCF_CREATE_NEW_UNIT_KEY 0x000B #define OCF_READ_STORED_LINK_KEY 0x000D typedef struct { -- cgit From 0a2a889c91f9b671b7c31bcb6e4e53daf306fb7e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 8 May 2005 17:18:18 +0000 Subject: Add SDP_WAIT_ON_CLOSE flag for sdp_connect() --- include/sdp.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/sdp.h b/include/sdp.h index 7f8ff538..640cac27 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -376,6 +376,7 @@ extern "C" { * Values of the flags parameter to sdp_connect */ #define SDP_RETRY_IF_BUSY 0x01 +#define SDP_WAIT_ON_CLOSE 0x02 /* * SDP Error codes -- cgit From f38a7523b3e2ec2109cd5c5f65803da5a354da03 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 16 Jun 2005 13:53:08 +0000 Subject: Add support for reading and writing the inquiry scan type --- include/hci.h | 17 +++++++++++++++++ include/hci_lib.h | 2 ++ 2 files changed, 19 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 86ffe8c9..b6275196 100644 --- a/include/hci.h +++ b/include/hci.h @@ -833,6 +833,23 @@ typedef struct { } __attribute__ ((packed)) set_afh_classification_rp; #define SET_AFH_CLASSIFICATION_RP_SIZE 1 +#define OCF_READ_INQUIRY_SCAN_TYPE 0x0042 +typedef struct { + uint8_t status; + uint8_t type; +} __attribute__ ((packed)) read_inquiry_scan_type_rp; +#define READ_INQUIRY_SCAN_TYPE_RP_SIZE 2 + +#define OCF_WRITE_INQUIRY_SCAN_TYPE 0x0043 +typedef struct { + uint8_t type; +} __attribute__ ((packed)) write_inquiry_scan_type_cp; +#define WRITE_INQUIRY_SCAN_TYPE_CP_SIZE 1 +typedef struct { + uint8_t status; +} __attribute__ ((packed)) write_inquiry_scan_type_rp; +#define WRITE_INQUIRY_SCAN_TYPE_RP_SIZE 1 + #define OCF_READ_INQUIRY_MODE 0x0044 typedef struct { uint8_t status; diff --git a/include/hci_lib.h b/include/hci_lib.h index 7761bb99..eac144e7 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -95,6 +95,8 @@ int hci_change_link_key(int dd, uint16_t handle, int to); int hci_switch_role(int dd, bdaddr_t *bdaddr, uint8_t role, int to); int hci_park_mode(int dd, uint16_t handle, uint16_t max_interval, uint16_t min_interval, int to); int hci_exit_park_mode(int dd, uint16_t handle, int to); +int hci_read_inquiry_scan_type(int dd, uint8_t *type, int to); +int hci_write_inquiry_scan_type(int dd, uint8_t type, int to); int hci_read_inquiry_mode(int dd, uint8_t *mode, int to); int hci_write_inquiry_mode(int dd, uint8_t mode, int to); int hci_read_afh_mode(int dd, uint8_t *mode, int to); -- cgit From ef13270022a9ac069ef907f36feee499c682356b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 17 Jun 2005 11:48:17 +0000 Subject: Add definitions for connection accept timeout and scan enable --- include/hci.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index b6275196..29518dbb 100644 --- a/include/hci.h +++ b/include/hci.h @@ -675,8 +675,18 @@ typedef struct { } __attribute__ ((packed)) read_local_name_rp; #define READ_LOCAL_NAME_RP_SIZE 249 -#define OCF_WRITE_CA_TIMEOUT 0x0016 -#define OCF_WRITE_PG_TIMEOUT 0x0018 +#define OCF_READ_CONN_ACCEPT_TIMEOUT 0x0015 +typedef struct { + uint8_t status; + uint16_t timeout; +} __attribute__ ((packed)) read_conn_accept_timeout_rp; +#define READ_CONN_ACCEPT_TIMEOUT_RP_SIZE 3 + +#define OCF_WRITE_CONN_ACCEPT_TIMEOUT 0x0016 +typedef struct { + uint16_t timeout; +} __attribute__ ((packed)) write_conn_accept_timeout_cp; +#define WRITE_CONN_ACCEPT_TIMEOUT_CP_SIZE 2 #define OCF_READ_PAGE_TIMEOUT 0x0017 typedef struct { @@ -691,6 +701,13 @@ typedef struct { } __attribute__ ((packed)) write_page_timeout_cp; #define WRITE_PAGE_TIMEOUT_CP_SIZE 2 +#define OCF_READ_SCAN_ENABLE 0x0019 +typedef struct { + uint8_t status; + uint8_t enable; +} __attribute__ ((packed)) read_scan_enable_rp; +#define READ_SCAN_ENABLE_RP_SIZE 2 + #define OCF_WRITE_SCAN_ENABLE 0x001A #define SCAN_DISABLED 0x00 #define SCAN_INQUIRY 0x01 -- cgit From 631f20f4f87398b68b658acc3c374c6b36c1b7eb Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 21 Jun 2005 16:40:29 +0000 Subject: Fix some errno usages --- include/hci_lib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index eac144e7..4bfc5197 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -113,7 +113,7 @@ int hci_read_clock(int dd, uint16_t handle, uint8_t which, uint32_t *clock, uint int hci_local_name(int dd, int len, char *name, int to); int hci_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to); -int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg); +int hci_for_each_dev(int flag, int(*func)(int dd, int dev_id, long arg), long arg); int hci_get_route(bdaddr_t *bdaddr); char *hci_dtypetostr(int type); -- cgit From ba65f7a41c24a3161cceec9a55ed363dc835365d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 21 Jun 2005 16:43:47 +0000 Subject: Remove hci_vhci.h header file --- include/Makefile.am | 4 ++-- include/hci_vhci.h | 44 -------------------------------------------- 2 files changed, 2 insertions(+), 46 deletions(-) delete mode 100644 include/hci_vhci.h (limited to 'include') diff --git a/include/Makefile.am b/include/Makefile.am index 5710846d..c8a4973e 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -5,8 +5,8 @@ includedir = @includedir@/bluetooth include_HEADERS = \ - bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h \ - l2cap.h sco.h rfcomm.h sdp.h sdp_lib.h bnep.h cmtp.h hidp.h + bluetooth.h hci.h hci_lib.h hci_uart.h sco.h \ + l2cap.h rfcomm.h sdp.h sdp_lib.h bnep.h cmtp.h hidp.h MAINTAINERCLEANFILES = Makefile.in diff --git a/include/hci_vhci.h b/include/hci_vhci.h deleted file mode 100644 index 88f86562..00000000 --- a/include/hci_vhci.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2005 Marcel Holtmann - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. - * - * - * $Id$ - */ - -#ifndef __HCI_VHCI_H -#define __HCI_VHCI_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define VHCI_DEV "/dev/vhci" -#define VHCI_MINOR 250 - -#ifdef __cplusplus -} -#endif - -#endif /* __HCI_VHCI_H */ -- cgit From 654718757db545ba3e0317d1588595cd486c3436 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 21 Jun 2005 16:47:29 +0000 Subject: Remove hci_uart.h header file --- include/Makefile.am | 4 ++-- include/hci_uart.h | 55 ----------------------------------------------------- 2 files changed, 2 insertions(+), 57 deletions(-) delete mode 100644 include/hci_uart.h (limited to 'include') diff --git a/include/Makefile.am b/include/Makefile.am index c8a4973e..ab67cf59 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -5,8 +5,8 @@ includedir = @includedir@/bluetooth include_HEADERS = \ - bluetooth.h hci.h hci_lib.h hci_uart.h sco.h \ - l2cap.h rfcomm.h sdp.h sdp_lib.h bnep.h cmtp.h hidp.h + bluetooth.h hci.h hci_lib.h sco.h l2cap.h \ + sdp.h sdp_lib.h rfcomm.h bnep.h cmtp.h hidp.h MAINTAINERCLEANFILES = Makefile.in diff --git a/include/hci_uart.h b/include/hci_uart.h deleted file mode 100644 index c7575586..00000000 --- a/include/hci_uart.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2005 Marcel Holtmann - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. - * - * - * $Id$ - */ - -#ifndef __HCI_UART_H -#define __HCI_UART_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef N_HCI -#define N_HCI 15 -#endif - -/* Ioctls */ -#define HCIUARTSETPROTO _IOW('U', 200, int) -#define HCIUARTGETPROTO _IOR('U', 201, int) - -/* UART protocols */ -#define HCI_UART_H4 0 -#define HCI_UART_BCSP 1 -#define HCI_UART_3WIRE 2 -#define HCI_UART_H4DS 3 - -#ifdef __cplusplus -} -#endif - -#endif /* __HCI_UART_H */ -- cgit From cfa3a02e2593bd72ce4a83f521e1e89a5874ea7d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 6 Jul 2005 00:12:25 +0000 Subject: Fix more GCC 4.0 warnings --- include/sdp.h | 8 ++++---- include/sdp_lib.h | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/sdp.h b/include/sdp.h index 640cac27..f08a7ddb 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -401,7 +401,7 @@ typedef struct { * Should the type of any of these change, you need only make a change here. */ typedef struct { - char data[16]; + uint8_t data[16]; } uint128_t; typedef struct { @@ -454,9 +454,9 @@ typedef struct { } sdp_version_t; typedef struct { - char *data; - int data_size; - int buf_size; + uint8_t *data; + uint32_t data_size; + uint32_t buf_size; } sdp_buf_t; typedef struct { diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 7661d24e..b4e83fe3 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -424,7 +424,7 @@ uuid_t *sdp_uuid_to_uuid128(uuid_t *uuid); void sdp_uuid16_to_uuid128(uuid_t *uuid128, uuid_t *uuid16); int sdp_uuid128_to_uuid(uuid_t *uuid); int sdp_uuid_to_proto(uuid_t *uuid); -int sdp_uuid_extract(const char *buffer, uuid_t *uuid, int *scanned); +int sdp_uuid_extract(const uint8_t *buffer, uuid_t *uuid, int *scanned); void sdp_uuid_print(const uuid_t *uuid); #define MAX_LEN_UUID_STR 37 @@ -538,30 +538,30 @@ static inline uint16_t sdp_gen_tid(sdp_session_t *session) return session->tid++; } -sdp_record_t *sdp_extract_pdu(const char *pdata, int *scanned); -sdp_data_t *sdp_extract_string(char *, int *); +sdp_record_t *sdp_extract_pdu(const uint8_t *pdata, int *scanned); +sdp_data_t *sdp_extract_string(uint8_t *, int *); void sdp_data_print(sdp_data_t *data); void sdp_print_service_attr(sdp_list_t *alist); int sdp_attrid_comp_func(const void *key1, const void *key2); -void sdp_set_seq_len(char *ptr, int length); +void sdp_set_seq_len(uint8_t *ptr, uint32_t length); void sdp_set_attrid(sdp_buf_t *pdu, uint16_t id); void sdp_append_to_pdu(sdp_buf_t *dst, sdp_data_t *d); -void sdp_append_to_buf(sdp_buf_t *dst, char *data, int len); +void sdp_append_to_buf(sdp_buf_t *dst, uint8_t *data, uint32_t len); int sdp_gen_pdu(sdp_buf_t *pdu, sdp_data_t *data); int sdp_gen_record_pdu(const sdp_record_t *rec, sdp_buf_t *pdu); -int sdp_extract_seqtype(const char *buf, uint8_t *dtdp, int *seqlen); +int sdp_extract_seqtype(const uint8_t *buf, uint8_t *dtdp, int *seqlen); -sdp_data_t *sdp_extract_attr(const char *pdata, int *extractedLength, sdp_record_t *rec); +sdp_data_t *sdp_extract_attr(const uint8_t *pdata, int *extractedLength, sdp_record_t *rec); void sdp_pattern_add_uuid(sdp_record_t *rec, uuid_t *uuid); void sdp_pattern_add_uuidseq(sdp_record_t *rec, sdp_list_t *seq); -int sdp_send_req_w4_rsp(sdp_session_t *session, char *req, char *rsp, int reqsize, int *rspsize); +int sdp_send_req_w4_rsp(sdp_session_t *session, uint8_t *req, uint8_t *rsp, uint32_t reqsize, uint32_t *rspsize); typedef struct { uint8_t length; -- cgit From a1454c0f12421da1849ca347f8a30d084778d679 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 3 Aug 2005 07:18:31 +0000 Subject: Create per device SDP server functions --- include/sdp_lib.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/sdp_lib.h b/include/sdp_lib.h index b4e83fe3..b9fbf6f3 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -397,11 +397,13 @@ void sdp_record_free(sdp_record_t *rec); * on success or -1 on failure (and sets errno). */ int sdp_record_register(sdp_session_t *sess, sdp_record_t *rec, uint8_t flags); +int sdp_device_record_register(sdp_session_t *sess, bdaddr_t *device, sdp_record_t *rec, uint8_t flags); /* * Unregister a service record. */ int sdp_record_unregister(sdp_session_t *sess, sdp_record_t *rec); +int sdp_device_record_unregister(sdp_session_t *sess, bdaddr_t *device, sdp_record_t *rec); /* * Update an existing service record. (Calling this function @@ -409,6 +411,7 @@ int sdp_record_unregister(sdp_session_t *sess, sdp_record_t *rec); * in an error.) */ int sdp_record_update(sdp_session_t *sess, const sdp_record_t *rec); +int sdp_device_record_update(sdp_session_t *sess, bdaddr_t *device, const sdp_record_t *rec); void sdp_record_print(const sdp_record_t *rec); -- cgit From fb1557c4111ca9993e4927af6f65bdbf9c2fa8ec Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 3 Aug 2005 07:41:21 +0000 Subject: Add device specific record register --- include/sdp.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/sdp.h b/include/sdp.h index f08a7ddb..c2846242 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -371,6 +371,7 @@ extern "C" { * Values of the flags parameter to sdp_record_register */ #define SDP_RECORD_PERSIST 0x01 +#define SDP_DEVICE_RECORD 0x02 /* * Values of the flags parameter to sdp_connect -- cgit From a73893381f0b7be98b8eb99d31ff834c7658d27c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 5 Aug 2005 07:11:32 +0000 Subject: Introduce bt_malloc() and bt_free() functions --- include/bluetooth.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index 33d68a61..b5d056df 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -136,6 +136,9 @@ int bafprintf(FILE *stream, const char *format, ...); int basprintf(char *str, const char *format, ...); int basnprintf(char *str, size_t size, const char *format, ...); +void *bt_malloc(size_t size); +void bt_free(void *ptr); + int bt_error(uint16_t code); char *bt_compidtostr(int id); -- cgit From 049d8b7167e88eb376a7173188eb09a5d6b19b41 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 6 Aug 2005 08:08:42 +0000 Subject: Add HCI message header --- include/hci.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 29518dbb..c9de094d 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1370,6 +1370,13 @@ typedef struct { } __attribute__ ((packed)) hci_sco_hdr; #define HCI_SCO_HDR_SIZE 3 +typedef struct { + uint16_t device; + uint16_t type; + uint16_t plen; +} __attribute__ ((packed)) hci_msg_hdr; +#define HCI_MSG_HDR_SIZE 6 + /* Command opcode pack/unpack */ #define cmd_opcode_pack(ogf, ocf) (uint16_t)((ocf & 0x03ff)|(ogf << 10)) #define cmd_opcode_ogf(op) (op >> 10) -- cgit From 2fa38208982e7c7bb55ae97acd13dbf82dd24e88 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 6 Aug 2005 17:43:48 +0000 Subject: Add UUID for video distribution --- include/sdp.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/sdp.h b/include/sdp.h index c2846242..6aeffc19 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -139,6 +139,7 @@ extern "C" { #define UPNP_L2CAP_SVCLASS_ID 0x1302 #define VIDEO_SOURCE_SVCLASS_ID 0x1303 #define VIDEO_SINK_SVCLASS_ID 0x1304 +#define VIDEO_DISTRIBUTION_SVCLASS_ID 0x1305 /* * Standard profile descriptor identifiers; note these @@ -203,6 +204,7 @@ extern "C" { #define UPNP_L2CAP_PROFILE_ID UPNP_L2CAP_SVCLASS_ID #define VIDEO_SOURCE_PROFILE_ID VIDEO_SOURCE_SVCLASS_ID #define VIDEO_SINK_PROFILE_ID VIDEO_SINK_SVCLASS_ID +#define VIDEO_DISTRIBUTION_PROFILE_ID VIDEO_DISTRIBUTION_SVCLASS_ID /* * Attribute identifier codes -- cgit From 8ce8108e712e40e1b9530c96f7ff6cbb32b5cb8b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 7 Aug 2005 11:19:57 +0000 Subject: Add UUIDs for phonebook access profile --- include/sdp.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/sdp.h b/include/sdp.h index 6aeffc19..c21cb979 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -127,6 +127,8 @@ extern "C" { #define UDI_TA_SVCLASS_ID 0x112b #define AV_SVCLASS_ID 0x112c #define SAP_SVCLASS_ID 0x112d +#define PBAP_PCE_SVCLASS_ID 0x112e +#define PBAP_PSE_SVCLASS_ID 0x112f #define PNP_INFO_SVCLASS_ID 0x1200 #define GENERIC_NETWORKING_SVCLASS_ID 0x1201 #define GENERIC_FILETRANS_SVCLASS_ID 0x1202 @@ -192,6 +194,8 @@ extern "C" { #define UDI_TA_PROFILE_ID UDI_TA_SVCLASS_ID #define AV_PROFILE_ID AV_SVCLASS_ID #define SAP_PROFILE_ID SAP_SVCLASS_ID +#define PBAP_PCE_PROFILE_ID PBAP_PCE_PROFILE_ID +#define PBAP_PSE_PROFILE_ID PBAP_PSE_PROFILE_ID #define PNP_INFO_PROFILE_ID PNP_INFO_SVCLASS_ID #define GENERIC_NETWORKING_PROFILE_ID GENERIC_NETWORKING_SVCLASS_ID #define GENERIC_FILETRANS_PROFILE_ID GENERIC_FILETRANS_SVCLASS_ID -- cgit From 44f113d701858c5c502b30873b5a0375140eb211 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 16 Aug 2005 21:22:47 +0000 Subject: Add extended inquiry definitions --- include/hci.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index c9de094d..3b977033 100644 --- a/include/hci.h +++ b/include/hci.h @@ -901,6 +901,25 @@ typedef struct { } __attribute__ ((packed)) write_afh_mode_rp; #define WRITE_AFH_MODE_RP_SIZE 1 +#define OCF_READ_EXT_INQUIRY_RESPONSE 0x0051 +typedef struct { + uint8_t status; + uint8_t fec; + uint8_t data[240]; +} __attribute__ ((packed)) read_ext_inquiry_response_rp; +#define READ_EXT_INQUIRY_RESPONSE_RP_SIZE 242 + +#define OCF_WRITE_EXT_INQUIRY_RESPONSE 0x0052 +typedef struct { + uint8_t fec; + uint8_t data[240]; +} __attribute__ ((packed)) write_ext_inquiry_response_cp; +#define WRITE_EXT_INQUIRY_RESPONSE_CP_SIZE 241 +typedef struct { + uint8_t status; +} __attribute__ ((packed)) write_ext_inquiry_response_rp; +#define WRITE_EXT_INQUIRY_RESPONSE_RP_SIZE 1 + /* Informational Parameters */ #define OGF_INFO_PARAM 0x04 @@ -1316,6 +1335,18 @@ typedef struct { } __attribute__ ((packed)) evt_sync_conn_changed; #define EVT_SYNC_CONN_CHANGED_SIZE 9 +#define EVT_EXTENDED_INQUIRY_RESULT 0x2F +typedef struct { + bdaddr_t bdaddr; + uint8_t pscan_rep_mode; + uint8_t pscan_period_mode; + uint8_t dev_class[3]; + uint16_t clock_offset; + int8_t rssi; + uint8_t data[240]; +} __attribute__ ((packed)) extended_inquiry_info; +#define EXTENDED_INQUIRY_INFO 254 + #define EVT_TESTING 0xFE #define EVT_VENDOR 0xFF -- cgit From b91cf84c987b8cc4bdfa9c0fb0daf88089c5687a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 22 Aug 2005 10:44:04 +0000 Subject: Add attribute identifier for supported repositories --- include/sdp.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/sdp.h b/include/sdp.h index c21cb979..c622e177 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -261,6 +261,7 @@ extern "C" { #define SDP_ATTR_SUPPORTED_FEATURES 0x0311 #define SDP_ATTR_SUPPORTED_FUNCTIONS 0x0312 #define SDP_ATTR_TOTAL_IMAGING_DATA_CAPACITY 0x0313 +#define SDP_ATTR_SUPPORTED_REPOSITORIES 0x0314 #define SDP_ATTR_SPECIFICATION_ID 0x0200 #define SDP_ATTR_VENDOR_ID 0x0201 -- cgit From 250f3d42abeb25d8b08638130d5f4674af6168c6 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 24 Aug 2005 23:08:00 +0000 Subject: Fix extended inquiry info structure size --- include/hci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 3b977033..b7df747a 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1345,7 +1345,7 @@ typedef struct { int8_t rssi; uint8_t data[240]; } __attribute__ ((packed)) extended_inquiry_info; -#define EXTENDED_INQUIRY_INFO 254 +#define EXTENDED_INQUIRY_INFO_SIZE 254 #define EVT_TESTING 0xFE -- cgit From f544b5e43cc3c64d43e73a3fbfc5fd045b6de00c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 25 Aug 2005 00:54:48 +0000 Subject: Add functions for the extended inquiry response --- include/hci_lib.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index 4bfc5197..b27980ad 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -101,6 +101,8 @@ int hci_read_inquiry_mode(int dd, uint8_t *mode, int to); int hci_write_inquiry_mode(int dd, uint8_t mode, int to); int hci_read_afh_mode(int dd, uint8_t *mode, int to); int hci_write_afh_mode(int dd, uint8_t mode, int to); +int hci_read_ext_inquiry_response(int dd, uint8_t *fec, uint8_t *data, int to); +int hci_write_ext_inquiry_response(int dd, uint8_t fec, uint8_t *data, int to); int hci_read_transmit_power_level(int dd, uint16_t handle, uint8_t type, int8_t *level, int to); int hci_read_link_supervision_timeout(int dd, uint16_t handle, uint16_t *timeout, int to); int hci_write_link_supervision_timeout(int dd, uint16_t handle, uint16_t timeout, int to); -- cgit From f50545eae585ba4b3eac5d8764827342ae214843 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 27 Aug 2005 10:53:49 +0000 Subject: Add extended inquiry features bit --- include/hci.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index b7df747a..243889d3 100644 --- a/include/hci.h +++ b/include/hci.h @@ -254,6 +254,8 @@ enum { #define LMP_EDR_ESCO_3M 0x40 #define LMP_EDR_3S_ESCO 0x80 +#define LMP_EXT_INQ 0x01 + #define LMP_EXT_FEAT 0x80 /* Link policies */ -- cgit From b48bccaf6c89da2af3a20617f4a496be4a633c5b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 7 Sep 2005 16:14:55 +0000 Subject: Add support for identification of supported commands --- include/hci_lib.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index b27980ad..03305547 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -129,6 +129,9 @@ int hci_strtolp(char *str, unsigned int *val); char *hci_lmtostr(unsigned int ptype); int hci_strtolm(char *str, unsigned int *val); +char *hci_cmdtostr(unsigned int cmd); +char *hci_commandstostr(uint8_t *commands, char *pref, int width); + char *hci_vertostr(unsigned int ver); int hci_strtover(char *str, unsigned int *ver); char *lmp_vertostr(unsigned int ver); -- cgit From 19f7dc5517f6c598d9e351ec28fad811e0f0ee59 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 8 Sep 2005 11:50:20 +0000 Subject: Add missing OCF declarations for the security filter --- include/hci.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 243889d3..d12232d8 100644 --- a/include/hci.h +++ b/include/hci.h @@ -575,6 +575,10 @@ typedef struct { } __attribute__ ((packed)) write_link_policy_rp; #define WRITE_LINK_POLICY_RP_SIZE 3 +#define OCF_READ_DEFAULT_LINK_POLICY 0x000E + +#define OCF_WRITE_DEFAULT_LINK_POLICY 0x000F + /* Host Controller and Baseband */ #define OGF_HOST_CTL 0x03 @@ -784,6 +788,18 @@ typedef struct { } __attribute__ ((packed)) write_voice_setting_cp; #define WRITE_VOICE_SETTING_CP_SIZE 2 +#define OCF_READ_AUTOMATIC_FLUSH_TIMEOUT 0x0027 + +#define OCF_WRITE_AUTOMATIC_FLUSH_TIMEOUT 0x0028 + +#define OCF_READ_NUM_BROADCAST_RETRANS 0x0029 + +#define OCF_WRITE_NUM_BROADCAST_RETRANS 0x002A + +#define OCF_READ_HOLD_MODE_ACTIVITY 0x002B + +#define OCF_WRITE_HOLD_MODE_ACTIVITY 0x002C + #define OCF_READ_TRANSMIT_POWER_LEVEL 0x002D typedef struct { uint16_t handle; @@ -826,6 +842,8 @@ typedef struct { } __attribute__ ((packed)) write_link_supervision_timeout_rp; #define WRITE_LINK_SUPERVISION_TIMEOUT_RP_SIZE 3 +#define OCF_READ_NUM_SUPPORTED_IAC 0x0038 + #define MAX_IAC_LAP 0x40 #define OCF_READ_CURRENT_IAC_LAP 0x0039 typedef struct { @@ -842,6 +860,14 @@ typedef struct { } __attribute__ ((packed)) write_current_iac_lap_cp; #define WRITE_CURRENT_IAC_LAP_CP_SIZE 1+3*MAX_IAC_LAP +#define OCF_READ_PAGE_SCAN_PERIOD_MODE 0x003B + +#define OCF_WRITE_PAGE_SCAN_PERIOD_MODE 0x003C + +#define OCF_READ_PAGE_SCAN_MODE 0x003D + +#define OCF_WRITE_PAGE_SCAN_MODE 0x003E + #define OCF_SET_AFH_CLASSIFICATION 0x003F typedef struct { uint8_t map[10]; @@ -886,6 +912,10 @@ typedef struct { } __attribute__ ((packed)) write_inquiry_mode_rp; #define WRITE_INQUIRY_MODE_RP_SIZE 1 +#define OCF_READ_PAGE_SCAN_TYPE 0x0046 + +#define OCF_WRITE_PAGE_SCAN_TYPE 0x0047 + #define OCF_READ_AFH_MODE 0x0048 typedef struct { uint8_t status; @@ -973,6 +1003,8 @@ typedef struct { } __attribute__ ((packed)) read_buffer_size_rp; #define READ_BUFFER_SIZE_RP_SIZE 8 +#define OCF_READ_COUNTRY_CODE 0x0007 + #define OCF_READ_BD_ADDR 0x0009 typedef struct { uint8_t status; -- cgit From c0d524486a50e8366c12c5ebea1a4441e9db46aa Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 29 Oct 2005 19:25:42 +0000 Subject: Big cleanup of CVS relics --- include/Makefile.am | 3 --- include/bluetooth.h | 25 ++++++++++--------------- include/bnep.h | 25 ++++++++++--------------- include/cmtp.h | 25 ++++++++++--------------- include/hci.h | 25 ++++++++++--------------- include/hci_lib.h | 25 ++++++++++--------------- include/hidp.h | 25 ++++++++++--------------- include/l2cap.h | 25 ++++++++++--------------- include/rfcomm.h | 25 ++++++++++--------------- include/sco.h | 25 ++++++++++--------------- include/sdp.h | 25 ++++++++++--------------- include/sdp_lib.h | 25 ++++++++++--------------- 12 files changed, 110 insertions(+), 168 deletions(-) (limited to 'include') diff --git a/include/Makefile.am b/include/Makefile.am index ab67cf59..992e987b 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,6 +1,3 @@ -# -# $Id$ -# includedir = @includedir@/bluetooth diff --git a/include/bluetooth.h b/include/bluetooth.h index b5d056df..8ced1024 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -8,24 +8,19 @@ * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * - * $Id$ */ #ifndef __BLUETOOTH_H diff --git a/include/bnep.h b/include/bnep.h index 88b922bc..612d127d 100644 --- a/include/bnep.h +++ b/include/bnep.h @@ -7,24 +7,19 @@ * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * - * $Id$ */ #ifndef __BNEP_H diff --git a/include/cmtp.h b/include/cmtp.h index ae987da0..0dbce775 100644 --- a/include/cmtp.h +++ b/include/cmtp.h @@ -6,24 +6,19 @@ * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * - * $Id$ */ #ifndef __CMTP_H diff --git a/include/hci.h b/include/hci.h index d12232d8..0ddebd82 100644 --- a/include/hci.h +++ b/include/hci.h @@ -8,24 +8,19 @@ * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * - * $Id$ */ #ifndef __HCI_H diff --git a/include/hci_lib.h b/include/hci_lib.h index 03305547..66a22e7e 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -8,24 +8,19 @@ * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * - * $Id$ */ #ifndef __HCI_LIB_H diff --git a/include/hidp.h b/include/hidp.h index e485eeea..d040d6d5 100644 --- a/include/hidp.h +++ b/include/hidp.h @@ -6,24 +6,19 @@ * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * - * $Id$ */ #ifndef __HIDP_H diff --git a/include/l2cap.h b/include/l2cap.h index ae88c7a0..616ae75e 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -8,24 +8,19 @@ * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * - * $Id$ */ #ifndef __L2CAP_H diff --git a/include/rfcomm.h b/include/rfcomm.h index 8a1d56e9..3c9e0eb2 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -7,24 +7,19 @@ * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * - * $Id$ */ #ifndef __RFCOMM_H diff --git a/include/sco.h b/include/sco.h index d07b0153..dfcbe54c 100644 --- a/include/sco.h +++ b/include/sco.h @@ -7,24 +7,19 @@ * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * - * $Id$ */ #ifndef __SCO_H diff --git a/include/sdp.h b/include/sdp.h index c622e177..bd8e065c 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -9,24 +9,19 @@ * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * - * $Id$ */ #ifndef __SDP_H diff --git a/include/sdp_lib.h b/include/sdp_lib.h index b9fbf6f3..57b5b15f 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -9,24 +9,19 @@ * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * - * $Id$ */ #ifndef __SDP_LIB_H -- cgit From 7575a227c3ad282247c288fa8def69d9dcd7603f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 21 Nov 2005 10:26:56 +0000 Subject: Add constants for sniff subrating --- include/hci.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 0ddebd82..e1790cce 100644 --- a/include/hci.h +++ b/include/hci.h @@ -243,6 +243,7 @@ enum { #define LMP_EDR_3SLOT 0x80 #define LMP_EDR_5SLOT 0x01 +#define LMP_SNIFF_SUBR 0x02 #define LMP_AFH_CAP_MST 0x08 #define LMP_AFH_CLS_MST 0x10 #define LMP_EDR_ESCO_2M 0x20 -- cgit From 232851e1acd3dddc763f1661d67a3c0256363366 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 23 Nov 2005 21:26:03 +0000 Subject: Add definitions for sniff subrate --- include/hci.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index e1790cce..ec79bf3b 100644 --- a/include/hci.h +++ b/include/hci.h @@ -575,6 +575,16 @@ typedef struct { #define OCF_WRITE_DEFAULT_LINK_POLICY 0x000F +#define OCF_SNIFF_SUBRATE 0x0011 +typedef struct { + uint16_t handle; + uint16_t max_remote_latency; + uint16_t max_local_latency; + uint16_t min_remote_timeout; + uint16_t min_local_timeout; +} __attribute__ ((packed)) sniff_subrate_cp; +#define SNIFF_SUBRATE_CP_SIZE 10 + /* Host Controller and Baseband */ #define OGF_HOST_CTL 0x03 @@ -1365,6 +1375,17 @@ typedef struct { } __attribute__ ((packed)) evt_sync_conn_changed; #define EVT_SYNC_CONN_CHANGED_SIZE 9 +#define EVT_SNIFF_SUBRATE 0x2E +typedef struct { + uint8_t status; + uint16_t handle; + uint16_t max_remote_latency; + uint16_t max_local_latency; + uint16_t min_remote_timeout; + uint16_t min_local_timeout; +} __attribute__ ((packed)) evt_sniff_subrate; +#define EVT_SNIFF_SUBRATE_SIZE 11 + #define EVT_EXTENDED_INQUIRY_RESULT 0x2F typedef struct { bdaddr_t bdaddr; -- cgit From 641d636fb24fb0dea567388a4f0d0f135d4ea48c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 9 Dec 2005 09:12:44 +0000 Subject: Add support for allocation of binary text elements --- include/sdp_lib.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 57b5b15f..a45f36ef 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -102,10 +102,12 @@ int sdp_get_string_attr(const sdp_record_t *rec, uint16_t attr, char *value, int * Basic sdp data functions */ sdp_data_t *sdp_data_alloc(uint8_t dtd, const void *value); +sdp_data_t *sdp_data_alloc_with_length(uint8_t dtd, const void *value, uint32_t length); void sdp_data_free(sdp_data_t *data); sdp_data_t *sdp_data_get(const sdp_record_t *rec, uint16_t attr_id); sdp_data_t *sdp_seq_alloc(void **dtds, void **values, int len); +sdp_data_t *sdp_seq_alloc_with_length(void **dtds, void **values, int *length, int len); sdp_data_t *sdp_seq_append(sdp_data_t *seq, sdp_data_t *data); int sdp_attr_add(sdp_record_t *rec, uint16_t attr, sdp_data_t *data); -- cgit From aa8d087a052ab9c54dde1b0ddaf3a47494ef899a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 14 Dec 2005 10:11:26 +0000 Subject: Add support for additional access protocols --- include/sdp_lib.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/sdp_lib.h b/include/sdp_lib.h index a45f36ef..7f22451e 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -175,6 +175,11 @@ static inline int sdp_set_browse_groups(sdp_record_t *rec, sdp_list_t *seq) */ int sdp_set_access_protos(sdp_record_t *rec, const sdp_list_t *proto); +/* + * Set the additional access protocols of the record to those specified in proto + */ +int sdp_set_add_access_protos(sdp_record_t *rec, const sdp_list_t *proto); + /* * Get protocol port (i.e. PSM for L2CAP, Channel for RFCOMM) */ @@ -457,7 +462,7 @@ int sdp_get_access_protos(const sdp_record_t *rec, sdp_list_t **protos); /* * Get the additional access protocols from the service record */ -int sdp_get_add_access_protos(const sdp_record_t *rec, sdp_list_t **pap); +int sdp_get_add_access_protos(const sdp_record_t *rec, sdp_list_t **protos); /* * Extract the list of browse groups to which the service belongs. -- cgit From 197a2aee34d9a1643cd474f8f167552ca6395d01 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 3 Jan 2006 12:56:09 +0000 Subject: Update copyright information --- include/bluetooth.h | 2 +- include/bnep.h | 2 +- include/cmtp.h | 2 +- include/hci.h | 2 +- include/hci_lib.h | 2 +- include/hidp.h | 2 +- include/l2cap.h | 2 +- include/rfcomm.h | 2 +- include/sco.h | 2 +- include/sdp.h | 2 +- include/sdp_lib.h | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index 8ced1024..2ad82a7d 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2005 Marcel Holtmann + * Copyright (C) 2002-2006 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/bnep.h b/include/bnep.h index 612d127d..13f10015 100644 --- a/include/bnep.h +++ b/include/bnep.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2005 Marcel Holtmann + * Copyright (C) 2002-2006 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/cmtp.h b/include/cmtp.h index 0dbce775..72bd7e13 100644 --- a/include/cmtp.h +++ b/include/cmtp.h @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2002-2005 Marcel Holtmann + * Copyright (C) 2002-2006 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hci.h b/include/hci.h index ec79bf3b..0547f568 100644 --- a/include/hci.h +++ b/include/hci.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2005 Marcel Holtmann + * Copyright (C) 2002-2006 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hci_lib.h b/include/hci_lib.h index 66a22e7e..20af8bdb 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2005 Marcel Holtmann + * Copyright (C) 2002-2006 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hidp.h b/include/hidp.h index d040d6d5..71d0150a 100644 --- a/include/hidp.h +++ b/include/hidp.h @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2003-2005 Marcel Holtmann + * Copyright (C) 2003-2006 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/l2cap.h b/include/l2cap.h index 616ae75e..d2320f46 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2005 Marcel Holtmann + * Copyright (C) 2002-2006 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/rfcomm.h b/include/rfcomm.h index 3c9e0eb2..7537f958 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2005 Marcel Holtmann + * Copyright (C) 2002-2006 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/sco.h b/include/sco.h index dfcbe54c..4777640c 100644 --- a/include/sco.h +++ b/include/sco.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2005 Marcel Holtmann + * Copyright (C) 2002-2006 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/sdp.h b/include/sdp.h index bd8e065c..c0e468d3 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -4,7 +4,7 @@ * * Copyright (C) 2001-2002 Nokia Corporation * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2005 Marcel Holtmann + * Copyright (C) 2002-2006 Marcel Holtmann * Copyright (C) 2002-2003 Stephen Crane * * diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 7f22451e..dc074c6a 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -4,7 +4,7 @@ * * Copyright (C) 2001-2002 Nokia Corporation * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2005 Marcel Holtmann + * Copyright (C) 2002-2006 Marcel Holtmann * Copyright (C) 2002-2003 Stephen Crane * * -- cgit From 42e0ce5b430ac5e36c0d21bdddcaf1fe83e025f5 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 4 Jan 2006 00:04:30 +0000 Subject: Add definitions for Apple Agent --- include/sdp.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/sdp.h b/include/sdp.h index c0e468d3..7ff74979 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -137,6 +137,7 @@ extern "C" { #define VIDEO_SOURCE_SVCLASS_ID 0x1303 #define VIDEO_SINK_SVCLASS_ID 0x1304 #define VIDEO_DISTRIBUTION_SVCLASS_ID 0x1305 +#define APPLE_AGENT_SVCLASS_ID 0x2112 /* * Standard profile descriptor identifiers; note these @@ -204,6 +205,7 @@ extern "C" { #define VIDEO_SOURCE_PROFILE_ID VIDEO_SOURCE_SVCLASS_ID #define VIDEO_SINK_PROFILE_ID VIDEO_SINK_SVCLASS_ID #define VIDEO_DISTRIBUTION_PROFILE_ID VIDEO_DISTRIBUTION_SVCLASS_ID +#define APPLE_AGENT_PROFILE_ID APPLE_AGENT_SVCLASS_ID /* * Attribute identifier codes -- cgit From 1ba3b0978c73153513cfe016435e1e930038fbd4 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 7 Feb 2006 07:48:11 +0000 Subject: Add features bit for pause encryption --- include/hci.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 0547f568..312fa27d 100644 --- a/include/hci.h +++ b/include/hci.h @@ -244,6 +244,7 @@ enum { #define LMP_EDR_5SLOT 0x01 #define LMP_SNIFF_SUBR 0x02 +#define LMP_PAUSE_ENC 0x04 #define LMP_AFH_CAP_MST 0x08 #define LMP_AFH_CLS_MST 0x10 #define LMP_EDR_ESCO_2M 0x20 -- cgit From 630e9b79dee2c26759fb8650444cb113714bba0d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 12 Apr 2006 09:23:00 +0000 Subject: Add additional EIR error code --- include/hci.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 312fa27d..435ea6a1 100644 --- a/include/hci.h +++ b/include/hci.h @@ -192,6 +192,7 @@ enum { #define HCI_ROLE_SWITCH_PENDING 0x32 #define HCI_SLOT_VIOLATION 0x34 #define HCI_ROLE_SWITCH_FAILED 0x35 +#define HCI_EIR_TOO_LARGE 0x36 /* ACL flags */ #define ACL_CONT 0x01 -- cgit From 73f2fe893f6801358ea4fb88dc8d24050c7d0ca5 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 30 May 2006 10:58:30 +0000 Subject: Add another Phonebook Access identifier --- include/sdp.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/sdp.h b/include/sdp.h index 7ff74979..200a6b0e 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -124,6 +124,7 @@ extern "C" { #define SAP_SVCLASS_ID 0x112d #define PBAP_PCE_SVCLASS_ID 0x112e #define PBAP_PSE_SVCLASS_ID 0x112f +#define PBAP_SVCLASS_ID 0x1130 #define PNP_INFO_SVCLASS_ID 0x1200 #define GENERIC_NETWORKING_SVCLASS_ID 0x1201 #define GENERIC_FILETRANS_SVCLASS_ID 0x1202 @@ -190,8 +191,9 @@ extern "C" { #define UDI_TA_PROFILE_ID UDI_TA_SVCLASS_ID #define AV_PROFILE_ID AV_SVCLASS_ID #define SAP_PROFILE_ID SAP_SVCLASS_ID -#define PBAP_PCE_PROFILE_ID PBAP_PCE_PROFILE_ID -#define PBAP_PSE_PROFILE_ID PBAP_PSE_PROFILE_ID +#define PBAP_PCE_PROFILE_ID PBAP_PCE_SVCLASS_ID +#define PBAP_PSE_PROFILE_ID PBAP_PSE_SVCLASS_ID +#define PBAP_PROFILE_ID PBAP_SVCLASS_ID #define PNP_INFO_PROFILE_ID PNP_INFO_SVCLASS_ID #define GENERIC_NETWORKING_PROFILE_ID GENERIC_NETWORKING_SVCLASS_ID #define GENERIC_FILETRANS_PROFILE_ID GENERIC_FILETRANS_SVCLASS_ID -- cgit From 26167e5ea69ab1707a94e1c262ac58711cbd6a9a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 31 May 2006 15:17:07 +0000 Subject: Update sniff subrating data structures --- include/hci.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 435ea6a1..117328d8 100644 --- a/include/hci.h +++ b/include/hci.h @@ -580,8 +580,7 @@ typedef struct { #define OCF_SNIFF_SUBRATE 0x0011 typedef struct { uint16_t handle; - uint16_t max_remote_latency; - uint16_t max_local_latency; + uint16_t max_latency; uint16_t min_remote_timeout; uint16_t min_local_timeout; } __attribute__ ((packed)) sniff_subrate_cp; @@ -1381,8 +1380,8 @@ typedef struct { typedef struct { uint8_t status; uint16_t handle; - uint16_t max_remote_latency; - uint16_t max_local_latency; + uint16_t max_tx_latency; + uint16_t max_rx_latency; uint16_t min_remote_timeout; uint16_t min_local_timeout; } __attribute__ ((packed)) evt_sniff_subrate; -- cgit From 3fcf56f2a27bcd08dfecbdbe65820e385491ed42 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 31 May 2006 15:42:39 +0000 Subject: Fix sniff subrate command size --- include/hci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 117328d8..becbbb06 100644 --- a/include/hci.h +++ b/include/hci.h @@ -584,7 +584,7 @@ typedef struct { uint16_t min_remote_timeout; uint16_t min_local_timeout; } __attribute__ ((packed)) sniff_subrate_cp; -#define SNIFF_SUBRATE_CP_SIZE 10 +#define SNIFF_SUBRATE_CP_SIZE 8 /* Host Controller and Baseband */ #define OGF_HOST_CTL 0x03 -- cgit From 39519245f25c517424d1f2ccbed07777c8e060fa Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 8 Jul 2006 11:45:21 +0000 Subject: Add adapter type for SDIO --- include/hci.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index becbbb06..4cd8c7d9 100644 --- a/include/hci.h +++ b/include/hci.h @@ -48,12 +48,13 @@ extern "C" { #define HCI_DEV_RESUME 6 /* HCI device types */ -#define HCI_VHCI 0 +#define HCI_VIRTUAL 0 #define HCI_USB 1 #define HCI_PCCARD 2 #define HCI_UART 3 #define HCI_RS232 4 #define HCI_PCI 5 +#define HCI_SDIO 6 /* HCI device flags */ enum { -- cgit From 57834785d5445439c2abbc19903566f050bc98a2 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 27 Jul 2006 01:23:04 +0000 Subject: Add features bit for link supervision timeout --- include/hci.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 4cd8c7d9..65480140 100644 --- a/include/hci.h +++ b/include/hci.h @@ -255,6 +255,7 @@ enum { #define LMP_EXT_INQ 0x01 +#define LMP_LSTO 0x01 #define LMP_EXT_FEAT 0x80 /* Link policies */ -- cgit From 646fda930139720d7d9c45cc085ae4eb7018d8bb Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 31 Jul 2006 09:56:18 +0000 Subject: Add link supervision timeout change event --- include/hci.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 65480140..329f2b3a 100644 --- a/include/hci.h +++ b/include/hci.h @@ -835,14 +835,14 @@ typedef struct { typedef struct { uint8_t status; uint16_t handle; - uint16_t link_sup_to; + uint16_t timeout; } __attribute__ ((packed)) read_link_supervision_timeout_rp; #define READ_LINK_SUPERVISION_TIMEOUT_RP_SIZE 5 #define OCF_WRITE_LINK_SUPERVISION_TIMEOUT 0x0037 typedef struct { uint16_t handle; - uint16_t link_sup_to; + uint16_t timeout; } __attribute__ ((packed)) write_link_supervision_timeout_cp; #define WRITE_LINK_SUPERVISION_TIMEOUT_CP_SIZE 4 typedef struct { @@ -1401,6 +1401,13 @@ typedef struct { } __attribute__ ((packed)) extended_inquiry_info; #define EXTENDED_INQUIRY_INFO_SIZE 254 +#define EVT_LINK_SUPERVISION_TIMEOUT 0x38 +typedef struct { + uint16_t handle; + uint16_t timeout; +} __attribute__ ((packed)) evt_link_supervision_timeout; +#define EVT_LINK_SUPERVISION_TIMEOUT_SIZE 4 + #define EVT_TESTING 0xFE #define EVT_VENDOR 0xFF -- cgit From 914617b58d2b68d1e3792a77fc5dd37f78d2037b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 31 Jul 2006 10:00:10 +0000 Subject: Remove kernel specific timeouts --- include/hci.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 329f2b3a..bccaf918 100644 --- a/include/hci.h +++ b/include/hci.h @@ -98,12 +98,6 @@ enum { #define HCIINQUIRY _IOR('H', 240, int) -/* HCI timeouts */ - -#define HCI_CONN_TIMEOUT (HZ * 40) -#define HCI_DISCONN_TIMEOUT (HZ * 2) -#define HCI_CONN_IDLE_TIMEOUT (HZ * 60) - #ifndef __NO_HCI_DEFS /* HCI Packet types */ -- cgit From 8f6ea7c3d24dc21f120b6d29fc975936b4d4f3b7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 17 Aug 2006 21:59:25 +0000 Subject: Add additional private data field --- include/sdp.h | 23 ----------------------- include/sdp_lib.h | 38 ++++++++++++++++++++++++++------------ 2 files changed, 26 insertions(+), 35 deletions(-) (limited to 'include') diff --git a/include/sdp.h b/include/sdp.h index 200a6b0e..f6af1261 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -373,18 +373,6 @@ extern "C" { #define SDP_SVC_REMOVE_REQ 0x79 #define SDP_SVC_REMOVE_RSP 0x80 -/* - * Values of the flags parameter to sdp_record_register - */ -#define SDP_RECORD_PERSIST 0x01 -#define SDP_DEVICE_RECORD 0x02 - -/* - * Values of the flags parameter to sdp_connect - */ -#define SDP_RETRY_IF_BUSY 0x01 -#define SDP_WAIT_ON_CLOSE 0x02 - /* * SDP Error codes */ @@ -499,17 +487,6 @@ struct sdp_data_struct { int unitSize; }; -/* - * a session with an SDP server - */ -typedef struct { - int sock; - int state; - int local; - int flags; - uint16_t tid; // Current transaction ID -} sdp_session_t; - #ifdef __cplusplus } #endif diff --git a/include/sdp_lib.h b/include/sdp_lib.h index dc074c6a..8a89ab6e 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -69,6 +69,30 @@ static inline void sdp_list_foreach(sdp_list_t *list, sdp_list_func_t f, void *u f(list->data, u); } +/* + * Values of the flags parameter to sdp_record_register + */ +#define SDP_RECORD_PERSIST 0x01 +#define SDP_DEVICE_RECORD 0x02 + +/* + * Values of the flags parameter to sdp_connect + */ +#define SDP_RETRY_IF_BUSY 0x01 +#define SDP_WAIT_ON_CLOSE 0x02 + +/* + * a session with an SDP server + */ +typedef struct { + int sock; + int state; + int local; + int flags; + uint16_t tid; // Current transaction ID + void *priv; +} sdp_session_t; + /* * create an L2CAP connection to a Bluetooth device * @@ -83,11 +107,9 @@ static inline void sdp_list_foreach(sdp_list_t *list, sdp_list_func_t f, void *u */ sdp_session_t *sdp_connect(const bdaddr_t *src, const bdaddr_t *dst, uint32_t flags); int sdp_close(sdp_session_t *session); +int sdp_get_socket(const sdp_session_t *session); -static inline int sdp_get_socket(const sdp_session_t *s) -{ - return s->sock; -} +uint16_t sdp_gen_tid(sdp_session_t *session); /* * find all devices in the piconet @@ -535,14 +557,6 @@ static inline int sdp_get_icon_url(const sdp_record_t *rec, char *str, int len) return sdp_get_string_attr(rec, SDP_ATTR_ICON_URL, str, len); } -/* - * Generate unique transaction identifiers - */ -static inline uint16_t sdp_gen_tid(sdp_session_t *session) -{ - return session->tid++; -} - sdp_record_t *sdp_extract_pdu(const uint8_t *pdata, int *scanned); sdp_data_t *sdp_extract_string(uint8_t *, int *); -- cgit From d57d189c75ba7ee813d943d228f6311fca00c5ce Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 20 Aug 2006 22:33:07 +0000 Subject: Rename link supervision timeout event --- include/hci.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index bccaf918..6f67bbdf 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1395,11 +1395,11 @@ typedef struct { } __attribute__ ((packed)) extended_inquiry_info; #define EXTENDED_INQUIRY_INFO_SIZE 254 -#define EVT_LINK_SUPERVISION_TIMEOUT 0x38 +#define EVT_LINK_SUPERVISION_TIMEOUT_CHANGE 0x38 typedef struct { uint16_t handle; uint16_t timeout; -} __attribute__ ((packed)) evt_link_supervision_timeout; +} __attribute__ ((packed)) evt_link_supervision_timeout_change; #define EVT_LINK_SUPERVISION_TIMEOUT_SIZE 4 #define EVT_TESTING 0xFE -- cgit From 99d09d338d4ab207b2d559d3516d9a642d1a5d30 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 21 Aug 2006 12:36:49 +0000 Subject: Add OCF for setting host controller to host flow control --- include/hci.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 6f67bbdf..ee25858e 100644 --- a/include/hci.h +++ b/include/hci.h @@ -816,6 +816,8 @@ typedef struct { } __attribute__ ((packed)) read_transmit_power_level_rp; #define READ_TRANSMIT_POWER_LEVEL_RP_SIZE 4 +#define OCF_SET_CONTROLLER_TO_HOST_FC 0x0031 + #define OCF_HOST_BUFFER_SIZE 0x0033 typedef struct { uint16_t acl_mtu; -- cgit From 0f9595e9d94cc878d159f1f63b377b839aaa1dca Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 21 Aug 2006 12:46:43 +0000 Subject: Add OCF for host number of completed packets --- include/hci.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index ee25858e..6cfef5c1 100644 --- a/include/hci.h +++ b/include/hci.h @@ -827,6 +827,8 @@ typedef struct { } __attribute__ ((packed)) host_buffer_size_cp; #define HOST_BUFFER_SIZE_CP_SIZE 7 +#define OCF_HOST_NUM_COMP_PKTS 0x0035 + #define OCF_READ_LINK_SUPERVISION_TIMEOUT 0x0036 typedef struct { uint8_t status; -- cgit From 6789dbbbe34d1c66b0338da061fa5cb877d04163 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 21 Aug 2006 12:56:10 +0000 Subject: Add structure for host number of completed packets --- include/hci.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 6cfef5c1..0454f96e 100644 --- a/include/hci.h +++ b/include/hci.h @@ -828,6 +828,11 @@ typedef struct { #define HOST_BUFFER_SIZE_CP_SIZE 7 #define OCF_HOST_NUM_COMP_PKTS 0x0035 +typedef struct { + uint8_t num_hndl; + /* variable length part */ +} __attribute__ ((packed)) host_num_comp_pkts_cp; +#define HOST_NUM_COMP_PKTS_CP_SIZE 1 #define OCF_READ_LINK_SUPERVISION_TIMEOUT 0x0036 typedef struct { -- cgit From 8be090b298a02108146d3bf48271f8408ac31917 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Fri, 25 Aug 2006 19:12:38 +0000 Subject: Added sdp_create for async searches --- include/sdp_lib.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 8a89ab6e..a4b2cb4b 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -111,6 +111,12 @@ int sdp_get_socket(const sdp_session_t *session); uint16_t sdp_gen_tid(sdp_session_t *session); +/* + * SDP transaction: functions for asynchronous search. + */ +typedef void sdp_callback_t(uint8_t type, sdp_list_t *rsp, void *udata, int err); +sdp_session_t *sdp_create(int sk, uint32_t flags); + /* * find all devices in the piconet */ -- cgit From dd610a12694a42aeb67417c95d87384f2eef8e70 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 25 Aug 2006 22:22:01 +0000 Subject: Add sdp_set_notify function --- include/sdp_lib.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/sdp_lib.h b/include/sdp_lib.h index a4b2cb4b..eaf4cdb0 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -114,8 +114,9 @@ uint16_t sdp_gen_tid(sdp_session_t *session); /* * SDP transaction: functions for asynchronous search. */ -typedef void sdp_callback_t(uint8_t type, sdp_list_t *rsp, void *udata, int err); +typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t *size, void *udata); sdp_session_t *sdp_create(int sk, uint32_t flags); +int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata); /* * find all devices in the piconet -- cgit From f9264e21a9e0c97e6a4d970c0b31cf01fc18781d Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Mon, 28 Aug 2006 19:49:18 +0000 Subject: Added sdp_process and sdp_service_search_async functions --- include/sdp_lib.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/sdp_lib.h b/include/sdp_lib.h index eaf4cdb0..64fe5b52 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -114,9 +114,11 @@ uint16_t sdp_gen_tid(sdp_session_t *session); /* * SDP transaction: functions for asynchronous search. */ -typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t *size, void *udata); +typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t size, void *udata); sdp_session_t *sdp_create(int sk, uint32_t flags); int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata); +int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search); +int sdp_process(sdp_session_t *session); /* * find all devices in the piconet -- cgit From 343f72ba28deaf9ddc68043567baad76e0325e5d Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Mon, 28 Aug 2006 21:26:50 +0000 Subject: Added SDP error response parsing --- include/sdp_lib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 64fe5b52..23157c6f 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -114,7 +114,7 @@ uint16_t sdp_gen_tid(sdp_session_t *session); /* * SDP transaction: functions for asynchronous search. */ -typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t size, void *udata); +typedef void sdp_callback_t(uint8_t type, int status, uint8_t *rsp, size_t size, void *udata); sdp_session_t *sdp_create(int sk, uint32_t flags); int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata); int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search); -- cgit From c8e5a1464ff8edb068e7361a257ef4ae34674cf8 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Tue, 29 Aug 2006 16:29:00 +0000 Subject: changed error handling in sdp_process function --- include/sdp_lib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 23157c6f..64fe5b52 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -114,7 +114,7 @@ uint16_t sdp_gen_tid(sdp_session_t *session); /* * SDP transaction: functions for asynchronous search. */ -typedef void sdp_callback_t(uint8_t type, int status, uint8_t *rsp, size_t size, void *udata); +typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t size, void *udata); sdp_session_t *sdp_create(int sk, uint32_t flags); int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata); int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search); -- cgit From 453a0cedb6c909047553ffc7145bcef26a3ae94c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 29 Aug 2006 21:39:07 +0000 Subject: Correct prototypes for async functions --- include/sdp_lib.h | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 64fe5b52..b1f839bc 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -111,13 +111,26 @@ int sdp_get_socket(const sdp_session_t *session); uint16_t sdp_gen_tid(sdp_session_t *session); +typedef enum { + /* + * Attributes are specified as individual elements + */ + SDP_ATTR_REQ_INDIVIDUAL = 1, + /* + * Attributes are specified as a range + */ + SDP_ATTR_REQ_RANGE +} sdp_attrreq_type_t; /* * SDP transaction: functions for asynchronous search. */ typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t size, void *udata); sdp_session_t *sdp_create(int sk, uint32_t flags); int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata); -int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search); +int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search_list, uint16_t max_rec_num); +int sdp_service_attr_async(sdp_session_t *session, uint32_t handle, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list); +int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *search, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list); +int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *search_list, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list); int sdp_process(sdp_session_t *session); /* @@ -356,18 +369,6 @@ int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search_list * -1 * The request completed unsuccessfully due to a timeout */ - -typedef enum { - /* - * Attributes are specified as individual elements - */ - SDP_ATTR_REQ_INDIVIDUAL = 1, - /* - * Attributes are specified as a range - */ - SDP_ATTR_REQ_RANGE -} sdp_attrreq_type_t; - sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list); /* -- cgit From 41064d605ba2f88f967c8388c9b20b92a7868a87 Mon Sep 17 00:00:00 2001 From: Ulisses Furquim Date: Wed, 30 Aug 2006 22:44:49 +0000 Subject: fix prototypes for sdp sync/async functions --- include/sdp_lib.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/sdp_lib.h b/include/sdp_lib.h index b1f839bc..d61413c3 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -127,10 +127,9 @@ typedef enum { typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t size, void *udata); sdp_session_t *sdp_create(int sk, uint32_t flags); int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata); -int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search_list, uint16_t max_rec_num); +int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search, uint16_t max_rec_num); int sdp_service_attr_async(sdp_session_t *session, uint32_t handle, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list); int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *search, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list); -int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *search_list, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list); int sdp_process(sdp_session_t *session); /* @@ -311,7 +310,7 @@ void sdp_set_url_attr(sdp_record_t *rec, const char *clientExecURL, const char * * * INPUT : * - * sdp_list_t *search_list + * sdp_list_t *search * list containing elements of the search * pattern. Each entry in the list is a UUID * of the service to be searched @@ -334,7 +333,7 @@ void sdp_set_url_attr(sdp_record_t *rec, const char *clientExecURL, const char * * non-zero service handles. It is a singly linked list of * service record handles (uint16_t) */ -int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search_list, uint16_t max_rec_num, sdp_list_t **rsp_list); +int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search, uint16_t max_rec_num, sdp_list_t **rsp_list); /* * a service attribute request. @@ -378,7 +377,7 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle, sdp_ * * INPUT : * - * sdp_list_t *search_list + * sdp_list_t *search * Singly linked list containing elements of the search * pattern. Each entry in the list is a UUID(DataTypeSDP_UUID16) * of the service to be searched @@ -412,7 +411,7 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle, sdp_ * service(s) found. Each element of this list is of type * sdp_record_t *. */ -int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search_list, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list, sdp_list_t **rsp_list); +int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list, sdp_list_t **rsp_list); /* * Allocate/free a service record and its attributes -- cgit From 1be1f79648ba7aafde6349cfe51f9c929e20d018 Mon Sep 17 00:00:00 2001 From: Ulisses Furquim Date: Mon, 4 Sep 2006 17:13:33 +0000 Subject: Make sdp_connect() fully async aware --- include/sdp_lib.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/sdp_lib.h b/include/sdp_lib.h index d61413c3..0e8948f9 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -80,6 +80,7 @@ static inline void sdp_list_foreach(sdp_list_t *list, sdp_list_func_t f, void *u */ #define SDP_RETRY_IF_BUSY 0x01 #define SDP_WAIT_ON_CLOSE 0x02 +#define SDP_NON_BLOCKING 0x04 /* * a session with an SDP server @@ -125,6 +126,7 @@ typedef enum { * SDP transaction: functions for asynchronous search. */ typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t size, void *udata); +int sdp_is_connected(sdp_session_t *session); sdp_session_t *sdp_create(int sk, uint32_t flags); int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata); int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search, uint16_t max_rec_num); -- cgit From aa7577018bb1faac4b67b52dc8b003663cdd03ad Mon Sep 17 00:00:00 2001 From: Ulisses Furquim Date: Mon, 4 Sep 2006 21:10:23 +0000 Subject: Remove connected flag from SDP transaction structure --- include/sdp_lib.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 0e8948f9..dbc836b2 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -126,7 +126,6 @@ typedef enum { * SDP transaction: functions for asynchronous search. */ typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t size, void *udata); -int sdp_is_connected(sdp_session_t *session); sdp_session_t *sdp_create(int sk, uint32_t flags); int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata); int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search, uint16_t max_rec_num); -- cgit From 113a53acaec2519108f0cab944687b7abc537e74 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 5 Sep 2006 09:41:50 +0000 Subject: Remove sdp_cstate_t from the header file --- include/sdp_lib.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'include') diff --git a/include/sdp_lib.h b/include/sdp_lib.h index dbc836b2..34082579 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -592,11 +592,6 @@ void sdp_pattern_add_uuidseq(sdp_record_t *rec, sdp_list_t *seq); int sdp_send_req_w4_rsp(sdp_session_t *session, uint8_t *req, uint8_t *rsp, uint32_t reqsize, uint32_t *rspsize); -typedef struct { - uint8_t length; - unsigned char data[16]; -} __attribute__ ((packed)) sdp_cstate_t; - #ifdef __cplusplus } #endif -- cgit From 8bbf32450b3c72f5e8457feb825da029f3ecc76e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 5 Sep 2006 09:44:32 +0000 Subject: Small code cleanup --- include/sdp_lib.h | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'include') diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 34082579..343493b1 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -94,6 +94,19 @@ typedef struct { void *priv; } sdp_session_t; +typedef enum { + /* + * Attributes are specified as individual elements + */ + SDP_ATTR_REQ_INDIVIDUAL = 1, + /* + * Attributes are specified as a range + */ + SDP_ATTR_REQ_RANGE +} sdp_attrreq_type_t; + +typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t size, void *udata); + /* * create an L2CAP connection to a Bluetooth device * @@ -110,28 +123,18 @@ sdp_session_t *sdp_connect(const bdaddr_t *src, const bdaddr_t *dst, uint32_t fl int sdp_close(sdp_session_t *session); int sdp_get_socket(const sdp_session_t *session); -uint16_t sdp_gen_tid(sdp_session_t *session); - -typedef enum { - /* - * Attributes are specified as individual elements - */ - SDP_ATTR_REQ_INDIVIDUAL = 1, - /* - * Attributes are specified as a range - */ - SDP_ATTR_REQ_RANGE -} sdp_attrreq_type_t; /* * SDP transaction: functions for asynchronous search. */ -typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t size, void *udata); sdp_session_t *sdp_create(int sk, uint32_t flags); +int sdp_process(sdp_session_t *session); int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata); + int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search, uint16_t max_rec_num); int sdp_service_attr_async(sdp_session_t *session, uint32_t handle, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list); int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *search, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list); -int sdp_process(sdp_session_t *session); + +uint16_t sdp_gen_tid(sdp_session_t *session); /* * find all devices in the piconet -- cgit From 5ec20cab698055029198b10afb4db20bee06ce72 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Mon, 11 Sep 2006 20:55:05 +0000 Subject: fixed error handling in sdp_process( ) --- include/sdp_lib.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 343493b1..9a83586f 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -105,6 +105,15 @@ typedef enum { SDP_ATTR_REQ_RANGE } sdp_attrreq_type_t; +/* + * When the pdu_id(type) is a sdp error response, check the status value + * to figure out the error reason. For status values 0x0001-0x0006 check + * Bluetooth SPEC. If the status is 0xffff, call sdp_get_error function + * to get the real reason: + * - wrong transaction ID(EPROTO) + * - wrong PDU id or(EPROTO) + * - I/O error + */ typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t size, void *udata); /* @@ -127,6 +136,7 @@ int sdp_get_socket(const sdp_session_t *session); * SDP transaction: functions for asynchronous search. */ sdp_session_t *sdp_create(int sk, uint32_t flags); +int sdp_get_error(sdp_session_t *session); int sdp_process(sdp_session_t *session); int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata); -- cgit From 82817924a25fb0eaaeb9824372106870c45c9db9 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 7 Nov 2006 18:30:16 +0000 Subject: Add functions for registering binary records --- include/sdp_lib.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 9a83586f..05bfa7d4 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -443,22 +443,25 @@ void sdp_record_free(sdp_record_t *rec); * the service record visible to SDP clients. This function returns 0 * on success or -1 on failure (and sets errno). */ -int sdp_record_register(sdp_session_t *sess, sdp_record_t *rec, uint8_t flags); -int sdp_device_record_register(sdp_session_t *sess, bdaddr_t *device, sdp_record_t *rec, uint8_t flags); +int sdp_device_record_register_binary(sdp_session_t *session, bdaddr_t *device, uint8_t *data, uint32_t size, uint8_t flags, uint32_t *handle); +int sdp_device_record_register(sdp_session_t *session, bdaddr_t *device, sdp_record_t *rec, uint8_t flags); +int sdp_record_register(sdp_session_t *session, sdp_record_t *rec, uint8_t flags); /* * Unregister a service record. */ -int sdp_record_unregister(sdp_session_t *sess, sdp_record_t *rec); -int sdp_device_record_unregister(sdp_session_t *sess, bdaddr_t *device, sdp_record_t *rec); +int sdp_device_record_unregister_binary(sdp_session_t *session, bdaddr_t *device, uint32_t handle); +int sdp_device_record_unregister(sdp_session_t *session, bdaddr_t *device, sdp_record_t *rec); +int sdp_record_unregister(sdp_session_t *session, sdp_record_t *rec); /* * Update an existing service record. (Calling this function * before a previous call to sdp_record_register() will result * in an error.) */ +int sdp_device_record_update_binary(sdp_session_t *session, bdaddr_t *device, uint32_t handle, uint8_t *data, uint32_t size); +int sdp_device_record_update(sdp_session_t *session, bdaddr_t *device, const sdp_record_t *rec); int sdp_record_update(sdp_session_t *sess, const sdp_record_t *rec); -int sdp_device_record_update(sdp_session_t *sess, bdaddr_t *device, const sdp_record_t *rec); void sdp_record_print(const sdp_record_t *rec); -- cgit From 25effaf3a661c4de960ebae7125ba56a990ad628 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 13 Jan 2007 17:50:06 +0000 Subject: Update copyright information --- include/bluetooth.h | 2 +- include/bnep.h | 2 +- include/cmtp.h | 2 +- include/hci.h | 2 +- include/hci_lib.h | 2 +- include/hidp.h | 2 +- include/l2cap.h | 2 +- include/rfcomm.h | 2 +- include/sco.h | 2 +- include/sdp.h | 2 +- include/sdp_lib.h | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index 2ad82a7d..1362ed82 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2006 Marcel Holtmann + * Copyright (C) 2002-2007 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/bnep.h b/include/bnep.h index 13f10015..90b650ea 100644 --- a/include/bnep.h +++ b/include/bnep.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2006 Marcel Holtmann + * Copyright (C) 2002-2007 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/cmtp.h b/include/cmtp.h index 72bd7e13..e81a9ecc 100644 --- a/include/cmtp.h +++ b/include/cmtp.h @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2002-2006 Marcel Holtmann + * Copyright (C) 2002-2007 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hci.h b/include/hci.h index 0454f96e..46f97bb7 100644 --- a/include/hci.h +++ b/include/hci.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2006 Marcel Holtmann + * Copyright (C) 2002-2007 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hci_lib.h b/include/hci_lib.h index 20af8bdb..a784a08b 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2006 Marcel Holtmann + * Copyright (C) 2002-2007 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hidp.h b/include/hidp.h index 71d0150a..580495f5 100644 --- a/include/hidp.h +++ b/include/hidp.h @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2003-2006 Marcel Holtmann + * Copyright (C) 2003-2007 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/l2cap.h b/include/l2cap.h index d2320f46..5c173e28 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2006 Marcel Holtmann + * Copyright (C) 2002-2007 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/rfcomm.h b/include/rfcomm.h index 7537f958..6cdfb614 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2006 Marcel Holtmann + * Copyright (C) 2002-2007 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/sco.h b/include/sco.h index 4777640c..836784a0 100644 --- a/include/sco.h +++ b/include/sco.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2006 Marcel Holtmann + * Copyright (C) 2002-2007 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/sdp.h b/include/sdp.h index f6af1261..8a78ba30 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -4,7 +4,7 @@ * * Copyright (C) 2001-2002 Nokia Corporation * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2006 Marcel Holtmann + * Copyright (C) 2002-2007 Marcel Holtmann * Copyright (C) 2002-2003 Stephen Crane * * diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 05bfa7d4..45f96e4d 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -4,7 +4,7 @@ * * Copyright (C) 2001-2002 Nokia Corporation * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2006 Marcel Holtmann + * Copyright (C) 2002-2007 Marcel Holtmann * Copyright (C) 2002-2003 Stephen Crane * * -- cgit From 5f17af319f0caee2243c5471a6500742ad7d6576 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 5 Mar 2007 20:54:48 +0000 Subject: Export sdp_uuid32_to_uuid128() function --- include/sdp_lib.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 45f96e4d..9a8ab4fd 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -475,6 +475,7 @@ int sdp_uuid16_cmp(const void *p1, const void *p2); int sdp_uuid128_cmp(const void *p1, const void *p2); uuid_t *sdp_uuid_to_uuid128(uuid_t *uuid); void sdp_uuid16_to_uuid128(uuid_t *uuid128, uuid_t *uuid16); +void sdp_uuid32_to_uuid128(uuid_t *uuid128, uuid_t *uuid32); int sdp_uuid128_to_uuid(uuid_t *uuid); int sdp_uuid_to_proto(uuid_t *uuid); int sdp_uuid_extract(const uint8_t *buffer, uuid_t *uuid, int *scanned); -- cgit From 1613675da92e96b4074c381965eb536b7184e8d7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 27 Apr 2007 16:09:46 +0000 Subject: Add ESCO_LINK connection type constant --- include/hci.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 46f97bb7..eb015fc7 100644 --- a/include/hci.h +++ b/include/hci.h @@ -198,6 +198,7 @@ enum { /* Baseband links */ #define SCO_LINK 0x00 #define ACL_LINK 0x01 +#define ESCO_LINK 0x02 /* LMP features */ #define LMP_3SLOT 0x01 -- cgit From a2c6ef2451d7677c976beebe7251ed0de9d3d392 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 26 May 2007 19:21:02 +0000 Subject: Remove variable data from information request structure --- include/l2cap.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/l2cap.h b/include/l2cap.h index 5c173e28..49006803 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -175,7 +175,6 @@ typedef struct { typedef struct { uint16_t type; - uint8_t data[0]; } __attribute__ ((packed)) l2cap_info_req; #define L2CAP_INFO_REQ_SIZE 2 -- cgit From 34c5828e678e244a28b7c3ba7078a08583273aa3 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 16 Jun 2007 11:46:22 +0000 Subject: Add definitions for inquiry power level and erroneous data --- include/hci.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index eb015fc7..327d17a4 100644 --- a/include/hci.h +++ b/include/hci.h @@ -249,8 +249,11 @@ enum { #define LMP_EDR_3S_ESCO 0x80 #define LMP_EXT_INQ 0x01 +#define LMP_ERR_DAT_REP 0x20 +#define LMP_NFLUSH_PKTS 0x40 #define LMP_LSTO 0x01 +#define LMP_INQ_TX_PWR 0x02 #define LMP_EXT_FEAT 0x80 /* Link policies */ -- cgit From 3536636a5b1664499ee0ededd305b9bdc9ddeaa4 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 21 Jun 2007 21:18:00 +0000 Subject: Add common bachk() function --- include/bluetooth.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index 1362ed82..1d377781 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -125,6 +125,7 @@ char *batostr(const bdaddr_t *ba); int ba2str(const bdaddr_t *ba, char *str); int str2ba(const char *str, bdaddr_t *ba); int ba2oui(const bdaddr_t *ba, char *oui); +int bachk(const char *str); int baprintf(const char *format, ...); int bafprintf(FILE *stream, const char *format, ...); -- cgit From e37574cc50749ebaaf19bc4480905b81c589b93e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 22 Jun 2007 17:05:41 +0000 Subject: Add mising HCI event structures --- include/hci.h | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 327d17a4..a32ccdee 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1385,7 +1385,7 @@ typedef struct { } __attribute__ ((packed)) evt_sync_conn_changed; #define EVT_SYNC_CONN_CHANGED_SIZE 9 -#define EVT_SNIFF_SUBRATE 0x2E +#define EVT_SNIFF_SUBRATING 0x2E typedef struct { uint8_t status; uint16_t handle; @@ -1393,8 +1393,8 @@ typedef struct { uint16_t max_rx_latency; uint16_t min_remote_timeout; uint16_t min_local_timeout; -} __attribute__ ((packed)) evt_sniff_subrate; -#define EVT_SNIFF_SUBRATE_SIZE 11 +} __attribute__ ((packed)) evt_sniff_subrating; +#define EVT_SNIFF_SUBRATING_SIZE 11 #define EVT_EXTENDED_INQUIRY_RESULT 0x2F typedef struct { @@ -1408,12 +1408,32 @@ typedef struct { } __attribute__ ((packed)) extended_inquiry_info; #define EXTENDED_INQUIRY_INFO_SIZE 254 -#define EVT_LINK_SUPERVISION_TIMEOUT_CHANGE 0x38 +#define EVT_ENCRYPTION_KEY_REFRESH_COMPLETE 0x30 +typedef struct { + uint8_t status; + uint16_t handle; +} __attribute__ ((packed)) evt_encryption_key_refresh_complete; +#define EVT_ENCRYPTION_KEY_REFRESH_COMPLETE_SIZE 3 + +#define EVT_LINK_SUPERVISION_TIMEOUT_CHANGED 0x38 typedef struct { uint16_t handle; uint16_t timeout; -} __attribute__ ((packed)) evt_link_supervision_timeout_change; -#define EVT_LINK_SUPERVISION_TIMEOUT_SIZE 4 +} __attribute__ ((packed)) evt_link_supervision_timeout_changed; +#define EVT_LINK_SUPERVISION_TIMEOUT_CHANGED_SIZE 4 + +#define EVT_ENHANCED_FLUSH_COMPLETE 0x39 +typedef struct { + uint16_t handle; +} __attribute__ ((packed)) evt_enhanced_flush_complete; +#define EVT_ENHANCED_FLUSH_COMPLETE_SIZE 2 + +#define EVT_REMOTE_HOST_FEATURES_NOTIFY 0x3D +typedef struct { + bdaddr_t bdaddr; + uint8_t features[8]; +} __attribute__ ((packed)) evt_remote_host_features_notify; +#define EVT_REMOTE_HOST_FEATURES_NOTIFY_SIZE 14 #define EVT_TESTING 0xFE -- cgit From 668600a6e16d3d84b4d256c5ed44491d6301ec4a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 22 Jun 2007 17:41:53 +0000 Subject: Add mising HCI commands structures --- include/hci.h | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index a32ccdee..906bbb4b 100644 --- a/include/hci.h +++ b/include/hci.h @@ -577,14 +577,14 @@ typedef struct { #define OCF_WRITE_DEFAULT_LINK_POLICY 0x000F -#define OCF_SNIFF_SUBRATE 0x0011 +#define OCF_SNIFF_SUBRATING 0x0011 typedef struct { uint16_t handle; uint16_t max_latency; uint16_t min_remote_timeout; uint16_t min_local_timeout; -} __attribute__ ((packed)) sniff_subrate_cp; -#define SNIFF_SUBRATE_CP_SIZE 8 +} __attribute__ ((packed)) sniff_subrating_cp; +#define SNIFF_SUBRATING_CP_SIZE 8 /* Host Controller and Baseband */ #define OGF_HOST_CTL 0x03 @@ -968,6 +968,57 @@ typedef struct { } __attribute__ ((packed)) write_ext_inquiry_response_rp; #define WRITE_EXT_INQUIRY_RESPONSE_RP_SIZE 1 +#define OCF_REFRESH_ENCRYPTION_KEY 0x0053 +typedef struct { + uint16_t handle; +} __attribute__ ((packed)) refresh_encryption_key_cp; +#define REFRESH_ENCRYPTION_KEY_CP_SIZE 2 +typedef struct { + uint8_t status; +} __attribute__ ((packed)) refresh_encryption_key_rp; +#define REFRESH_ENCRYPTION_KEY_RP_SIZE 1 + +#define OCF_READ_INQUIRY_TRANSMIT_POWER_LEVEL 0x0058 +typedef struct { + uint8_t status; + int8_t level; +} __attribute__ ((packed)) read_inquiry_transmit_power_level_rp; +#define READ_INQUIRY_TRANSMIT_POWER_LEVEL_RP_SIZE 2 + +#define OCF_WRITE_INQUIRY_TRANSMIT_POWER_LEVEL 0x0059 +typedef struct { + int8_t level; +} __attribute__ ((packed)) write_inquiry_transmit_power_level_cp; +#define WRITE_INQUIRY_TRANSMIT_POWER_LEVEL_CP_SIZE 1 +typedef struct { + uint8_t status; +} __attribute__ ((packed)) write_inquiry_transmit_power_level_rp; +#define WRITE_INQUIRY_TRANSMIT_POWER_LEVEL_RP_SIZE 1 + +#define OCF_READ_DEFAULT_ERROR_DATA_REPORTING 0x005A +typedef struct { + uint8_t status; + uint8_t reporting; +} __attribute__ ((packed)) read_default_error_data_reporting_rp; +#define READ_DEFAULT_ERROR_DATA_REPORTING_RP_SIZE 2 + +#define OCF_WRITE_DEFAULT_ERROR_DATA_REPORTING 0x005B +typedef struct { + uint8_t reporting; +} __attribute__ ((packed)) write_default_error_data_reporting_cp; +#define WRITE_DEFAULT_ERROR_DATA_REPORTING_CP_SIZE 1 +typedef struct { + uint8_t status; +} __attribute__ ((packed)) write_default_error_data_reporting_rp; +#define WRITE_DEFAULT_ERROR_DATA_REPORTING_RP_SIZE 1 + +#define OCF_ENHANCED_FLUSH 0x005F +typedef struct { + uint16_t handle; + uint8_t type; +} __attribute__ ((packed)) enhanced_flush_cp; +#define ENHANCED_FLUSH_CP_SIZE 3 + /* Informational Parameters */ #define OGF_INFO_PARAM 0x04 -- cgit From 08b3ddeeff510f9ac61c860a74d13575a47420b7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 26 Jul 2007 08:25:50 +0000 Subject: Update HCI command table --- include/hci.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 906bbb4b..eaab3964 100644 --- a/include/hci.h +++ b/include/hci.h @@ -577,6 +577,8 @@ typedef struct { #define OCF_WRITE_DEFAULT_LINK_POLICY 0x000F +#define OCF_FLOW_SPECIFICATION 0x0010 + #define OCF_SNIFF_SUBRATING 0x0011 typedef struct { uint16_t handle; -- cgit From a3cc218cd5f213922cd529ebfb5da5ba1b1f1aca Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 1 Aug 2007 07:29:23 +0000 Subject: Add definitions and functions for Simple Pairing --- include/hci.h | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ include/hci_lib.h | 3 ++ 2 files changed, 157 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index eaab3964..a4f88146 100644 --- a/include/hci.h +++ b/include/hci.h @@ -188,6 +188,8 @@ enum { #define HCI_SLOT_VIOLATION 0x34 #define HCI_ROLE_SWITCH_FAILED 0x35 #define HCI_EIR_TOO_LARGE 0x36 +#define HCI_SIMPLE_PAIRING_NOT_SUPPORTED 0x37 +#define HCI_HOST_BUSY_PAIRING 0x38 /* ACL flags */ #define ACL_CONT 0x01 @@ -249,6 +251,8 @@ enum { #define LMP_EDR_3S_ESCO 0x80 #define LMP_EXT_INQ 0x01 +#define LMP_SIMPLE_PAIR 0x08 +#define LMP_ENCAPS_PDU 0x10 #define LMP_ERR_DAT_REP 0x20 #define LMP_NFLUSH_PKTS 0x40 @@ -473,6 +477,49 @@ typedef struct { } __attribute__ ((packed)) reject_sync_conn_req_cp; #define REJECT_SYNC_CONN_REQ_CP_SIZE 7 +#define OCF_IO_CAPABILITY_REPLY 0x002B +typedef struct { + bdaddr_t bdaddr; + uint8_t capability; + uint8_t oob_data; + uint8_t authentication; +} __attribute__ ((packed)) io_capability_reply_cp; +#define IO_CAPABILITY_REPLY_CP_SIZE 9 + +#define OCF_USER_CONFIRM_REPLY 0x002C +typedef struct { + bdaddr_t bdaddr; +} __attribute__ ((packed)) user_confirm_reply_cp; +#define USER_CONFIRM_REPLY_CP_SIZE 6 + +#define OCF_USER_CONFIRM_NEG_REPLY 0x002D + +#define OCF_USER_PASSKEY_REPLY 0x002E +typedef struct { + bdaddr_t bdaddr; + uint32_t passkey; +} __attribute__ ((packed)) user_passkey_reply_cp; +#define USER_PASSKEY_REPLY_CP_SIZE 10 + +#define OCF_USER_PASSKEY_NEG_REPLY 0x002F + +#define OCF_REMOTE_OOB_DATA_REPLY 0x0030 +typedef struct { + bdaddr_t bdaddr; + uint8_t hash[16]; + uint8_t randomizer[16]; +} __attribute__ ((packed)) remote_oob_data_reply_cp; +#define REMOTE_OOB_DATA_REPLY_CP_SIZE 38 + +#define OCF_REMOTE_OOB_DATA_NEG_REPLY 0x0033 + +#define OCF_IO_CAPABILITY_NEG_REPLY 0x0034 +typedef struct { + bdaddr_t bdaddr; + uint8_t reason; +} __attribute__ ((packed)) io_capability_neg_reply_cp; +#define IO_CAPABILITY_NEG_REPLY_CP_SIZE 7 + /* Link Policy */ #define OGF_LINK_POLICY 0x02 @@ -980,6 +1027,31 @@ typedef struct { } __attribute__ ((packed)) refresh_encryption_key_rp; #define REFRESH_ENCRYPTION_KEY_RP_SIZE 1 +#define OCF_READ_SIMPLE_PAIRING_MODE 0x0055 +typedef struct { + uint8_t status; + uint8_t mode; +} __attribute__ ((packed)) read_simple_pairing_mode_rp; +#define READ_SIMPLE_PAIRING_MODE_RP_SIZE 2 + +#define OCF_WRITE_SIMPLE_PAIRING_MODE 0x0056 +typedef struct { + uint8_t mode; +} __attribute__ ((packed)) write_simple_pairing_mode_cp; +#define WRITE_SIMPLE_PAIRING_MODE_CP_SIZE 1 +typedef struct { + uint8_t status; +} __attribute__ ((packed)) write_simple_pairing_mode_rp; +#define WRITE_SIMPLE_PAIRING_MODE_RP_SIZE 1 + +#define OCF_READ_LOCAL_OOB_DATA 0x0057 +typedef struct { + uint8_t status; + uint8_t hash[16]; + uint8_t randomizer[16]; +} __attribute__ ((packed)) read_local_oob_data_rp; +#define READ_LOCAL_OOB_DATA_RP_SIZE 33 + #define OCF_READ_INQUIRY_TRANSMIT_POWER_LEVEL 0x0058 typedef struct { uint8_t status; @@ -1021,6 +1093,17 @@ typedef struct { } __attribute__ ((packed)) enhanced_flush_cp; #define ENHANCED_FLUSH_CP_SIZE 3 +#define OCF_SEND_KEYPRESS_NOTIFY 0x0060 +typedef struct { + bdaddr_t bdaddr; + uint8_t type; +} __attribute__ ((packed)) send_keypress_notify_cp; +#define SEND_KEYPRESS_NOTIFY_CP_SIZE 7 +typedef struct { + uint8_t status; +} __attribute__ ((packed)) send_keypress_notify_rp; +#define SEND_KEYPRESS_NOTIFY_RP_SIZE 1 + /* Informational Parameters */ #define OGF_INFO_PARAM 0x04 @@ -1141,6 +1224,22 @@ typedef struct { /* Testing commands */ #define OGF_TESTING_CMD 0x3e +#define OCF_READ_LOOPBACK_MODE 0x0001 + +#define OCF_WRITE_LOOPBACK_MODE 0x0002 + +#define OCF_ENABLE_DEVICE_UNDER_TEST_MODE 0x0003 + +#define OCF_WRITE_SIMPLE_PAIRING_DEBUG_MODE 0x0004 +typedef struct { + uint8_t mode; +} __attribute__ ((packed)) write_simple_pairing_debug_mode_cp; +#define WRITE_SIMPLE_PAIRING_DEBUG_MODE_CP_SIZE 1 +typedef struct { + uint8_t status; +} __attribute__ ((packed)) write_simple_pairing_debug_mode_rp; +#define WRITE_SIMPLE_PAIRING_DEBUG_MODE_RP_SIZE 1 + /* Vendor specific commands */ #define OGF_VENDOR_CMD 0x3f @@ -1468,6 +1567,47 @@ typedef struct { } __attribute__ ((packed)) evt_encryption_key_refresh_complete; #define EVT_ENCRYPTION_KEY_REFRESH_COMPLETE_SIZE 3 +#define EVT_IO_CAPABILITY_REQUEST 0x31 +typedef struct { + bdaddr_t bdaddr; +} __attribute__ ((packed)) evt_io_capability_request; +#define EVT_IO_CAPABILITY_REQUEST_SIZE 6 + +#define EVT_IO_CAPABILITY_RESPONSE 0x32 +typedef struct { + bdaddr_t bdaddr; + uint8_t capability; + uint8_t oob_data; + uint8_t authentication; +} __attribute__ ((packed)) evt_io_capability_response; +#define EVT_IO_CAPABILITY_RESPONSE_SIZE 9 + +#define EVT_USER_CONFIRM_REQUEST 0x33 +typedef struct { + bdaddr_t bdaddr; + uint32_t passkey; +} __attribute__ ((packed)) evt_user_confirm_request; +#define EVT_USER_CONFIRM_REQUEST_SIZE 10 + +#define EVT_USER_PASSKEY_REQUEST 0x34 +typedef struct { + bdaddr_t bdaddr; +} __attribute__ ((packed)) evt_user_passkey_request; +#define EVT_USER_PASSKEY_REQUEST_SIZE 6 + +#define EVT_REMOTE_OOB_DATA_REQUEST 0x35 +typedef struct { + bdaddr_t bdaddr; +} __attribute__ ((packed)) evt_remote_oob_data_request; +#define EVT_REMOTE_OOB_DATA_REQUEST_SIZE 6 + +#define EVT_SIMPLE_PAIRING_COMPLETE 0x36 +typedef struct { + uint8_t status; + bdaddr_t bdaddr; +} __attribute__ ((packed)) evt_simple_pairing_complete; +#define EVT_SIMPLE_PAIRING_COMPLETE_SIZE 7 + #define EVT_LINK_SUPERVISION_TIMEOUT_CHANGED 0x38 typedef struct { uint16_t handle; @@ -1481,6 +1621,20 @@ typedef struct { } __attribute__ ((packed)) evt_enhanced_flush_complete; #define EVT_ENHANCED_FLUSH_COMPLETE_SIZE 2 +#define EVT_USER_PASSKEY_NOTIFY 0x3B +typedef struct { + bdaddr_t bdaddr; + uint32_t passkey; +} __attribute__ ((packed)) evt_user_passkey_notify; +#define EVT_USER_PASSKEY_NOTIFY_SIZE 10 + +#define EVT_KEYPRESS_NOTIFY 0x3C +typedef struct { + bdaddr_t bdaddr; + uint8_t type; +} __attribute__ ((packed)) evt_keypress_notify; +#define EVT_KEYPRESS_NOTIFY_SIZE 7 + #define EVT_REMOTE_HOST_FEATURES_NOTIFY 0x3D typedef struct { bdaddr_t bdaddr; diff --git a/include/hci_lib.h b/include/hci_lib.h index a784a08b..1215a62f 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -98,6 +98,9 @@ int hci_read_afh_mode(int dd, uint8_t *mode, int to); int hci_write_afh_mode(int dd, uint8_t mode, int to); int hci_read_ext_inquiry_response(int dd, uint8_t *fec, uint8_t *data, int to); int hci_write_ext_inquiry_response(int dd, uint8_t fec, uint8_t *data, int to); +int hci_read_simple_pairing_mode(int dd, uint8_t *mode, int to); +int hci_write_simple_pairing_mode(int dd, uint8_t mode, int to); +int hci_read_local_oob_data(int dd, uint8_t *hash, uint8_t *randomizer, int to); int hci_read_transmit_power_level(int dd, uint16_t handle, uint8_t type, int8_t *level, int to); int hci_read_link_supervision_timeout(int dd, uint16_t handle, uint16_t *timeout, int to); int hci_write_link_supervision_timeout(int dd, uint16_t handle, uint16_t timeout, int to); -- cgit From 4c6bbf0a08426efd008c1b9e439c693a826ee708 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 22 Aug 2007 00:31:24 +0000 Subject: Extract main service class for later use --- include/sdp.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/sdp.h b/include/sdp.h index 8a78ba30..05572c06 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -457,11 +457,12 @@ typedef struct { typedef struct { uint32_t handle; - /* - * Search pattern: a sequence of all UUIDs seen in this record - */ + /* Search pattern: a sequence of all UUIDs seen in this record */ sdp_list_t *pattern; sdp_list_t *attrlist; + + /* Main service class for Extended Inquiry Response */ + uuid_t svclass; } sdp_record_t; typedef struct sdp_data_struct sdp_data_t; -- cgit From 302330d72bbdc03f33090747ae4b13110ec3a9c4 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 16 Sep 2007 10:54:46 +0000 Subject: Add L2CAP mode constants --- include/l2cap.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/l2cap.h b/include/l2cap.h index 49006803..478819ec 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -161,6 +161,10 @@ typedef struct { #define L2CAP_CONF_MAX_SIZE 22 +#define L2CAP_MODE_BASIC 0x00 +#define L2CAP_MODE_RETRANS 0x01 +#define L2CAP_MODE_FLOWCTL 0x02 + typedef struct { uint16_t dcid; uint16_t scid; -- cgit From f4afe8ea387410929ee303a510fd7cdfd1cc7552 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 5 Oct 2007 11:23:35 +0000 Subject: Add support for inquiry transmit power level --- include/hci_lib.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index 1215a62f..7b728283 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -101,6 +101,8 @@ int hci_write_ext_inquiry_response(int dd, uint8_t fec, uint8_t *data, int to); int hci_read_simple_pairing_mode(int dd, uint8_t *mode, int to); int hci_write_simple_pairing_mode(int dd, uint8_t mode, int to); int hci_read_local_oob_data(int dd, uint8_t *hash, uint8_t *randomizer, int to); +int hci_read_inquiry_transmit_power_level(int dd, int8_t *level, int to); +int hci_write_inquiry_transmit_power_level(int dd, int8_t level, int to); int hci_read_transmit_power_level(int dd, uint16_t handle, uint8_t type, int8_t *level, int to); int hci_read_link_supervision_timeout(int dd, uint16_t handle, uint16_t *timeout, int to); int hci_write_link_supervision_timeout(int dd, uint16_t handle, uint16_t timeout, int to); -- cgit From 37651dd5c06b2e176f4bfdc99f5702e55a520ee9 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 24 Oct 2007 21:16:46 +0000 Subject: Add constant for Bluetooth socket options level --- include/bluetooth.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index 1d377781..d483d904 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -41,6 +41,10 @@ extern "C" { #define PF_BLUETOOTH AF_BLUETOOTH #endif +#ifndef SOL_BLUETOOTH +#define SOL_BLUETOOTH 274 +#endif + #define BTPROTO_L2CAP 0 #define BTPROTO_HCI 1 #define BTPROTO_SCO 2 -- cgit From 1622daf2f8fa0abeb0a11be14558ed30a17fc044 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 25 Dec 2007 20:35:41 +0000 Subject: Add definitions for MDP --- include/sdp.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/sdp.h b/include/sdp.h index 05572c06..61cc2637 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -138,6 +138,9 @@ extern "C" { #define VIDEO_SOURCE_SVCLASS_ID 0x1303 #define VIDEO_SINK_SVCLASS_ID 0x1304 #define VIDEO_DISTRIBUTION_SVCLASS_ID 0x1305 +#define MDP_SVCLASS_ID 0x1400 +#define MDP_SOURCE_SVCLASS_ID 0x1401 +#define MDP_SINK_SVCLASS_ID 0x1402 #define APPLE_AGENT_SVCLASS_ID 0x2112 /* @@ -207,6 +210,9 @@ extern "C" { #define VIDEO_SOURCE_PROFILE_ID VIDEO_SOURCE_SVCLASS_ID #define VIDEO_SINK_PROFILE_ID VIDEO_SINK_SVCLASS_ID #define VIDEO_DISTRIBUTION_PROFILE_ID VIDEO_DISTRIBUTION_SVCLASS_ID +#define MDP_PROFILE_ID MDP_SVCLASS_ID +#define MDP_SOURCE_PROFILE_ID MDP_SROUCE_SVCLASS_ID +#define MDP_SINK_PROFILE_ID MDP_SINK_SVCLASS_ID #define APPLE_AGENT_PROFILE_ID APPLE_AGENT_SVCLASS_ID /* -- cgit From 7208028266fc19d380ac77c97c46b6f2fdc80e1d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 2 Feb 2008 03:11:09 +0000 Subject: Update copyright information --- include/bluetooth.h | 2 +- include/bnep.h | 2 +- include/cmtp.h | 2 +- include/hci.h | 2 +- include/hci_lib.h | 2 +- include/hidp.h | 2 +- include/l2cap.h | 2 +- include/rfcomm.h | 2 +- include/sco.h | 2 +- include/sdp.h | 2 +- include/sdp_lib.h | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/bluetooth.h b/include/bluetooth.h index d483d904..d886cb80 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2007 Marcel Holtmann + * Copyright (C) 2002-2008 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/bnep.h b/include/bnep.h index 90b650ea..75eaac05 100644 --- a/include/bnep.h +++ b/include/bnep.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2007 Marcel Holtmann + * Copyright (C) 2002-2008 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/cmtp.h b/include/cmtp.h index e81a9ecc..16add1d2 100644 --- a/include/cmtp.h +++ b/include/cmtp.h @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2002-2007 Marcel Holtmann + * Copyright (C) 2002-2008 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hci.h b/include/hci.h index a4f88146..92c3a447 100644 --- a/include/hci.h +++ b/include/hci.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2007 Marcel Holtmann + * Copyright (C) 2002-2008 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hci_lib.h b/include/hci_lib.h index 7b728283..b2b78e80 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2007 Marcel Holtmann + * Copyright (C) 2002-2008 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hidp.h b/include/hidp.h index 580495f5..74da6897 100644 --- a/include/hidp.h +++ b/include/hidp.h @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2003-2007 Marcel Holtmann + * Copyright (C) 2003-2008 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/l2cap.h b/include/l2cap.h index 478819ec..d54e74d2 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2007 Marcel Holtmann + * Copyright (C) 2002-2008 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/rfcomm.h b/include/rfcomm.h index 6cdfb614..5c4751ea 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2007 Marcel Holtmann + * Copyright (C) 2002-2008 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/sco.h b/include/sco.h index 836784a0..bce7098f 100644 --- a/include/sco.h +++ b/include/sco.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2007 Marcel Holtmann + * Copyright (C) 2002-2008 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/sdp.h b/include/sdp.h index 61cc2637..293e6ec8 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -4,7 +4,7 @@ * * Copyright (C) 2001-2002 Nokia Corporation * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2007 Marcel Holtmann + * Copyright (C) 2002-2008 Marcel Holtmann * Copyright (C) 2002-2003 Stephen Crane * * diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 9a8ab4fd..eac2fe6d 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -4,7 +4,7 @@ * * Copyright (C) 2001-2002 Nokia Corporation * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2007 Marcel Holtmann + * Copyright (C) 2002-2008 Marcel Holtmann * Copyright (C) 2002-2003 Stephen Crane * * -- cgit From f767416e71484be2463caa6482dc978e165cabae Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 5 Mar 2008 19:30:32 +0000 Subject: Add support for MCAP UUIDs --- include/sdp.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/sdp.h b/include/sdp.h index 293e6ec8..dd5b0e24 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -69,6 +69,8 @@ extern "C" { #define AVDTP_UUID 0x0019 #define CMTP_UUID 0x001b #define UDI_UUID 0x001d +#define MCAP_CTRL_UUID 0x001e +#define MCAP_DATA_UUID 0x001f #define L2CAP_UUID 0x0100 /* -- cgit From 237531ab9c9e06a131b34d6524bab659d8147fdf Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 15 May 2008 15:33:36 +0000 Subject: Add OCF constants for synchronous flow control enabling --- include/hci.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 92c3a447..6e295be3 100644 --- a/include/hci.h +++ b/include/hci.h @@ -869,6 +869,10 @@ typedef struct { } __attribute__ ((packed)) read_transmit_power_level_rp; #define READ_TRANSMIT_POWER_LEVEL_RP_SIZE 4 +#define OCF_READ_SYNC_FLOW_ENABLE 0x002E + +#define OCF_WRITE_SYNC_FLOW_ENABLE 0x002F + #define OCF_SET_CONTROLLER_TO_HOST_FC 0x0031 #define OCF_HOST_BUFFER_SIZE 0x0033 -- cgit From a39a1b4c3e075e80d05caad61646a352693f5455 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 12 Jun 2008 21:40:14 +0000 Subject: Add functions for reading and writing the link policy settings --- include/hci_lib.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/hci_lib.h b/include/hci_lib.h index b2b78e80..ccd155a5 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -104,6 +104,8 @@ int hci_read_local_oob_data(int dd, uint8_t *hash, uint8_t *randomizer, int to); int hci_read_inquiry_transmit_power_level(int dd, int8_t *level, int to); int hci_write_inquiry_transmit_power_level(int dd, int8_t level, int to); int hci_read_transmit_power_level(int dd, uint16_t handle, uint8_t type, int8_t *level, int to); +int hci_read_link_policy(int dd, uint16_t handle, uint16_t *policy, int to); +int hci_write_link_policy(int dd, uint16_t handle, uint16_t policy, int to); int hci_read_link_supervision_timeout(int dd, uint16_t handle, uint16_t *timeout, int to); int hci_write_link_supervision_timeout(int dd, uint16_t handle, uint16_t timeout, int to); int hci_set_afh_classification(int dd, uint8_t *map, int to); -- cgit From 1c2202809e5da072ac3cf8b832b5ae310369bad6 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 16 Jun 2008 01:23:58 +0000 Subject: Add definition for authentication requirements --- include/hci.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/hci.h b/include/hci.h index 6e295be3..499f1bdd 100644 --- a/include/hci.h +++ b/include/hci.h @@ -83,6 +83,7 @@ enum { #define HCIGETDEVINFO _IOR('H', 211, int) #define HCIGETCONNLIST _IOR('H', 212, int) #define HCIGETCONNINFO _IOR('H', 213, int) +#define HCIGETAUTHINFO _IOR('H', 215, int) #define HCISETRAW _IOW('H', 220, int) #define HCISETSCAN _IOW('H', 221, int) @@ -1813,6 +1814,11 @@ struct hci_conn_info_req { struct hci_conn_info conn_info[0]; }; +struct hci_auth_info_req { + bdaddr_t bdaddr; + uint8_t type; +}; + struct hci_inquiry_req { uint16_t dev_id; uint16_t flags; -- cgit From a3648e0df0ff53fef74e5437ff089aef96209db2 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 20 Jun 2008 03:30:53 +0000 Subject: Add more safe version of three low-level extraction functions --- include/sdp_lib.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/sdp_lib.h b/include/sdp_lib.h index eac2fe6d..2323abfc 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -479,6 +479,7 @@ void sdp_uuid32_to_uuid128(uuid_t *uuid128, uuid_t *uuid32); int sdp_uuid128_to_uuid(uuid_t *uuid); int sdp_uuid_to_proto(uuid_t *uuid); int sdp_uuid_extract(const uint8_t *buffer, uuid_t *uuid, int *scanned); +int sdp_uuid_extract_safe(const uint8_t *buffer, int bufsize, uuid_t *uuid, int *scanned); void sdp_uuid_print(const uuid_t *uuid); #define MAX_LEN_UUID_STR 37 @@ -601,8 +602,10 @@ int sdp_gen_pdu(sdp_buf_t *pdu, sdp_data_t *data); int sdp_gen_record_pdu(const sdp_record_t *rec, sdp_buf_t *pdu); int sdp_extract_seqtype(const uint8_t *buf, uint8_t *dtdp, int *seqlen); +int sdp_extract_seqtype_safe(const uint8_t *buf, int bufsize, uint8_t *dtdp, int *size); sdp_data_t *sdp_extract_attr(const uint8_t *pdata, int *extractedLength, sdp_record_t *rec); +sdp_data_t *sdp_extract_attr_safe(const uint8_t *pdata, int bufsize, int *extractedLength, sdp_record_t *rec); void sdp_pattern_add_uuid(sdp_record_t *rec, uuid_t *uuid); void sdp_pattern_add_uuidseq(sdp_record_t *rec, sdp_list_t *seq); -- cgit From 0e1789b3f1897512eb30d63c8e9803f1461446c1 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 22 Jun 2008 21:59:42 +0000 Subject: Add safe version of sdp_extract_pdu function --- include/sdp_lib.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 2323abfc..8df540c6 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -585,9 +585,11 @@ static inline int sdp_get_icon_url(const sdp_record_t *rec, char *str, int len) return sdp_get_string_attr(rec, SDP_ATTR_ICON_URL, str, len); } -sdp_record_t *sdp_extract_pdu(const uint8_t *pdata, int *scanned); sdp_data_t *sdp_extract_string(uint8_t *, int *); +sdp_record_t *sdp_extract_pdu(const uint8_t *pdata, int *scanned); +sdp_record_t *sdp_extract_pdu_safe(const uint8_t *pdata, int bufsize, int *scanned); + void sdp_data_print(sdp_data_t *data); void sdp_print_service_attr(sdp_list_t *alist); -- cgit From 66e753bae1b6dd26ba78efdf345f45c362bb2463 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 22 Jun 2008 22:02:27 +0000 Subject: Remove sdp_extract_string prototype --- include/sdp_lib.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 8df540c6..143056f6 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -585,8 +585,6 @@ static inline int sdp_get_icon_url(const sdp_record_t *rec, char *str, int len) return sdp_get_string_attr(rec, SDP_ATTR_ICON_URL, str, len); } -sdp_data_t *sdp_extract_string(uint8_t *, int *); - sdp_record_t *sdp_extract_pdu(const uint8_t *pdata, int *scanned); sdp_record_t *sdp_extract_pdu_safe(const uint8_t *pdata, int bufsize, int *scanned); -- cgit From dbd0371b179c7fc4a6dae79ad66d149eff7687c9 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 10 Jul 2008 01:42:07 +0000 Subject: Avoid the include of --- include/bnep.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/bnep.h b/include/bnep.h index 75eaac05..92c66c14 100644 --- a/include/bnep.h +++ b/include/bnep.h @@ -29,9 +29,12 @@ extern "C" { #endif -#include #include +#ifndef ETH_ALEN +#define ETH_ALEN 6 /* from */ +#endif + /* BNEP UUIDs */ #define BNEP_BASE_UUID 0x0000000000001000800000805F9B34FB #define BNEP_UUID16 0x02 -- cgit