From 8b7097fd209ab065f8a9c8ff6dfaf6f4ffa29f03 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Mon, 14 Sep 2015 17:48:26 +0200 Subject: [PATCH] Bluetooth: Make parts of GATT API internal Move parts of the API that are not usable for applications to an internal header. Change-Id: Idbcd3db8acda74375ea9deec2bf3d7eddc8a4ddb Signed-off-by: Szymon Janc --- include/bluetooth/gatt.h | 22 -------------------- net/bluetooth/att.c | 1 + net/bluetooth/gatt.c | 1 + net/bluetooth/gatt_internal.h | 38 +++++++++++++++++++++++++++++++++++ 4 files changed, 40 insertions(+), 22 deletions(-) create mode 100644 net/bluetooth/gatt_internal.h diff --git a/include/bluetooth/gatt.h b/include/bluetooth/gatt.h index f6cd1deff25..8e735fb0e6d 100644 --- a/include/bluetooth/gatt.h +++ b/include/bluetooth/gatt.h @@ -615,28 +615,6 @@ int bt_gatt_attr_read_cep(struct bt_conn *conn, */ void bt_gatt_notify(uint16_t handle, const void *data, uint16_t len); -/** @brief connected callback. - * - * @param conn Connection object. - */ -void bt_gatt_connected(struct bt_conn *conn); - -/** @brief disconnected callback. - * - * @param conn Connection object. - */ -void bt_gatt_disconnected(struct bt_conn *conn); - -/** @brief notification callback. - * - * @param conn Connection object. - * @param handle Attribute handle. - * @param data Attribute data. - * @param length Attribute data length. - */ -void bt_gatt_notification(struct bt_conn *conn, uint16_t handle, - const void *data, uint16_t length); - /* Client API */ /** @brief Response callback function diff --git a/net/bluetooth/att.c b/net/bluetooth/att.c index e2d414d79a3..ecaef682e2a 100644 --- a/net/bluetooth/att.c +++ b/net/bluetooth/att.c @@ -50,6 +50,7 @@ #include "l2cap.h" #include "smp.h" #include "att.h" +#include "gatt_internal.h" #if !defined(CONFIG_BLUETOOTH_DEBUG_ATT) #undef BT_DBG diff --git a/net/bluetooth/gatt.c b/net/bluetooth/gatt.c index 71f56020880..204b8bbd03b 100644 --- a/net/bluetooth/gatt.c +++ b/net/bluetooth/gatt.c @@ -51,6 +51,7 @@ #include "l2cap.h" #include "att.h" #include "smp.h" +#include "gatt_internal.h" #if !defined(CONFIG_BLUETOOTH_DEBUG_GATT) #undef BT_DBG diff --git a/net/bluetooth/gatt_internal.h b/net/bluetooth/gatt_internal.h new file mode 100644 index 00000000000..1badee6667c --- /dev/null +++ b/net/bluetooth/gatt_internal.h @@ -0,0 +1,38 @@ +/** @file + * @brief Internal API for Generic Attribute Profile handling. + */ + +/* + * Copyright (c) 2015 Intel Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3) Neither the name of Intel Corporation nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +void bt_gatt_connected(struct bt_conn *conn); +void bt_gatt_disconnected(struct bt_conn *conn); +void bt_gatt_notification(struct bt_conn *conn, uint16_t handle, + const void *data, uint16_t length);