From d18e1ad69c28b2288afbcb3c55d51fd134b54428 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 8 Jan 2014 19:39:09 -0800 Subject: [PATCH] shared: Add skeleton for generic IO framework --- Makefile.am | 2 ++ Makefile.tools | 5 +++++ android/Android.mk | 1 + android/Makefile.am | 2 ++ src/shared/io-glib.c | 28 ++++++++++++++++++++++++++++ src/shared/io.h | 23 +++++++++++++++++++++++ src/shared/mgmt.c | 1 + 7 files changed, 62 insertions(+) create mode 100644 src/shared/io-glib.c create mode 100644 src/shared/io.h diff --git a/Makefile.am b/Makefile.am index 07492b03d..23516b9e7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -149,6 +149,7 @@ src_bluetoothd_SOURCES = $(builtin_sources) \ src/device.h src/device.c src/attio.h \ src/dbus-common.c src/dbus-common.h \ src/eir.h src/eir.c \ + src/shared/io.h src/shared/io-glib.c \ src/shared/queue.h src/shared/queue.c \ src/shared/util.h src/shared/util.c \ src/shared/mgmt.h src/shared/mgmt.c @@ -238,6 +239,7 @@ unit_test_crc_LDADD = @GLIB_LIBS@ unit_tests += unit/test-mgmt unit_test_mgmt_SOURCES = unit/test-mgmt.c \ + src/shared/io.h src/shared/io-glib.c \ src/shared/queue.h src/shared/queue.c \ src/shared/util.h src/shared/util.c \ src/shared/mgmt.h src/shared/mgmt.c diff --git a/Makefile.tools b/Makefile.tools index 32e08c333..ec1499a14 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -61,6 +61,7 @@ tools_3dsp_SOURCES = tools/3dsp.c monitor/bt.h \ tools_mgmt_tester_SOURCES = tools/mgmt-tester.c monitor/bt.h \ emulator/btdev.h emulator/btdev.c \ emulator/bthost.h emulator/bthost.c \ + src/shared/io.h src/shared/io-glib.c \ src/shared/queue.h src/shared/queue.c \ src/shared/util.h src/shared/util.c \ src/shared/mgmt.h src/shared/mgmt.c \ @@ -71,6 +72,7 @@ tools_mgmt_tester_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ tools_l2cap_tester_SOURCES = tools/l2cap-tester.c monitor/bt.h \ emulator/btdev.h emulator/btdev.c \ emulator/bthost.h emulator/bthost.c \ + src/shared/io.h src/shared/io-glib.c \ src/shared/queue.h src/shared/queue.c \ src/shared/util.h src/shared/util.c \ src/shared/mgmt.h src/shared/mgmt.c \ @@ -81,6 +83,7 @@ tools_l2cap_tester_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ tools_smp_tester_SOURCES = tools/smp-tester.c monitor/bt.h \ emulator/btdev.h emulator/btdev.c \ emulator/bthost.h emulator/bthost.c \ + src/shared/io.h src/shared/io-glib.c \ src/shared/queue.h src/shared/queue.c \ src/shared/util.h src/shared/util.c \ src/shared/mgmt.h src/shared/mgmt.c \ @@ -98,6 +101,7 @@ tools_gap_tester_LDADD = gdbus/libgdbus-internal.la @GLIB_LIBS@ @DBUS_LIBS@ tools_sco_tester_SOURCES = tools/sco-tester.c monitor/bt.h \ emulator/btdev.h emulator/btdev.c \ emulator/bthost.h emulator/bthost.c \ + src/shared/io.h src/shared/io-glib.c \ src/shared/queue.h src/shared/queue.c \ src/shared/util.h src/shared/util.c \ src/shared/mgmt.h src/shared/mgmt.c \ @@ -219,6 +223,7 @@ tools_hwdb_LDADD = lib/libbluetooth-internal.la tools_hcieventmask_LDADD = lib/libbluetooth-internal.la tools_btmgmt_SOURCES = tools/btmgmt.c src/glib-helper.c src/eir.c \ + src/shared/io.h src/shared/io-glib.c \ src/shared/queue.h src/shared/queue.c \ src/shared/util.h src/shared/util.c \ src/shared/mgmt.h src/shared/mgmt.c diff --git a/android/Android.mk b/android/Android.mk index dc9a7b21a..99882bb1f 100644 --- a/android/Android.mk +++ b/android/Android.mk @@ -34,6 +34,7 @@ LOCAL_SRC_FILES := \ ../src/shared/mgmt.c \ ../src/shared/util.c \ ../src/shared/queue.c \ + ../src/shared/io-glib.c \ ../src/sdpd-database.c \ ../src/sdpd-service.c \ ../src/sdpd-request.c \ diff --git a/android/Makefile.am b/android/Makefile.am index 77e343edc..f91d8eb94 100644 --- a/android/Makefile.am +++ b/android/Makefile.am @@ -21,6 +21,7 @@ android_bluetoothd_SOURCES = android/main.c \ src/sdpd-service.c src/sdpd-request.c \ src/glib-helper.h src/glib-helper.c \ src/eir.h src/eir.c \ + src/shared/io.h src/shared/io-glib.c \ src/shared/queue.h src/shared/queue.c \ src/shared/util.h src/shared/util.c \ src/shared/mgmt.h src/shared/mgmt.c \ @@ -97,6 +98,7 @@ noinst_PROGRAMS += android/android-tester android_android_tester_SOURCES = emulator/btdev.h emulator/btdev.c \ emulator/bthost.h emulator/bthost.c \ + src/shared/io.h src/shared/io-glib.c \ src/shared/queue.h src/shared/queue.c \ src/shared/util.h src/shared/util.c \ src/shared/mgmt.h src/shared/mgmt.c \ diff --git a/src/shared/io-glib.c b/src/shared/io-glib.c new file mode 100644 index 000000000..8a7fb9a6c --- /dev/null +++ b/src/shared/io-glib.c @@ -0,0 +1,28 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2012 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "src/shared/io.h" diff --git a/src/shared/io.h b/src/shared/io.h new file mode 100644 index 000000000..29ead9c18 --- /dev/null +++ b/src/shared/io.h @@ -0,0 +1,23 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2012 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + diff --git a/src/shared/mgmt.c b/src/shared/mgmt.c index 8e352151c..45fb0df3b 100644 --- a/src/shared/mgmt.c +++ b/src/shared/mgmt.c @@ -36,6 +36,7 @@ #include "lib/mgmt.h" #include "lib/hci.h" +#include "src/shared/io.h" #include "src/shared/queue.h" #include "src/shared/util.h" #include "src/shared/mgmt.h" -- 2.47.3