📄 ma_acc3.c
字号:
(
U16 srcDlgIdx, /* source dialogue index */
U16 dstDlgIdx, /* destination dialogue index */
MaApConName *apn /* Apn to send */
)
#else
PUBLIC Void maAccOpenDlg(srcDlgIdx, dstDlgIdx,apn)
U16 srcDlgIdx; /* source dialogue index */
U16 dstDlgIdx; /* destination dialogue index */
MaApConName *apn; /* Apn to send */
#endif
{
Txt prntBuf[MA_PRNTBUF_SIZE]; /* buffer to print */
MaOpenEv openEv; /* open event structure */
PRIVATE Bool openCfm;
TRC2(maAccOpenDlg)
switch(maAccCb.curTst.state)
{
/* Send Open Request on SAP_0 */
case 0:
/* Prepare the open event structure */
maAccCb.curTst.state++;
maAccSetOpenEvent(&openEv,
&maAccAddrs[MA_ACC_MAP],
&maAccAddrs[MA_ACC_MAP_PEER],
apn,FALSE,FALSE);
MAACCOPENREQ(MA_ACC_SAP_0, srcDlgIdx, &openEv);
break;
/* Receive Dialogue Confirm on SAP_0 */
case 1:
maAccCb.curTst.state++;
maAccChkDlgCfm(MA_ACC_SAP_0, srcDlgIdx);
break;
/* Send Delimiter Request on SAP_0 */
case 2:
maAccCb.curTst.state++;
MAACCDELIMREQ(MA_ACC_SAP_0, srcDlgIdx);
break;
/* Receive Open Indication on SAP_1 */
case 3:
maAccCb.curTst.state++;
maAccChkOpenInd(MA_ACC_SAP_1, dstDlgIdx, apn);
break;
/* Receive Delimiter Indication on SAP_1 */
case 4:
maAccCb.curTst.state++;
maAccChkDelimInd(MA_ACC_SAP_1, dstDlgIdx);
break;
/* Send Open Response on SAP_1 */
case 5:
/* Prepare the open event structure */
maAccCb.curTst.state++;
maAccSetOpenEvent(&openEv,
&maAccAddrs[MA_ACC_MAP_PEER],
&maAccAddrs[MA_ACC_MAP],
apn,FALSE,FALSE);
MAACCOPENRSP(MA_ACC_SAP_1, dstDlgIdx, &openEv);
break;
/* Send Delimiter Request on SAP_1 */
case 6:
maAccCb.curTst.state++;
openCfm = FALSE;
MAACCDELIMREQ(MA_ACC_SAP_1, dstDlgIdx);
break;
/* Receive Open Confirm on SAP_0 */
case 7:
if (openCfm == FALSE)
{
openCfm = TRUE;
maAccChkOpenCfm(MA_ACC_SAP_0, srcDlgIdx, apn);
}
else
{
maAccCb.curTst.state++;
maAccChkDelimInd(MA_ACC_SAP_0, srcDlgIdx);
}
break;
default:
MAACCPRNERROR((prntBuf, "maAccOpenDlg: Bad State Info Passed\n"));
maAccCb.curTst.result = MA_TST_FAILED;
break;
}
RETVOID;
} /* end of maAccOpenDlg */
/*
*
* Fun: maAccOpenDlgNew
*
* Desc: It has two companion functions -
* maAccOpenDlgNewC, and maAccOpenDlgAndOperC1
*
* Ret: Void.
*
* Notes: None.
*
* File: ma_acc3.c
*
*/
#ifdef ANSI
PUBLIC Void maAccOpenDlgNew
(
U16 step,
U16 srcDlgIdx, /* source dialogue index */
U16 dstDlgIdx, /* destination dialogue index */
MaApConName *apn, /* Apn to send */
SpId srcSap,
SpId dstSap,
MaInvokeId *invId,
MaInvokeId *lnkInvId
)
#else
PUBLIC Void maAccOpenDlgNew(step, srcDlgIdx, dstDlgIdx,apn,srcSap,
dstSap, invId, lnkInvId)
U16 step;
U16 srcDlgIdx; /* source dialogue index */
U16 dstDlgIdx; /* destination dialogue index */
MaApConName *apn; /* Apn to send */
SpId srcSap;
SpId dstSap;
MaInvokeId *invId;
MaInvokeId *lnkInvId;
#endif
{
Txt prntBuf[MA_PRNTBUF_SIZE]; /* buffer to print */
MaOpenEv openEv; /* open event structure */
MaOprType oprCode;
oprCode=MAT_UPLOC;
MAACC_FILL_MANDATORY;
TRC2(maAccOpenDlgNew)
switch(step)
{
/* Send Open Request on SAP_0 */
case 0:
/* Prepare the open event structure */
maAccFlushQ();
maAccFlushMsgQ();
MAACCPRINT_TEST((prntBuf, "Send OpenReq on SAP 0\n"));
maAccCb.curTst.state++;
maAccSetOpenEvent(&openEv,
&maAccAddrs[MA_ACC_MAP],
&maAccAddrs[MA_ACC_MAP_PEER],
apn,FALSE,FALSE);
MAACCOPENREQ(srcSap, srcDlgIdx, &openEv);
break;
/* Receive Dialogue Confirm on SAP_0 */
case 1:
MAACCPRINT_TEST((prntBuf, "Receive DlgCfm on SAP 0\n"));
maAccCb.curTst.state++;
maAccChkDlgCfm(srcSap, srcDlgIdx);
break;
/* Send Delimiter Request on SAP_0 */
case 2:
MAACCPRINT_TEST((prntBuf, "Send DelimReq on SAP 0\n"));
maAccCb.curTst.state++;
MAACCDELIMREQ(srcSap, srcDlgIdx);
break;
/* Receive Open Indication on SAP_1 */
case 3:
MAACCPRINT_TEST((prntBuf, "Receive OpenInd on SAP 1\n"));
maAccCb.curTst.state++;
maAccChkOpenInd(dstSap, dstDlgIdx, apn);
break;
case 4:
MAACCPRINT_TEST((prntBuf, "Check for DelimInd on SAP 1\n"));
maAccCb.curTst.state++;
maAccChkDelimInd(dstSap, dstDlgIdx);
break;
default:
MAACCPRNERROR((prntBuf, "maAccOpenDlgNew: Bad State \n"));
maAccCb.curTst.result = MA_TST_FAILED;
break;
}
RETVOID;
} /* end of maAccOpenDlgNew */
/*
*
* Fun: maAccOpenDlgAnd3Oper
*
* Desc: It has two companion functions -
* maAccOpenDlgAnd3OperC, and maAccOpenDlgAnd3OperC1
*
* Ret: Void.
*
* Notes: None.
*
* File: ma_acc3.c
*
*/
#ifdef ANSI
PUBLIC Void maAccOpenDlgAnd3Oper
(
U16 step,
U16 srcDlgIdx, /* source dialogue index */
U16 dstDlgIdx, /* destination dialogue index */
MaApConName *apn, /* Apn to send */
SpId srcSap,
SpId dstSap,
MaInvokeId *invId,
MaInvokeId *lnkInvId
)
#else
PUBLIC Void maAccOpenDlgAnd3Oper(step, srcDlgIdx, dstDlgIdx,apn,srcSap,
dstSap, invId, lnkInvId)
U16 step;
U16 srcDlgIdx; /* source dialogue index */
U16 dstDlgIdx; /* destination dialogue index */
MaApConName *apn; /* Apn to send */
SpId srcSap;
SpId dstSap;
MaInvokeId *invId;
MaInvokeId *lnkInvId;
#endif
{
Txt prntBuf[MA_PRNTBUF_SIZE]; /* buffer to print */
MaOpenEv openEv; /* open event structure */
MaOprType oprCode;
PTR invoke;
oprCode=MAT_UPLOC;
MAACC_FILL_MANDATORY;
TRC2(maAccOpenDlgAnd3Oper)
switch(step)
{
/* Send Open Request on SAP_0 */
case 0:
/* Prepare the open event structure */
maAccFlushQ();
maAccFlushMsgQ();
MAACCPRINT_TEST((prntBuf, "Send OpenReq on SAP 0\n"));
maAccCb.curTst.state++;
maAccSetOpenEvent(&openEv,
&maAccAddrs[MA_ACC_MAP],
&maAccAddrs[MA_ACC_MAP_PEER],
apn,FALSE,FALSE);
MAACCOPENREQ(srcSap, srcDlgIdx, &openEv);
break;
/* Receive Dialogue Confirm on SAP_0 */
case 1:
MAACCPRINT_TEST((prntBuf, "Receive DlgCfm on SAP 0\n"));
maAccCb.curTst.state++;
maAccChkDlgCfm(srcSap, srcDlgIdx);
break;
case 2:
MAACCPRINT_TEST((prntBuf, "Send OprReq - 1 on SAP 0\n"));
maAccCb.curTst.state++;
invoke = (PTR )&maInvoke;
if (maAccSetInvoke(invoke, oprCode) != ROK)
{
MAACCPRNERROR((prntBuf, "failed to set Inv\n"));
maAccCb.curTst.result = MA_TST_FAILED;
break;
}
/* allocate an invoke Id for this operation */
if (maAccAllocInvokeId(invId) != ROK)
{
MAACCPRNERROR((prntBuf, "AllocInvokeId failed\n"));
maAccCb.curTst.result = MA_TST_FAILED;
break;
}
/* Now issue an operation request to MAP */
maAccOprReq(srcSap,
srcDlgIdx,
invId,
lnkInvId,
oprCode,
(PTR) invoke);
break;
case 3:
MAACCPRINT_TEST((prntBuf, "Send OprReq - 2 on SAP 0\n"));
maAccCb.curTst.state++;
invoke = (PTR )&maInvoke;
if (maAccSetInvoke(invoke, oprCode) != ROK)
{
MAACCPRNERROR((prntBuf, "failed to set Inv\n"));
maAccCb.curTst.result = MA_TST_FAILED;
break;
}
/* allocate an invoke Id for this operation */
if (maAccAllocInvokeId(invId+1) != ROK)
{
MAACCPRNERROR((prntBuf, "AllocInvokeId failed\n"));
maAccCb.curTst.result = MA_TST_FAILED;
break;
}
/* Now issue an operation request to MAP */
maAccOprReq(srcSap,
srcDlgIdx,
invId+1,
lnkInvId,
oprCode,
(PTR) invoke);
break;
case 4:
MAACCPRINT_TEST((prntBuf, "Send OprReq - 2 on SAP 0\n"));
maAccCb.curTst.state++;
invoke = (PTR )&maInvoke;
if (maAccSetInvoke(invoke, oprCode) != ROK)
{
MAACCPRNERROR((prntBuf, "failed to set Inv\n"));
maAccCb.curTst.result = MA_TST_FAILED;
break;
}
/* allocate an invoke Id for this operation */
if (maAccAllocInvokeId(invId+2) != ROK)
{
MAACCPRNERROR((prntBuf, "AllocInvokeId failed\n"));
maAccCb.curTst.result = MA_TST_FAILED;
break;
}
/* Now issue an operation request to MAP */
maAccOprReq(srcSap,
srcDlgIdx,
invId+2,
lnkInvId,
oprCode,
(PTR) invoke);
break;
/* Send Delimiter Request on SAP_0 */
case 5:
MAACCPRINT_TEST((prntBuf, "Send DelimReq on SAP 0\n"));
maAccCb.curTst.state++;
MAACCDELIMREQ(srcSap, srcDlgIdx);
break;
/* Receive Open Indication on SAP_1 */
case 6:
MAACCPRINT_TEST((prntBuf, "Receive OpenInd on SAP 1\n"));
maAccCb.curTst.state++;
maAccChkOpenInd(dstSap, dstDlgIdx, apn);
break;
case 7:
/* invoke event structure is checked inside the maAccChkOprInd */
MAACCPRINT_TEST((prntBuf, "Check for OperInd -1 on SAP 1\n"));
maAccCb.curTst.state++;
if (maAccChkOprInd(dstSap, dstDlgIdx, invId, oprCode) != ROK)
{
MAACCPRNERROR((prntBuf, "maAccTstClass13Inv: Chk Opr Ind failed\n"));
maAccCb.curTst.result = MA_TST_FAILED;
break;
}
/* operation response is sent before
getting Delimiter Indication */
break;
case 8:
/* invoke event structure is checked inside the maAccChkOprInd */
MAACCPRINT_TEST((prntBuf, "Check for OperInd - 2 on SAP 1\n"));
maAccCb.curTst.state++;
if (maAccChkOprInd(dstSap, dstDlgIdx, invId+1, oprCode) != ROK)
{
MAACCPRNERROR((prntBuf, "maAccTstClass13Inv: Chk Opr Ind failed\n"));
maAccCb.curTst.result = MA_TST_FAILED;
break;
}
/* operation response is sent before
getting Delimiter Indication */
break;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -