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

Commit 1ce23e56 authored by Myles Watson's avatar Myles Watson
Browse files

include: Apply clang-format

clang-format -i --style=file include/*

Test: mma -j32
Change-Id: Ibfb31af3fa82cfd6021fdc3203381b91e57bb71e
parent cf1277c4
Loading
Loading
Loading
Loading
+303 −271
Original line number Diff line number Diff line
@@ -25,7 +25,8 @@
#endif

#if !defined(HAS_BDROID_BUILDCFG) && !defined(HAS_NO_BDROID_BUILDCFG)
#error "An Android.mk file did not include bdroid_CFLAGS and possibly not bdroid_C_INCLUDES"
#error \
    "An Android.mk file did not include bdroid_CFLAGS and possibly not bdroid_C_INCLUDES"
#endif

#ifdef HAS_BDROID_BUILDCFG
@@ -36,7 +37,9 @@

//------------------Added from bdroid_buildcfg.h---------------------
#ifndef L2CAP_EXTFEA_SUPPORTED_MASK
#define L2CAP_EXTFEA_SUPPORTED_MASK (L2CAP_EXTFEA_ENH_RETRANS | L2CAP_EXTFEA_STREAM_MODE | L2CAP_EXTFEA_NO_CRC | L2CAP_EXTFEA_FIXED_CHNLS)
#define L2CAP_EXTFEA_SUPPORTED_MASK                                            \
  (L2CAP_EXTFEA_ENH_RETRANS | L2CAP_EXTFEA_STREAM_MODE | L2CAP_EXTFEA_NO_CRC | \
   L2CAP_EXTFEA_FIXED_CHNLS)
#endif

#ifndef BTUI_OPS_FORMATS
@@ -44,7 +47,8 @@
#endif

#ifndef BTA_RFC_MTU_SIZE
#define BTA_RFC_MTU_SIZE (L2CAP_MTU_SIZE-L2CAP_MIN_OFFSET-RFCOMM_DATA_OVERHEAD)
#define BTA_RFC_MTU_SIZE \
  (L2CAP_MTU_SIZE - L2CAP_MIN_OFFSET - RFCOMM_DATA_OVERHEAD)
#endif

#ifndef BTA_INCLUDED
@@ -100,7 +104,10 @@
#endif

#ifndef BTA_AG_SCO_PKT_TYPES
#define BTA_AG_SCO_PKT_TYPES  (BTM_SCO_LINK_ONLY_MASK | BTM_SCO_PKT_TYPES_MASK_EV3 |  BTM_SCO_PKT_TYPES_MASK_NO_3_EV3 | BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 | BTM_SCO_PKT_TYPES_MASK_NO_3_EV5)
#define BTA_AG_SCO_PKT_TYPES                                           \
  (BTM_SCO_LINK_ONLY_MASK | BTM_SCO_PKT_TYPES_MASK_EV3 |               \
   BTM_SCO_PKT_TYPES_MASK_NO_3_EV3 | BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 | \
   BTM_SCO_PKT_TYPES_MASK_NO_3_EV5)
#endif

#ifndef BTA_AV_RET_TOUT
@@ -157,7 +164,6 @@

//------------------End added from bdroid_buildcfg.h---------------------


/******************************************************************************
 *
 * Buffer sizes
@@ -346,12 +352,14 @@
#define BTM_ALLOW_CONN_IF_NONDISCOVER TRUE
#endif

/* Sets the Page_Scan_Window:  the length of time that the device is performing a page scan. */
/* Sets the Page_Scan_Window:  the length of time that the device is performing
 * a page scan. */
#ifndef BTM_DEFAULT_CONN_WINDOW
#define BTM_DEFAULT_CONN_WINDOW 0x0012
#endif

/* Sets the Page_Scan_Activity:  the interval between the start of two consecutive page scans. */
/* Sets the Page_Scan_Activity:  the interval between the start of two
 * consecutive page scans. */
#ifndef BTM_DEFAULT_CONN_INTERVAL
#define BTM_DEFAULT_CONN_INTERVAL 0x0800
#endif
@@ -361,7 +369,8 @@
#define BTM_DEFAULT_DISC_WINDOW 0x0012
#endif

