int Fsm(void *pMessage, void* pSelf)
{
switch (pSelf.enState)
{
case INIT:
{
int = SendRegisterMsg();
pSelf.enState = REGISTER;
break;
}
case REGISTER:
{
switch (pMessage.uiEvtType)
{
case: UNAVALIABLE
pSelf.enState = INIT;
break;
case: REGISTERACK
pSelf.enState = ESTABLISH;
SendHanle();
break;
default:
}
}
case ESTABLISH:
{
switch (pMessage.uiEvtType)
{
case: UNAVALIABLE
pSelf.enState = INIT;
break;
case: REGACK
pSelf.enState = ACTIVE;
SendGetNumberRequest();
break;
default:
}
}
case ACTIVE:
{
switch (pMessage.uiEvtType)
{
case: UNAVALIABLE
pSelf.enState = INIT;
break;
case: GETNUMBERREQUESTACK
pSelf.enState = INIT;
ResolveNumer(pMessage);
break;
default:
}
}
default:
{
}
}
}