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

Commit e630f985 authored by Sanket Agarwal's avatar Sanket Agarwal
Browse files

BTA HF Client should use dynamic control block

Most of the functions in bta_hf_client_at.cc are
currently using a static field for passing callbacks to
BTIF layer. In order to support multi device we need to make
the functions have a parameter which denotes the device.

In order to pass all the required information we choose to
pass the control block for the device instead.

Bug: b/30984220
Test: Manual regression test

Change-Id: Iac692d7e28df3955ddbd28707c323c41714bd86a
parent 14609584
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -65,7 +65,6 @@ LOCAL_SRC_FILES:= \
    ./hf_client/bta_hf_client_act.cc \
    ./hf_client/bta_hf_client_api.cc \
    ./hf_client/bta_hf_client_at.cc \
    ./hf_client/bta_hf_client_cmd.cc \
    ./hf_client/bta_hf_client_main.cc \
    ./hf_client/bta_hf_client_rfc.cc \
    ./hf_client/bta_hf_client_sco.cc \
+170 −372

File changed.

Preview size limit exceeded, changes collapsed.

+21 −88

File changed.

Preview size limit exceeded, changes collapsed.

+686 −337

File changed.

Preview size limit exceeded, changes collapsed.

+0 −53
Original line number Diff line number Diff line
@@ -24,52 +24,6 @@
/* ASCII character string of arguments to the AT command */
#define BTA_HF_CLIENT_AT_MAX_LEN 512

/* AT command table element */
typedef struct {
  const char* p_cmd; /* AT command string */
  uint8_t arg_type;  /* allowable argument type syntax */
  uint8_t fmt;       /* whether arg is int or string */
  uint8_t min;       /* minimum value for int arg */
  int16_t max;       /* maximum value for int arg */
} tBTA_AG_AT_CMD;

/* callback function executed when command is parsed */
typedef void(tBTA_AG_AT_CMD_CBACK)(void* p_user, uint16_t cmd, uint8_t arg_type,
                                   char* p_arg, int16_t int_arg);

/* callback function executed to send "ERROR" result code */
typedef void(tBTA_AG_AT_ERR_CBACK)(void* p_user, bool unknown, char* p_arg);

enum {
  BTA_HF_CLIENT_AT_NONE,
  BTA_HF_CLIENT_AT_BRSF,
  BTA_HF_CLIENT_AT_BAC,
  BTA_HF_CLIENT_AT_CIND,
  BTA_HF_CLIENT_AT_CIND_STATUS,
  BTA_HF_CLIENT_AT_CMER,
  BTA_HF_CLIENT_AT_CHLD,
  BTA_HF_CLIENT_AT_CMEE,
  BTA_HF_CLIENT_AT_BIA,
  BTA_HF_CLIENT_AT_CLIP,
  BTA_HF_CLIENT_AT_CCWA,
  BTA_HF_CLIENT_AT_COPS,
  BTA_HF_CLIENT_AT_CLCC,
  BTA_HF_CLIENT_AT_BVRA,
  BTA_HF_CLIENT_AT_VGS,
  BTA_HF_CLIENT_AT_VGM,
  BTA_HF_CLIENT_AT_ATD,
  BTA_HF_CLIENT_AT_BLDN,
  BTA_HF_CLIENT_AT_ATA,
  BTA_HF_CLIENT_AT_CHUP,
  BTA_HF_CLIENT_AT_BTRH,
  BTA_HF_CLIENT_AT_VTS,
  BTA_HF_CLIENT_AT_BCC,
  BTA_HF_CLIENT_AT_BCS,
  BTA_HF_CLIENT_AT_CNUM,
  BTA_HF_CLIENT_AT_NREC,
  BTA_HF_CLIENT_AT_BINP,
};

typedef uint8_t tBTA_HF_CLIENT_AT_CMD;

/* Maximum combined buffer for received AT events string */
@@ -104,10 +58,3 @@ typedef struct {
  int indicator_lookup[BTA_HF_CLIENT_AT_INDICATOR_COUNT];

} tBTA_HF_CLIENT_AT_CB;

/*****************************************************************************
 *  Functions
 ****************************************************************************/

void bta_hf_client_at_init(void);
void bta_hf_client_at_reset(void);
Loading