/* When automatic inquiry scan is enabled, this sets the inquiry scan interval. */
/* When automatic inquiry scan is enabled, this sets the inquiry scan interval.
 */
#ifndef BTM_DEFAULT_DISC_INTERVAL
#define BTM_DEFAULT_DISC_INTERVAL 0x0800
#endif
@@ -369,13 +378,15 @@
/* Default class of device
* {SERVICE_CLASS, MAJOR_CLASS, MINOR_CLASS}
*
* SERVICE_CLASS:0x5A (Bit17 -Networking,Bit19 - Capturing,Bit20 -Object Transfer,Bit22 -Telephony)
* SERVICE_CLASS:0x5A (Bit17 -Networking,Bit19 - Capturing,Bit20 -Object
* Transfer,Bit22 -Telephony)
* MAJOR_CLASS:0x02 - PHONE
* MINOR_CLASS:0x0C - SMART_PHONE
*
*/
#ifndef BTA_DM_COD
#define BTA_DM_COD {0x5A, 0x02, 0x0C}
#define BTA_DM_COD \
  { 0x5A, 0x02, 0x0C }
#endif

/* The number of SCO links. */
@@ -398,7 +409,8 @@
#define BTM_SEC_MAX_SERVICE_RECORDS 32
#endif

/* If True, force a retrieval of remote device name for each bond in case it's changed */
/* If True, force a retrieval of remote device name for each bond in case it's
 * changed */
#ifndef BTM_SEC_FORCE_RNR_FOR_DBOND
#define BTM_SEC_FORCE_RNR_FOR_DBOND FALSE
#endif
@@ -445,14 +457,16 @@
#define BTM_SCO_WAKE_PARKED_LINK TRUE
#endif

/* If the user does not respond to security process requests within this many seconds,
/* If the user does not respond to security process requests within this many
 * seconds,
 * a negative response would be sent automatically.
 * 30 is LMP response timeout value */
#ifndef BTM_SEC_TIMEOUT_VALUE
#define BTM_SEC_TIMEOUT_VALUE 35
#endif

/* Maximum number of callbacks that can be registered using BTM_RegisterForVSEvents */
/* Maximum number of callbacks that can be registered using
 * BTM_RegisterForVSEvents */
#ifndef BTM_MAX_VSE_CALLBACKS
#define BTM_MAX_VSE_CALLBACKS 3
#endif
@@ -480,7 +494,8 @@
#define BTM_DEFAULT_AUTH_REQ BTM_AUTH_SP_NO
#endif

/* The default MITM Protection Requirement for dedicated bonding using Simple Pairing
/* The default MITM Protection Requirement for dedicated bonding using Simple
 * Pairing
 * Possible values are BTM_AUTH_AP_YES or BTM_AUTH_AP_NO */
#ifndef BTM_DEFAULT_DD_AUTH_REQ
#define BTM_DEFAULT_DD_AUTH_REQ BTM_AUTH_AP_YES
@@ -523,7 +538,8 @@
#define MAX_L2CAP_CHANNELS 16
#endif

/* The maximum number of simultaneous applications that can register with L2CAP. */
/* The maximum number of simultaneous applications that can register with L2CAP.
 */
#ifndef MAX_L2CAP_CLIENTS
#define MAX_L2CAP_CLIENTS 15
#endif
@@ -533,12 +549,14 @@
#define L2CAP_LINK_INACTIVITY_TOUT 4
#endif

/* The number of seconds of link inactivity after bonding before a link is disconnected. */
/* The number of seconds of link inactivity after bonding before a link is
 * disconnected. */
#ifndef L2CAP_BONDING_TIMEOUT
#define L2CAP_BONDING_TIMEOUT 3
#endif

/* The time from the HCI connection complete to disconnect if no channel is established. */
/* The time from the HCI connection complete to disconnect if no channel is
 * established. */
#ifndef L2CAP_LINK_STARTUP_TOUT
#define L2CAP_LINK_STARTUP_TOUT 60
#endif
@@ -556,12 +574,14 @@
#define L2CAP_MPS_OVER_BR_EDR 1010
#endif

/* If host flow control enabled, this is the number of buffers the controller can have unacknowledged. */
/* If host flow control enabled, this is the number of buffers the controller
 * can have unacknowledged. */
