Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0814caf3 authored by Sharvil Nanavati's avatar Sharvil Nanavati Committed by Andre Eisenbach
Browse files

Collapse more feature flags.

Start reviewing in include/bt_target.h.
parent 1ce34dda
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -46,7 +46,6 @@ const UINT32 bta_av_meta_caps_co_ids[] = {
**	3. GetCapabilities supported event_ids list
**	4. GetCapabilities supported event_ids count
*/
#ifdef ANDROID_APP_INCLUDED
/* Flushing partial avdtp packets can cause some headsets to disconnect the link
   if receiving partial a2dp frames */
const UINT16  bta_av_audio_flush_to[] = {
@@ -80,8 +79,6 @@ const UINT8 bta_av_meta_caps_evt_ids[] = {
#define BTA_AV_NUM_RC_EVT_IDS   (sizeof(bta_av_meta_caps_evt_ids) / sizeof(bta_av_meta_caps_evt_ids[0]))
#endif /* BTA_AV_NUM_RC_EVT_IDS */

#endif /* ANDROID_APP_INCLUDED */

/* the MTU for the AVRCP browsing channel */
#ifndef BTA_AV_MAX_RC_BR_MTU
#define BTA_AV_MAX_RC_BR_MTU      1008
+0 −1
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@
#include "bta_sys.h"
#include "bta_ag_api.h"
#include "bta_ag_co.h"
#include "bte_appl.h"
#include "bt_utils.h"

#ifndef LINUX_NATIVE
+1 −85
Original line number Diff line number Diff line
@@ -23,9 +23,6 @@
#ifndef BUILDCFG
#define BUILDCFG
#endif
#include "bt_types.h"

#ifdef BUILDCFG

#if !defined(HAS_BDROID_BUILDCFG) && !defined(HAS_NO_BDROID_BUILDCFG)
#error "An Android.mk file did not include bdroid_CFLAGS and possibly not bdorid_C_INCLUDES"
@@ -35,12 +32,10 @@
#include "bdroid_buildcfg.h"
#endif

#endif  // BUILDCFG
#include "bt_types.h"   /* This must be defined AFTER buildcfg.h */

/* Include common GKI definitions used by this platform */
#include "gki_target.h"

#include "bt_types.h"   /* This must be defined AFTER buildcfg.h */
#include "dyn_mem.h"    /* defines static and/or dynamic memory for components */

//------------------Added from bdroid_buildcfg.h---------------------
@@ -64,10 +59,6 @@
#define BTA_INCLUDED TRUE
#endif

#ifndef BTA_AG_INCLUDED
#define BTA_AG_INCLUDED  TRUE
#endif

#ifndef BTA_PAN_INCLUDED
#define BTA_PAN_INCLUDED TRUE
#endif
@@ -104,14 +95,6 @@
#define BTA_DISABLE_DELAY 200 /* in milliseconds */
#endif

#ifndef ANDROID_APP_INCLUDED
#define ANDROID_APP_INCLUDED  TRUE
#endif

#ifndef ANDROID_USE_LOGCAT
#define ANDROID_USE_LOGCAT  TRUE
#endif

// If the next wakeup time is less than this threshold, we should acquire
// a wakelock instead of setting a wake alarm so we're not bouncing in
// and out of suspend frequently.
@@ -380,13 +363,6 @@
** HCI Services (H4)
**
******************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif

#ifdef __cplusplus
}
#endif

/* Use 2 second for low-resolution systems, override to 1 for high-resolution systems */
#ifndef BT_1SEC_TIMEOUT
@@ -405,10 +381,6 @@ extern "C" {
** BTM
**
******************************************************************************/
/* Include inquiry code. */
#ifndef BTM_INQUIRY_INCLUDED
#define BTM_INQUIRY_INCLUDED        TRUE
#endif

/* Cancel Inquiry on incoming SSP */
#ifndef BTM_NO_SSP_ON_INQUIRY
@@ -430,11 +402,6 @@ extern "C" {
#define BTM_WBS_INCLUDED            FALSE       /* TRUE includes WBS code */
#endif

/* Includes PCM2 support if TRUE */
#ifndef BTM_PCM2_INCLUDED
#define BTM_PCM2_INCLUDED           FALSE
#endif

/*  This is used to work around a controller bug that doesn't like Disconnect
**  issued while there is a role switch in progress
*/
@@ -636,12 +603,6 @@ extern "C" {
**
******************************************************************************/

/* Flow control and retransmission mode */

#ifndef L2CAP_FCR_INCLUDED
#define L2CAP_FCR_INCLUDED TRUE
#endif

/* The maximum number of simultaneous links that L2CAP can support. */
#ifndef MAX_ACL_CONNECTIONS
#define MAX_L2CAP_LINKS             7
@@ -1362,10 +1323,6 @@ extern "C" {
**
******************************************************************************/

#ifndef HID_DEV_PM_INCLUDED
#define HID_DEV_PM_INCLUDED         TRUE
#endif

#ifndef HID_DEV_SUBCLASS
#define HID_DEV_SUBCLASS            COD_MINOR_POINTING
#endif
@@ -1420,16 +1377,6 @@ extern "C" {
#define HID_HOST_REPAGE_WIN          (2)
#endif

/******************************************************************************
**
** PAN
**
******************************************************************************/

#ifndef PAN_INCLUDED
#define PAN_INCLUDED                FALSE
#endif

/*************************************************************************
 * A2DP Definitions
 */
@@ -1437,21 +1384,12 @@ extern "C" {
#define A2D_INCLUDED            TRUE
#endif

/* TRUE to include SBC utility functions */
#ifndef A2D_SBC_INCLUDED
#define A2D_SBC_INCLUDED        A2D_INCLUDED
#endif

/******************************************************************************
**
** AVCTP
**
******************************************************************************/

#ifndef AVCT_INCLUDED
#define AVCT_INCLUDED               TRUE
#endif

/* Number of simultaneous ACL links to different peer devices. */
#ifndef AVCT_NUM_LINKS
#define AVCT_NUM_LINKS              2
@@ -1468,10 +1406,6 @@ extern "C" {
**
******************************************************************************/

#ifndef AVRC_INCLUDED
#define AVRC_INCLUDED               TRUE
#endif

#ifndef AVRC_METADATA_INCLUDED
#define AVRC_METADATA_INCLUDED      TRUE
#endif
@@ -1603,10 +1537,6 @@ The maximum number of payload octets that the local device can receive in a sing
**
******************************************************************************/

#ifndef SER_INCLUDED
#define SER_INCLUDED                FALSE
#endif

/* Mailbox used by serial application. */
#ifndef SER_MBOX
#define SER_MBOX                    TASK_MBOX_1
@@ -1622,25 +1552,11 @@ The maximum number of payload octets that the local device can receive in a sing
#define HCILP_INCLUDED                  TRUE
#endif

/******************************************************************************
**
** SAP - Sample applications
**
******************************************************************************/

#ifndef MMI_INCLUDED
#define MMI_INCLUDED                FALSE
#endif

/******************************************************************************
**
** APPL - Application Task
**
******************************************************************************/
/* When TRUE indicates that an application task is to be run */
#ifndef APPL_INCLUDED
#define APPL_INCLUDED                TRUE
#endif

#define L2CAP_FEATURE_REQ_ID      73
#define L2CAP_FEATURE_RSP_ID     173
+1 −144
Original line number Diff line number Diff line
@@ -22,52 +22,7 @@
 *
 ******************************************************************************/

#ifndef BTE_APPL_H
#define BTE_APPL_H

#include "btm_int.h"
#include "bta_api.h"
#include "bta_sys.h"
#include "bte.h"

/* Maximum length for serial port device name */
#ifndef BTE_APPL_MAX_USERIAL_DEV_NAME
#define BTE_APPL_MAX_USERIAL_DEV_NAME       (256)
#endif
#ifndef BTAPP_AHF_API_SUPPORT
#define BTAPP_AHF_API_SUPPORT FALSE
#endif

/* BTA APP_IDs */
#define UI_DM_ID    1
#define UI_PRM_ID   20
/* this defines the enabled BTA modules. client may not be defined as those are enabled at run time.
 * they are defined for completeness. please check with bta_sys.h for new modules.
 * BTA_ID_DM serves as flag for BTA_EnableBluetooth()
 * BTA_ID_RES can be used to fs ID in bte_appl.
 */

#define BTAPP_NUM_ID_BLOCKS ((BTA_ID_MAX/32)+1)        /* number of 32 bit required to store one bit per
                                                            btapp id */

#define BTAPP_APPL_MAIL_EVENT(x)  (x<<8)    /* define bte_appl task mail box event. LSB contains
                                                BTA_ID_xxx (see bta_sys.h) */
#define BTAPP_APPL_MAIL_EVT       0xff00    /* high byte contains bitmap of application module event */

/* helper macro to copy BTA callack data y into message buffer x, for event data structure z */
#define MEMCPY_APPL_MSG(x, y, z)  memcpy( (void *)(((UINT8 *)x)+sizeof(BT_HDR)), (void *)y, sizeof(z) )

/* Event masks for BTE_APPL_TASK */
#define BTE_APPL_STARTUP_EVT    EVENT_MASK(APPL_EVT_0)      /* Bluetooth has started */
#define BTE_APPL_SHUTDOWN_EVT   EVENT_MASK(APPL_EVT_1)      /* Bluetooth is shutting down */
#define BTE_APPL_SOCKET_RX_EVT  EVENT_MASK(APPL_EVT_2)      /* Socket data ready to be read */
#define BTE_APPL_DBUS_RX_EVT    EVENT_MASK(APPL_EVT_3)      /* DBUS message ready to be read */
#define BTE_APPL_BTA_ENABLE_EVT EVENT_MASK(APPL_EVT_4)      /* BTA Enabled event */


/* Application configuration */
#define BTE_APPL_PATCHRAM_PATH_MAXLEN   128
#define BTE_APPL_CONTACTS_DB_PATH       256
#pragma once

typedef struct {
#if ((BLE_INCLUDED == TRUE) && (SMP_INCLUDED == TRUE))
@@ -80,101 +35,3 @@ typedef struct {
} tBTE_APPL_CFG;

extern tBTE_APPL_CFG bte_appl_cfg;

typedef struct {
    pthread_mutex_t     mutex;  /* mutex to protect below signal condition */
    pthread_cond_t      cond;   /* signal event */
} tBTAPP_SEMAPHORE;

/* helper functions to handle pthread conditions event from outside GKI */
extern void bte_create_semaphore( tBTAPP_SEMAPHORE * p_sema );
extern void bte_wait_semaphore( tBTAPP_SEMAPHORE * p_sema, unsigned msecs_to );
extern void bte_signal_semaphore( tBTAPP_SEMAPHORE * p_sema );
extern void bte_destroy_semaphore( tBTAPP_SEMAPHORE * p_sema );

/* global application control block storing global application states and variables */
typedef struct tBTE_APPL_CB_tag {
    sigset_t            signal_handler_set;        /* signal handler set used by signal handler thread */
#if ( TRUE == BTE_RESET_BAUD_ON_BT_DISABLE )
    tBTAPP_SEMAPHORE    shutdown_semaphore;   /* used to sync with  terminate handler initated ops */
#endif
    BOOLEAN amp_enabled;                        /* TRUE if AMP is in use */
} tBTE_APPL_CB;

extern tBTE_APPL_CB bte_appl_cb;

/* Exports the application task */
extern void BTE_appl_task(UINT32 params);
extern int BTAPP_enable_bta( const UINT32 bta_module_state[BTAPP_NUM_ID_BLOCKS], int includingFM );
extern int BTAPP_disable_bta( const UINT32 bta_module_state[BTAPP_NUM_ID_BLOCKS], int includingFM );

extern UINT8 appl_trace_level;
#define BT_PCM_CLK_IDX 1
#ifndef BT_PCM_DEF_CLK
#define BT_PCM_DEF_CLK 4       /* defaults to 2048khz PCM clk */
#endif
#define BT_PCM_SYNC_MS_ROLE_IDX 3
#define BT_PCM_CLK_MS_ROLE_IDX  4
#ifndef BT_PCM_DEF_ROLE
#define BT_PCM_DEF_ROLE    0x00     /* assume slave as default */
#endif

/* helper macros to set, clear and get current BTA module id in a 32bit ARRAY!! */
/* set bit id to 1 in UINT32 a[] NO RANGE CHECK!*/
#define BTAPP_SET_BTA_MOD(id, a)    { a[id/32] |= (UINT32)(1<<(id % 32)); }

/* set bit id to 0 (cleared) in UINT32 a[] NO RANGE CHECK */
#define BTAPP_CLEAR_BTA_MOD(id, a)  { a[id/32] &= (UINT32)!(1<<(id % 32)); }

/* tests if bit id is 1 in UINT32 a[] NO RANGE CHECK */
#define BTAPP_BTA_MOD_IS_SET(id, a) (a[id/32] & (UINT32)(1<<(id % 32)))

/* update this list either via btld.txt or directly here by adding the new profiles as per bta_sys.h.
 * each xxx_LISTx may only contain 32 bits */
#ifndef BTAPP_BTA_MODULES_LIST0
#define BTAPP_BTA_MODULES_LIST0 (\
        ( 1<<BTA_ID_DM ) | \
        ( 1<<BTA_ID_DG ) | \
        ( 1<<BTA_ID_AG ) | \
        ( 1<<BTA_ID_OPC )| \
        ( 1<<BTA_ID_OPS )| \
        ( 1<<BTA_ID_FTS )| \
        ( 1<<BTA_ID_PAN )| \
        ( 1<<BTA_ID_PR ) | \
        ( 1<<BTA_ID_SC)  | \
        ( 1<<BTA_ID_AV ) | \
        ( 1<<BTA_ID_HH ) | \
        ( 1<<BTA_ID_PBS) | \
        ( 1<<BTA_ID_FMTX)| \
        ( 1<<BTA_ID_JV) | \
        ( 1<<BTA_ID_MSE) \
        )
#endif

#define BTAPP_LIST1_BLOCK 32    /* next 32 bit block */
#ifndef BTAPP_BTA_MODULES_LIST1
#define BTAPP_BTA_MODULES_LIST1 (\
        ( 1<<(BTA_ID_MAX-BTAPP_LIST1_BLOCK) ) | \
        ( 1<<(BTA_ID_MSE-BTAPP_LIST1_BLOCK) ) | \
        0 \
        )
#endif
/* for future GPS etc support. goes int LIST1 above */
#if 0
    ( 1<<(BTA_ID_SSR-BTAPP_LIST1_BLOCK) ) \
    ( 1<<(BTA_ID_MSE-BTAPP_LIST1_BLOCK) ) \
    ( 1<<(BTA_ID_MCE-BTAPP_LIST1_BLOCK) )
#endif

/* used application init default in bte_main.c, bte_appl_cfg */
#ifndef BTAPP_DEFAULT_MODULES
#if (1==BTAPP_NUM_ID_BLOCKS)
#define BTAPP_DEFAULT_MODULES {BTAPP_BTA_MODULES_LIST0} /* max 32 modules IDs */
#elif (2==BTAPP_NUM_ID_BLOCKS)
#define BTAPP_DEFAULT_MODULES {BTAPP_BTA_MODULES_LIST0, BTAPP_BTA_MODULES_LIST1} /* 64 module IDs max */
#else
#error "Define more BTAPP_BTA_MODULES_LISTx"
#endif
#endif

#endif  /* BTE_APPL_H */
+0 −9
Original line number Diff line number Diff line
@@ -43,9 +43,7 @@
#include "pan_api.h"
#endif

#if (defined(AVRC_INCLUDED) && AVRC_INCLUDED == TRUE)
#include "avrc_api.h"
#endif

#if (defined(A2D_INCLUDED) && A2D_INCLUDED == TRUE)
#include "a2d_api.h"
@@ -71,9 +69,7 @@
#include "bta_api.h"
#include "bta_sys.h"

#if BTA_AG_INCLUDED == TRUE
#include "bta_ag_int.h"
#endif

#if BTA_HS_INCLUDED == TRUE
#include "bta_hs_int.h"
@@ -161,9 +157,7 @@ void BTE_InitStack(void)
#endif  /* AADP */


#if (defined(AVRC_INCLUDED) && AVRC_INCLUDED == TRUE)
    AVRC_Init();
#endif


/***********
@@ -188,10 +182,7 @@ void BTE_InitStack(void)
    memset((void*)bta_dm_search_cb_ptr, 0, sizeof(tBTA_DM_SEARCH_CB));
    memset((void*)bta_dm_di_cb_ptr, 0, sizeof(tBTA_DM_DI_CB));
    memset((void*)bta_prm_cb_ptr, 0, sizeof(tBTA_PRM_CB));

#if BTA_AG_INCLUDED == TRUE
    memset((void*)bta_ag_cb_ptr, 0, sizeof(tBTA_AG_CB));
#endif
#if BTA_HS_INCLUDED == TRUE
    memset((void*)bta_hs_cb_ptr, 0, sizeof(tBTA_HS_CB));
#endif
Loading