目录
6.twsTopology_GoalProcComplete / twsTopology_SmGoalCompleteDefaultHandler
9.TwsTopology_HandleGoalDecision
11.goalsEngine_QueueGoal/goalsEngine_DequeGoal --- GoalsEngine_ActivateGoal
13.twsTopology_SetTargetState---tws_topology_sm_rules.c
1.TwsTopology_Init
{TwsTopology_Init, TWS_TOPOLOGY_INIT_CFM, NULL},
bool TwsTopology_Init(Task init_task)
{
twsTopologyTaskData *tws_taskdata = TwsTopologyGetTaskData();
UNUSED(init_task);
tws_taskdata->task.handler = twsTopology_HandleMessage;
/* Handover is allowed by default, app may prohibit handover by calling
TwsTopology_ProhibitHandover() function with TRUE parameter */
tws_taskdata->app_prohibit_handover = FALSE;
tws_taskdata->advertising_params = LE_ADVERTISING_PARAMS_SET_TYPE_UNSET;
twsTopology_SmInit(&tws_taskdata->tws_sm);//初始化goals
PeerFindRole_RegisterTask(TwsTopologyGetTask());
StateProxy_StateProxyEventRegisterClient(TwsTopologyGetTask());
/* Register to enable interested state proxy events */
twsTopology_RegisterForStateProxyEvents();
/* Register for connect / discon