#ifndef L2CAP_HOST_FC_ACL_BUFS
#define L2CAP_HOST_FC_ACL_BUFS 20
#endif

/* This is set to enable L2CAP to  take the ACL link out of park mode when ACL data is to be sent. */
/* This is set to enable L2CAP to  take the ACL link out of park mode when ACL
 * data is to be sent. */
#ifndef L2CAP_WAKE_PARKED_LINK
#define L2CAP_WAKE_PARKED_LINK TRUE
#endif
@@ -606,7 +626,8 @@
#define L2CAP_UCD_CH_PRIORITY L2CAP_CHNL_PRIORITY_MEDIUM
#endif

/* Used for features using fixed channels; set to zero if no fixed channels supported (BLE, etc.) */
/* Used for features using fixed channels; set to zero if no fixed channels
 * supported (BLE, etc.) */
/* Excluding L2CAP signaling channel and UCD */
#ifndef L2CAP_NUM_FIXED_CHNLS
#define L2CAP_NUM_FIXED_CHNLS 32
@@ -618,7 +639,8 @@
#endif

#ifndef L2CAP_LAST_FIXED_CHNL
#define L2CAP_LAST_FIXED_CHNL           (L2CAP_FIRST_FIXED_CHNL + L2CAP_NUM_FIXED_CHNLS - 1)
#define L2CAP_LAST_FIXED_CHNL \
  (L2CAP_FIRST_FIXED_CHNL + L2CAP_NUM_FIXED_CHNLS - 1)
#endif

/* Round Robin service channels in link */
@@ -631,7 +653,8 @@
#define L2CAP_ERTM_STATS FALSE
#endif

/* Used for conformance testing ONLY:  When TRUE lets scriptwrapper overwrite info response */
/* Used for conformance testing ONLY:  When TRUE lets scriptwrapper overwrite
 * info response */
#ifndef L2CAP_CONFORMANCE_TESTING
#define L2CAP_CONFORMANCE_TESTING FALSE
#endif
@@ -644,7 +667,6 @@
#define L2CAP_MAX_RX_BUFFER 0x100000
#endif


/******************************************************************************
 *
 * BLE
@@ -687,10 +709,12 @@
#endif

#ifndef BTM_BLE_ADV_TX_POWER
#define BTM_BLE_ADV_TX_POWER {-21, -15, -7, 1, 9}
#define BTM_BLE_ADV_TX_POWER \
  { -21, -15, -7, 1, 9 }
#endif

/* The maximum number of simultaneous applications that can register with LE L2CAP. */
/* The maximum number of simultaneous applications that can register with LE
 * L2CAP. */
#ifndef BLE_MAX_L2CAP_CLIENTS
#define BLE_MAX_L2CAP_CLIENTS 15
#endif
@@ -755,7 +779,8 @@
#define GATT_CONFORMANCE_TESTING FALSE
#endif

/* number of background connection device allowence, ideally to be the same as WL size
/* number of background connection device allowence, ideally to be the same as
 * WL size
*/
#ifndef GATT_MAX_BG_CONN_DEV
#define GATT_MAX_BG_CONN_DEV 32
@@ -851,7 +876,8 @@
#define SDP_MAX_DISC_SERVER_RECS 21
#endif

/* The size of a scratchpad buffer, in bytes, for storing the response to an attribute request. */
/* The size of a scratchpad buffer, in bytes, for storing the response to an
 * attribute request. */
#ifndef SDP_MAX_LIST_BYTE_COUNT
#define SDP_MAX_LIST_BYTE_COUNT 4096
#endif
@@ -959,7 +985,8 @@
#define PORT_FC_DEFAULT PORT_FC_CREDIT
#endif

/* The maximum number of credits receiver sends to peer when using credit-based flow control. */
/* The maximum number of credits receiver sends to peer when using credit-based
 * flow control. */
#ifndef PORT_CREDIT_RX_MAX
#define PORT_CREDIT_RX_MAX 16
#endif
@@ -1051,7 +1078,6 @@
#define OBX_FCR_OPT_MAX_PDU_SIZE L2CAP_MPS_OVER_BR_EDR
#endif


