TWS Main FSM Functions

[English]

TWS_MAIN_FSM API Brief

Application

Brief

tws_mainfsm_entry()

TWS Main FSM entry

tws_mainfsm_initialise()

Initialize TWS Main FSM

tws_mainfsm_get_active_by_type()

Get the active status of the TWS Main FSM

tws_mainfsm_connnect_fsm_ongoing()

Check that the TWS main FSM is connecting

TWS_MAIN_FSM API Reference

Header File

Functions

void tws_mainfsm_entry(maimfsm_input_t mainfsm_input)

TWS Main FSM entry.

Handle the TWS Main finite state machine (FSM).

参数:

mainfsm_input[in] main FSM input of type maimfsm_input_t.

返回:

N/A

void tws_mainfsm_initialise(void)

Initialize TWS Main FSM.

Initialize the TWS Main finite state machine (FSM).

返回:

N/A

mainfsm_type_t tws_mainfsm_get_active_by_type(uint32_t mainfsm_type)

Get the active status of the TWS Main FSM.

More details

参数:

mainfsm_type[in] find mainfsm type, if the mainfsm type is INVALID_FSM, then return fsm type that the main fsm is currently running, without comparing the mainfsm_type.

返回:

main FSM input of type maimfsm_input_t.

bool tws_mainfsm_connnect_fsm_ongoing(btif_bd_addr_t *p_bd_addr)

Check that the TWS main FSM is connecting.

Check that the TWS main FSM is connecting to the mobile phone with address [p_bd_addr].

参数:

p_bd_addr[in] pointer to an address of type btif_bd_addr_t.

返回值:
  • true – on going

  • false – no action TWS_MAIN_FSM_H EOF

返回:

result

Structures

struct mobile_info_t

mobile information structure definition.

struct maimfsm_input_t

Main FSM input structure definition.

Macros

MAINFSM_ENV_MAX
INVALID_MAIN_FSM_IDX
INVALID_FSM
CONNECT_FSM
TWS_SWITCH_FSM
DISCONNECT_MOBILE_FSM
ENTER_PAIRING_FSM
DISCONNECT_TWS_FSM
CONNECT_TWS_MAIN_FSM

Type Definitions

typedef uint32_t mainfsm_type_t

Main FSM type definition.

Enumerations

enum main_action_e

Main action enumeration definition.

Values:

enumerator MAIN_IDLE_ACTION
enumerator MAIN_MOBILE_ENTER_ACTIVE_ACTION
enumerator MAIN_SNOOP_CONNECTED_ACTION
enumerator MAIN_PROFILE_SYNC_DONE_ACTION
enumerator MAIN_SNOOP_DISCONNECT_ACTION
enumerator MAIN_TWS_SWITCH_COMP_ACTION
enum mainfsm_state_e

Main FSM state enumeration definition.

Values:

enumerator MAIN_FSM_IDLE
enumerator MAIN_FSM_W4_TWS_CONNECTED

1

enumerator MAIN_FSM_W4_MOBILE_CONNECTED

2

enumerator MAIN_FSM_W4_TWS_DISCONNECTED

3

enumerator MAIN_FSM_W4_MOBILE_DISCONNECTED

4

enumerator MAIN_FSM_W4_ENTER_ACTIVE

5

enumerator MAIN_FSM_W4_SNOOP_CONNECTED

6

enumerator MAIN_FSM_W4_PROFILE_SYNC_DONE

7

enumerator MAIN_FSM_W4_SNOOP_DISCONNECTED

8

enumerator MAIN_FSM_W4_TWS_SWITCH_COMP

9