TWS Configuration Functions

[English]

TWS_CONFIG API Brief

Application

Brief

tws_config_initialise()

Initialize TWS configuration

tws_config_is_tws_addr()

Check that address is TWS address

tws_config_get_left_right()

Get earbud position

tws_config_get_tws_addr()

Get TWS address

tws_config_get_paring_timeout_ms()

Get TWS pairing timeout

tws_config_is_enable_one_bring_two()

Check that the one bring two mode is enabled

tws_config_is_enable_discon_enter_pair()

Check that the disconnect mobile enter pair is enabled

tws_config_set_tws_addr()

Set TWS address

tws_config_is_search_ux_enable()

Check that TWS earbud search is enabled.

tws_config_get_reconn_param()

Get reconnect parameters

tws_config_is_valid_tws_addr()

Check that the TWS address is valid

tws_config_enable_search_UX()

Enable TWS earbud search

tws_config_disable_search_UX()

Disable TWS earbud search

tws_config_set_left_right()

Set earbud position

TWS_CONFIG API Reference

Header File

Functions

void tws_config_initialise(btif_bd_addr_t local_addr, btif_bd_addr_t tws_addr, left_right_t left_right)

Initialize TWS configuration.

Initialize TWS configuration and send TWS initialization command to the controller.

参数:
  • local_addr[in] Local address of type btif_bd_addr_t.

  • tws_addr[in] TWS address of type btif_bd_addr_t.

  • left_right[in] TWS earbud position of type left_right_t.

返回:

N/A

bool tws_config_is_tws_addr(btif_bd_addr_t addr)

Check that address is TWS address.

Check that the address [addr] is the TWS address in the configuration.

参数:

addr[in] address of type btif_bd_addr_t

返回值:
  • true – is the TWS address

  • false – unknown address

返回:

result

left_right_t tws_config_get_left_right(void)

Get earbud position.

Get the earbud position in the configuration.

返回:

earbud position of type left_right_t

btif_bd_addr_t tws_config_get_tws_addr(void)

Get TWS address.

Get the TWS address in the configuration.

返回:

TWS address of type btif_bd_addr_t

uint32_t tws_config_get_paring_timeout_ms(void)

Get TWS pairing timeout.

Get the TWS pairing timeout in the configuration.

返回:

TWS pairing timeout (ms)

bool tws_config_is_enable_one_bring_two(void)

Check that the one bring two mode is enabled.

Check that the one bring two mode is enabled in the configuration.

返回值:
  • true – enable

  • false – disable

返回:

result

bool tws_config_is_enable_discon_enter_pair(void)

Check that the disconnect mobile enter pair is enabled.

Check that the disconnect mobile enter pair is enabled in the configuration.

返回值:
  • true – enable

  • false – disable

返回:

result

void tws_config_set_tws_addr(btif_bd_addr_t tws_addr)

Set TWS address.

Set the TWS address in the configuration.

参数:

tws_addr[in] TWS address of type btif_bd_addr_t

返回:

N/A

bool tws_config_is_search_ux_enable(void)

Check that TWS earbud search is enabled.

Check that another paired TWS earbud search is enabled in the configuration.

返回值:
  • true – enable

  • false – disable

返回:

result

tws_reconn_cfg_t *tws_config_get_reconn_param(void)

Get reconnect parameters.

Get reconnect parameters in the configuration.

返回:

pointer to reconnect parameters of type tws_reconn_cfg_t

bool tws_config_is_valid_tws_addr(void)

Check that the TWS address is valid.

Check that the TWS address is valid in the configuration.

返回值:
  • true – valid

  • false – invalid

返回:

result

void tws_config_enable_search_UX(void)

Enable TWS earbud search.

Enable search for another paired TWS earbud in the configuration.

返回:

N/A

void tws_config_disable_search_UX(void)

Disable TWS earbud search.

Disable search for another paired TWS earbud in the configuration.

返回:

N/A

void tws_config_set_left_right(uint8_t left_right)

Set earbud position.

Set the earbud position in the configuration.

参数:

left_right[in] earbud position of type left_right_t

返回:

N/A TWS_CONFIG_H EOF

Structures

struct tws_reconn_cfg_t

TWS reconnection configuration structure definition.

struct tws_config_t

TWS configuration structure definition.

Macros

Number of TWS linked mobile phones supported

CTO_MAX_RETRY

Maximum number of reconnections

CTO_INTERVAL_MS

Reconnect interval (ms)

TWS_PARING_TIMEOUT_MS

TWS paring timeout (ms)

LEFT_POS

left position

RIGHT_POS

right position

UNKNOWN_POS

unknown position

PAIRING_TWS_DISCONNECT_SET
PAIRING_TWS_CONNECTED_L_SET
PAIRING_TWS_CONNECTED_R_SET
NORMAL_TWS_CONNECTED_L_SET
NORMAL_TWS_CONNECTED_R_SET
NORMAL_TWS_DISCONNECTED_L_SET
NORMAL_TWS_DISCONNECTED_R_SET
BOX_CLOSED_SET

Type Definitions

typedef uint8_t left_right_t

TWS earbud position type definition.