/******************************************************************************
 *
 * BNEP
@@ -1075,7 +1101,6 @@
#define BNEP_DO_AUTH_FOR_ROLE_SWITCH TRUE
#endif


/* Maximum number of protocol filters supported. */
#ifndef BNEP_MAX_PROT_FILTERS
#define BNEP_MAX_PROT_FILTERS 5
@@ -1106,7 +1131,6 @@
#define BNEP_MAX_CONNECTIONS 7
#endif


/******************************************************************************
 *
 * AVDTP
@@ -1370,7 +1394,8 @@
#define MCA_INCLUDED FALSE
#endif

/* The MTU size for the L2CAP configuration on control channel. 48 is the minimal */
/* The MTU size for the L2CAP configuration on control channel. 48 is the
 * minimal */
#ifndef MCA_CTRL_MTU
#define MCA_CTRL_MTU 60
#endif
@@ -1380,12 +1405,14 @@
#define MCA_NUM_REGS 12
#endif

/* The maximum number of control channels (to difference devices) per registered MCAP instances. */
/* The maximum number of control channels (to difference devices) per registered
 * MCAP instances. */
#ifndef MCA_NUM_LINKS
#define MCA_NUM_LINKS 3
#endif

/* The maximum number of MDEP (including HDP echo) per registered MCAP instances. */
/* The maximum number of MDEP (including HDP echo) per registered MCAP
 * instances. */
#ifndef MCA_NUM_DEPS
#define MCA_NUM_DEPS 13
#endif
@@ -1444,7 +1471,8 @@ Range: 0, 1-0xFF

/* MCAP control channel FCR Option: Retransmission Timeout
The AVRCP specification set a value in the range of 300 - 2000 ms
Timeout (in msecs) to detect Lost I-Frames. Only used in Enhanced retransmission mode.
Timeout (in msecs) to detect Lost I-Frames. Only used in Enhanced retransmission
mode.
Range: Minimum 2000 (2 secs) when supporting PBF.
 */
#ifndef MCA_FCR_OPT_RETX_TOUT
@@ -1453,7 +1481,8 @@ Range: Minimum 2000 (2 secs) when supporting PBF.

/* MCAP control channel FCR Option: Monitor Timeout
The AVRCP specification set a value in the range of 300 - 2000 ms
Timeout (in msecs) to detect Lost S-Frames. Only used in Enhanced retransmission mode.
Timeout (in msecs) to detect Lost S-Frames. Only used in Enhanced retransmission
mode.
Range: Minimum 12000 (12 secs) when supporting PBF.
*/
#ifndef MCA_FCR_OPT_MONITOR_TOUT
@@ -1461,7 +1490,8 @@ Range: Minimum 12000 (12 secs) when supporting PBF.
#endif

/* MCAP control channel FCR Option: Maximum PDU payload size.
The maximum number of payload octets that the local device can receive in a single PDU.
The maximum number of payload octets that the local device can receive in a
single PDU.
*/
#ifndef MCA_FCR_OPT_MPS_SIZE
#define MCA_FCR_OPT_MPS_SIZE 1000
@@ -1503,7 +1533,9 @@ The maximum number of payload octets that the local device can receive in a sing

/* Set the CIND to match HFP 1.5 */
#ifndef BTA_AG_CIND_INFO
#define BTA_AG_CIND_INFO "(\"call\",(0,1)),(\"callsetup\",(0-3)),(\"service\",(0-1)),(\"signal\",(0-5)),(\"roam\",(0,1)),(\"battchg\",(0-5)),(\"callheld\",(0-2))"
#define BTA_AG_CIND_INFO                                                       \
  "(\"call\",(0,1)),(\"callsetup\",(0-3)),(\"service\",(0-1)),(\"signal\",(0-" \
  "5)),(\"roam\",(0,1)),(\"battchg\",(0-5)),(\"callheld\",(0-2))"
#endif

#ifndef BTA_DM_AVOID_A2DP_ROLESWITCH_ON_INQUIRY
+592 −207

File changed.

Preview size limit exceeded, changes collapsed.

+48 −42
Original line number Diff line number Diff line
@@ -24,9 +24,9 @@
#ifndef BTE_H
#define BTE_H

