add classic/core.h and ble/core.h, add ENABLE_CLASSIC where missing

This commit is contained in:
Matthias Ringwald 2016-03-28 12:45:43 +02:00
parent b503eb4456
commit 59c6af158d
27 changed files with 161 additions and 43 deletions

View File

@ -13,6 +13,7 @@
#define HAVE_TIME
// BTstack features that can be enabled
#define ENABLE_CLASSIC
#define ENABLE_LOG_ERROR
#define ENABLE_LOG_INFO
#define ENABLE_LOG_INTO_HCI_DUMP

View File

@ -45,6 +45,7 @@
#include "ancs_client.h"
#include "ble/att_db.h"
#include "ble/core.h"
#include "ble/gatt_client.h"
#include "ble/sm.h"
#include "btstack_debug.h"

View File

@ -41,6 +41,7 @@
#include "bluetooth.h"
#include "ble/att_db.h"
#include "ble/core.h"
#include "btstack_debug.h"
#include "btstack_util.h"

View File

@ -40,6 +40,7 @@
#include "att_db_util.h"
#include "ble/att_db.h"
#include "ble/core.h"
#include "btstack_util.h"
#include "btstack_debug.h"
#include "bluetooth.h"

View File

@ -40,10 +40,10 @@
* Dispatcher for independent implementation of ATT client and server
*/
#include "l2cap.h"
#include "att_dispatch.h"
#include "ble/core.h"
#include "btstack_debug.h"
#include "l2cap.h"
static btstack_packet_handler_t att_client_handler;
static btstack_packet_handler_t att_server_handler;

View File

@ -48,22 +48,21 @@
#include "btstack_config.h"
#include "att_dispatch.h"
#include "ble/att_db.h"
#include "ble/att_server.h"
#include "ble/core.h"
#include "ble/le_device_db.h"
#include "ble/sm.h"
#include "btstack_debug.h"
#include "btstack_event.h"
#include "btstack_memory.h"
#include "btstack_run_loop.h"
#include "gap.h"
#include "hci.h"
#include "hci_dump.h"
#include "l2cap.h"
#include "ble/sm.h"
#include "ble/att_db.h"
#include "att_dispatch.h"
#include "gap.h"
#include "ble/le_device_db.h"
#include "ble/att_server.h"
static void att_run(void);
// max ATT request matches L2CAP PDU -- allow to use smaller buffer

51
src/ble/core.h Normal file
View File

@ -0,0 +1,51 @@
/*
* Copyright (C) 2014 BlueKitchen GmbH
*
* 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 the copyright holders nor the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
* 4. Any redistribution, use, or modification is done solely for
* personal benefit and not for any commercial purpose or for
* monetary gain.
*
* THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH 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 MATTHIAS
* RINGWALD 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.
*
* Please inquire about commercial licensing options at
* contact@bluekitchen-gmbh.com
*
*/
// *****************************************************************************
// Core header for all BLE protocols and profiles
// *****************************************************************************
#ifndef __BLE_CORE
#define __BLE_CORE
#include "btstack_config.h"
#ifndef ENABLE_BLE
#error "ENABLE_BLE not defined but Classic protocol or profile include. Please add ENABLE_BLE in btstack_config.h, or remove all Classic protocols and profiles"
#endif
#endif

View File

@ -45,6 +45,7 @@
#include "att_dispatch.h"
#include "ble/ad_parser.h"
#include "ble/att_db.h"
#include "ble/core.h"
#include "ble/gatt_client.h"
#include "ble/le_device_db.h"
#include "ble/sm.h"

View File

@ -35,6 +35,7 @@
*
*/
#include "le_device_db.h"
#include "ble/core.h"
// Central Device db interface
void le_device_db_init(void){}

View File

@ -37,6 +37,8 @@
#include "ble/le_device_db.h"
#include "ble/core.h"
#include <stdio.h>
#include <string.h>
#include "btstack_debug.h"

View File

@ -40,6 +40,7 @@
#include <inttypes.h>
#include "ble/le_device_db.h"
#include "ble/core.h"
#include "ble/sm.h"
#include "btstack_debug.h"
#include "btstack_event.h"

View File

@ -51,6 +51,7 @@
#include "btstack_event.h"
#include "btstack_memory.h"
#include "btstack_util.h"
#include "classic/core.h"
#include "classic/sdp_util.h"
#include "hci.h"
#include "hci_cmd.h"

View File

@ -44,6 +44,7 @@
#include "btstack_linked_list.h"
#include "btstack_memory.h"
#include "btstack_util.h"
#include "classic/core.h"
// This list should be directly accessed only by tests
btstack_linked_list_t db_mem_link_keys = NULL;

51
src/classic/core.h Normal file
View File

@ -0,0 +1,51 @@
/*
* Copyright (C) 2014 BlueKitchen GmbH
*
* 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 the copyright holders nor the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
* 4. Any redistribution, use, or modification is done solely for
* personal benefit and not for any commercial purpose or for
* monetary gain.
*
* THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH 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 MATTHIAS
* RINGWALD 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.
*
* Please inquire about commercial licensing options at
* contact@bluekitchen-gmbh.com
*
*/
// *****************************************************************************
// Core header for all Classic protocols and profiles
// *****************************************************************************
#ifndef __CLASSIC_CORE
#define __CLASSIC_CORE
#include "btstack_config.h"
#ifndef ENABLE_CLASSIC
#error "ENABLE_CLASSIC not defined but Classic protocol or profile include. Please add ENABLE_CLASSIC in btstack_config.h, or remove all Classic protocols and profiles"
#endif
#endif

View File

@ -44,18 +44,18 @@
#include <string.h>
#include <inttypes.h>
#include "hci_cmd.h"
#include "btstack_run_loop.h"
#include "hci.h"
#include "btstack_memory.h"
#include "hci_dump.h"
#include "l2cap.h"
#include "btstack_debug.h"
#include "btstack_event.h"
#include "btstack_memory.h"
#include "btstack_run_loop.h"
#include "classic/core.h"
#include "classic/sdp_client_rfcomm.h"
#include "classic/sdp_server.h"
#include "classic/sdp_util.h"
#include "btstack_event.h"
#include "hci.h"
#include "hci_cmd.h"
#include "hci_dump.h"
#include "l2cap.h"
#define HFP_HF_FEATURES_SIZE 10
#define HFP_AG_FEATURES_SIZE 12

View File

@ -56,6 +56,7 @@
#include "hci_dump.h"
#include "l2cap.h"
#include "btstack_debug.h"
#include "classic/core.h"
#include "classic/hfp.h"
#include "classic/hfp_ag.h"
#include "classic/hfp_gsm_model.h"

View File

@ -49,6 +49,7 @@
#include <string.h>
#include "btstack_memory.h"
#include "classic/core.h"
#include "classic/hfp.h"
#include "classic/hfp_gsm_model.h"
#include "classic/sdp_server.h"

View File

@ -48,20 +48,19 @@
#include <stdlib.h>
#include <string.h>
#include "hci_cmd.h"
#include "btstack_run_loop.h"
#include "hci.h"
#include "btstack_debug.h"
#include "btstack_memory.h"
#include "hci_dump.h"
#include "l2cap.h"
#include "btstack_run_loop.h"
#include "classic/core.h"
#include "classic/hfp.h"
#include "classic/hfp_hf.h"
#include "classic/sdp_client_rfcomm.h"
#include "classic/sdp_server.h"
#include "classic/sdp_util.h"
#include "btstack_debug.h"
#include "classic/hfp.h"
#include "classic/hfp_hf.h"
#include "hci.h"
#include "hci_cmd.h"
#include "hci_dump.h"
#include "l2cap.h"
static const char default_hfp_hf_service_name[] = "Hands-Free unit";
static uint16_t hfp_supported_features = HFP_DEFAULT_HF_SUPPORTED_FEATURES;

View File

@ -52,6 +52,7 @@
#include "btstack_event.h"
#include "btstack_memory.h"
#include "btstack_run_loop.h"
#include "classic/core.h"
#include "classic/sdp_server.h"
#include "classic/sdp_client_rfcomm.h"
#include "classic/sdp_util.h"

View File

@ -52,6 +52,7 @@
#include "btstack_event.h"
#include "btstack_memory.h"
#include "btstack_run_loop.h"
#include "classic/core.h"
#include "classic/sdp_server.h"
#include "classic/sdp_client_rfcomm.h"
#include "classic/sdp_util.h"

View File

@ -47,9 +47,8 @@
#include <string.h>
#include "btstack_config.h"
#include "classic/core.h"
#include "classic/sdp_util.h"
#include "hci_cmd.h"
static const char default_panu_service_name[] = "Personal Ad-hoc User Service";
static const char default_panu_service_desc[] = "Personal Ad-hoc User Service";

View File

@ -48,6 +48,7 @@
#include "btstack_event.h"
#include "btstack_memory.h"
#include "btstack_util.h"
#include "classic/core.h"
#include "classic/rfcomm.h"
#include "hci.h"
#include "hci_cmd.h"

View File

@ -40,15 +40,14 @@
*/
#include "btstack_config.h"
#include "classic/sdp_client.h"
#include "hci_cmd.h"
#include "btstack_debug.h"
#include "btstack_event.h"
#include "l2cap.h"
#include "classic/core.h"
#include "classic/sdp_client.h"
#include "classic/sdp_server.h"
#include "classic/sdp_util.h"
#include "btstack_debug.h"
#include "hci_cmd.h"
#include "l2cap.h"
// Types SDP Parser - Data Element stream helper
typedef enum {

View File

@ -46,6 +46,7 @@
#include "btstack_debug.h"
#include "btstack_event.h"
#include "classic/core.h"
#include "classic/sdp_client.h"
#include "classic/sdp_client_rfcomm.h"
#include "classic/sdp_util.h"

View File

@ -42,14 +42,14 @@
#include <stdio.h>
#include <string.h>
#include "btstack_memory.h"
#include "btstack_debug.h"
#include "btstack_event.h"
#include "hci_dump.h"
#include "l2cap.h"
#include "btstack_memory.h"
#include "classic/core.h"
#include "classic/sdp_server.h"
#include "classic/sdp_util.h"
#include "hci_dump.h"
#include "l2cap.h"
// max reserved ServiceRecordHandle
#define maxReservedServiceRecordHandle 0xffff

View File

@ -39,10 +39,11 @@
* sdp_util.c
*/
#include "classic/sdp_util.h"
#include "btstack_util.h"
#include "btstack_config.h"
#include "bluetooth.h"
#include "btstack_config.h"
#include "btstack_util.h"
#include "classic/core.h"
#include "classic/sdp_util.h"
#include <stdio.h>
#include <stdlib.h>

View File

@ -46,6 +46,8 @@
#include <string.h>
#include "bluetooth.h"
#include "btstack_config.h"
#include "classic/core.h"
#include "classic/sdp_util.h"
void spp_create_sdp_record(uint8_t *service, uint32_t service_record_handle, int rfcomm_channel, const char *name){