#include <pthread.h>
#include <semaphore.h>
#include <signal.h>
#include <pthread.h>
#include "bt_target.h"

#ifdef __cplusplus
@@ -52,8 +52,7 @@ extern "C" {
 * BTE_MODE_APPL_PROTOCOL_TRACE,     * this is a fake mode *
 * BTE_MODE_INVALID
 */
enum
{
enum {
  BTE_MODE_SERIAL_APP,          /* Sample serial port application      */
  BTE_MODE_APPL,                /* Target used with Tester through RPC */
  BTE_MODE_RESERVED,            /* Reserved                            */
@@ -63,14 +62,18 @@ enum
  BTE_MODE_INVALID
};

extern volatile uint8_t  bte_target_mode;    /* indicates the mode that the board is running in */
extern volatile uint8_t
    bte_target_mode; /* indicates the mode that the board is running in */

/* Startup options */
extern uint32_t bte_startup_options; /* Switch and jumper settings at startup */
void bte_get_startup_options(uint32_t *p_options);        /* Platform specific function for getting startup options */

#define BTE_OPTIONS_TARGET_MODE_MASK    0x00000007      /* bits 2-0 indicate target mode (QuickConnect: jp3 & jp4, BBY: SW3-1 & SW3-2)*/
void bte_get_startup_options(
    uint32_t*
        p_options); /* Platform specific function for getting startup options */

#define BTE_OPTIONS_TARGET_MODE_MASK                                         \
  0x00000007 /* bits 2-0 indicate target mode (QuickConnect: jp3 & jp4, BBY: \
                SW3-1 & SW3-2)*/

/****************************************************************************
 * Definitions to define which type of application gets built
@@ -78,18 +81,20 @@ void bte_get_startup_options(uint32_t *p_options); /* Platform specific f
#define BUILD_HCITOOL FALSE
#define BUILD_L2PING FALSE


#define LINUX_FM_DRIVER_INCLUDED FALSE


/* hcisu userial operations. should probably go into bt_types to avoid collisions! */
/* hcisu userial operations. should probably go into bt_types to avoid
 * collisions! */
#define BT_EVT_TO_HCISU_USERIAL_OP (0x0080 | BT_EVT_HCISU)
/* operation for above hcisu event */
#define BT_HCISU_USERIAL_OPEN (0)   /* open serial port calling USERIAL_Open() */
#define BT_HCISU_USERIAL_OPEN (0)  /* open serial port calling USERIAL_Open() \
                                      */
#define BT_HCISU_USERIAL_CLOSE (1) /* close userial port */
/* options associated with close op */
#define BT_HCISU_USERIAL_CL_NO_DIS_BT   0 /* do not touch bt_wake and power gpio */
#define BT_HCISU_USERIAL_CL_DIS_BT      1 /* put power and bt_wake into defined off state to preserve
#define BT_HCISU_USERIAL_CL_NO_DIS_BT \
  0 /* do not touch bt_wake and power gpio */
#define BT_HCISU_USERIAL_CL_DIS_BT                              \
  1 /* put power and bt_wake into defined off state to preserve \
       power */
/* status codes for callback */
#define BTE_HCISU_USERIAL_FAIL 0
@@ -103,7 +108,8 @@ typedef struct tHCISU_USERIAL_MSG_tag {
  uint8_t option; /* option for operation. depends on operation */
} tHCISU_USERIAL_MSG;

extern void bte_hcisu_userial_oper( tUSERIAL_MSG_CBACK *p_cback, uint8_t port, uint8_t op, uint8_t option );
extern void bte_hcisu_userial_oper(tUSERIAL_MSG_CBACK* p_cback, uint8_t port,
                                   uint8_t op, uint8_t option);

/* Pointer to function for sending HCI commands and data to the HCI tranport */
extern int (*p_bte_hci_send)(uint16_t port, BT_HDR* p_msg);
+4 −4
Original line number Diff line number Diff line
@@ -20,8 +20,8 @@

#include <stdbool.h>

#include "osi/include/config.h"
#include "module.h"
#include "osi/include/config.h"

#ifdef __cplusplus
extern "C" {
+5 −5

File changed.

Contains only whitespace changes.