當前位置: 首頁>>代碼示例>>C++>>正文


C++ FsmAddTimer函數代碼示例

本文整理匯總了C++中FsmAddTimer函數的典型用法代碼示例。如果您正苦於以下問題:C++ FsmAddTimer函數的具體用法?C++ FsmAddTimer怎麽用?C++ FsmAddTimer使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了FsmAddTimer函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: l2_connected

static void
l2_connected(struct FsmInst *fi, int event, void *arg)
{
	layer2_t *l2 = fi->userdata;
	msg_t *msg = arg;
	int pr=-1;

	if (!get_PollFlag(l2, msg)) {
		l2_mdl_error_ua(fi, event, arg);
		return;
	}
	free_msg(msg);
	if (test_and_clear_bit(FLG_PEND_REL, &l2->flag))
		l2_disconnect(fi, event, NULL);
	if (test_and_clear_bit(FLG_L3_INIT, &l2->flag)) {
		pr = DL_ESTABLISH | CONFIRM;
	} else if (l2->vs != l2->va) {
		msg_queue_purge(&l2->i_queue);
		pr = DL_ESTABLISH | INDICATION;
	}
	stop_t200(l2, 5);

	l2->vr = 0;
	l2->vs = 0;
	l2->va = 0;
	l2->sow = 0;
	FsmChangeState(fi, ST_L2_7);
	FsmAddTimer(&l2->t203, l2->T203, EV_L2_T203, NULL, 4);
	if (pr != -1)
		l2up_create(l2, pr, CES(l2), 0, NULL);

	if (msg_queue_len(&l2->i_queue) && cansend(l2))
		FsmEvent(fi, EV_L2_ACK_PULL, NULL);
}
開發者ID:Distrotech,項目名稱:mISDNuser,代碼行數:34,代碼來源:net_l2.c

示例2: lc_start_delay

static void
lc_start_delay(struct FsmInst *fi, int event, void *arg)
{
       struct PStack *st = fi->userdata;

       FsmChangeState(fi, ST_L3_LC_REL_DELAY);
       FsmAddTimer(&st->l3.l3m_timer, DREL_TIMER_VALUE, EV_TIMEOUT, NULL, 50);
}
開發者ID:jameshilliard,項目名稱:actiontec_opensrc_mi424wr-rev-ef_fw-20-19-8,代碼行數:8,代碼來源:isdnl3.c

示例3: lc_start_delay_check

static void
lc_start_delay_check(struct FsmInst *fi, int event, void *arg)
/* 20/09/00 - GE timer not user for NI-1 as layer 2 should stay up */
{
       struct PStack *st = fi->userdata;

       FsmChangeState(fi, ST_L3_LC_REL_DELAY);
       /* 19/09/00 - GE timer not user for NI-1 */
       if (st->protocol != ISDN_PTYPE_NI1) 
       		FsmAddTimer(&st->l3.l3m_timer, DREL_TIMER_VALUE, EV_TIMEOUT, NULL, 50);
}
開發者ID:jameshilliard,項目名稱:actiontec_opensrc_mi424wr-rev-ef_fw-20-19-8,代碼行數:11,代碼來源:isdnl3.c

示例4: tei_id_verify

static void
tei_id_verify(struct FsmInst *fi, int event, void *arg)
{
	struct PStack *st = fi->userdata;

	if (st->ma.debug)
		st->ma.tei_m.printdebug(&st->ma.tei_m,
			"id verify request for tei %d", st->l2.tei);
	put_tei_msg(st, ID_VERIFY, 0, st->l2.tei);
	FsmChangeState(&st->ma.tei_m, ST_TEI_IDVERIFY);
	FsmAddTimer(&st->ma.t202, st->ma.T202, EV_T202, NULL, 2);
	st->ma.N202 = 2;
}
開發者ID:xricson,項目名稱:knoppix,代碼行數:13,代碼來源:tei.c

示例5: lc_release_req

static void
lc_release_req(struct FsmInst *fi, int event, void *arg)
{
	struct PStack *st = fi->userdata;

	if (test_bit(FLG_L2BLOCK, &st->l2.flag)) {
		if (st->l3.debug)
			l3_debug(st, "lc_release_req: l2 blocked");
		/* restart release timer */
		FsmAddTimer(&st->l3.l3m_timer, DREL_TIMER_VALUE, EV_TIMEOUT, NULL, 51);
	} else {
		FsmChangeState(fi, ST_L3_LC_REL_WAIT);
		st->l3.l3l2(st, DL_RELEASE | REQUEST, NULL);
	}
}
開發者ID:jameshilliard,項目名稱:actiontec_opensrc_mi424wr-rev-ef_fw-20-19-8,代碼行數:15,代碼來源:isdnl3.c

示例6: tei_id_request

static void
tei_id_request(struct FsmInst *fi, int event, void *arg)
{
	struct PStack *st = fi->userdata;

	if (st->l2.tei != -1) {
		st->ma.tei_m.printdebug(&st->ma.tei_m,
			"assign request for already assigned tei %d",
			st->l2.tei);
		return;
	}
	st->ma.ri = random_ri();
	if (st->ma.debug)
		st->ma.tei_m.printdebug(&st->ma.tei_m,
			"assign request ri %d", st->ma.ri);
	put_tei_msg(st, ID_REQUEST, st->ma.ri, 127);
	FsmChangeState(&st->ma.tei_m, ST_TEI_IDREQ);
	FsmAddTimer(&st->ma.t202, st->ma.T202, EV_T202, NULL, 1);
	st->ma.N202 = 3;
}
開發者ID:xricson,項目名稱:knoppix,代碼行數:20,代碼來源:tei.c

示例7: l2_start_multi

static void
l2_start_multi(struct FsmInst *fi, int event, void *arg)
{
	layer2_t *l2 = fi->userdata;
	msg_t *msg = arg;

	send_uframe(l2, NULL, UA | get_PollFlag(l2, msg), RSP);

	clear_exception(l2);
	l2->vs = 0;
	l2->va = 0;
	l2->vr = 0;
	l2->sow = 0;
	FsmChangeState(fi, ST_L2_7);
	FsmAddTimer(&l2->t203, l2->T203, EV_L2_T203, NULL, 3);
	msg_trim(msg, 0);
	msg_push(msg, mISDNUSER_HEAD_SIZE);
	if (l2up(l2, DL_ESTABLISH | INDICATION, CES(l2), msg))
		free_msg(msg);
}
開發者ID:Distrotech,項目名稱:mISDNuser,代碼行數:20,代碼來源:net_l2.c

示例8: tei_id_ver_tout

static void
tei_id_ver_tout(struct FsmInst *fi, int event, void *arg)
{
	struct PStack *st = fi->userdata;
	struct IsdnCardState *cs;

	if (--st->ma.N202) {
		if (st->ma.debug)
			st->ma.tei_m.printdebug(&st->ma.tei_m,
				"id verify req(%d) for tei %d",
				3 - st->ma.N202, st->l2.tei);
		put_tei_msg(st, ID_VERIFY, 0, st->l2.tei);
		FsmAddTimer(&st->ma.t202, st->ma.T202, EV_T202, NULL, 4);
	} else {
		st->ma.tei_m.printdebug(&st->ma.tei_m,
			"verify req for tei %d failed", st->l2.tei);
		L3L2(st, MDL_REMOVE | REQUEST, 0);
		cs = (struct IsdnCardState *) st->l1.hardware;
		mdl_remove(cs);
		FsmChangeState(fi, ST_TEI_NOP);
	}
}
開發者ID:xricson,項目名稱:knoppix,代碼行數:22,代碼來源:tei.c

示例9: tei_id_req_tout

static void
tei_id_req_tout(struct FsmInst *fi, int event, void *arg)
{
	struct PStack *st = fi->userdata;
	struct IsdnCardState *cs;

	if (--st->ma.N202) {
		st->ma.ri = random_ri();
		if (st->ma.debug)
			st->ma.tei_m.printdebug(&st->ma.tei_m,
				"assign req(%d) ri %d", 4 - st->ma.N202,
				st->ma.ri);
		put_tei_msg(st, ID_REQUEST, st->ma.ri, 127);
		FsmAddTimer(&st->ma.t202, st->ma.T202, EV_T202, NULL, 3);
	} else {
		st->ma.tei_m.printdebug(&st->ma.tei_m, "assign req failed");
		L3L2(st, MDL_ERROR | RESPONSE, 0);
		cs = (struct IsdnCardState *) st->l1.hardware;
		mdl_remove(cs);
		FsmChangeState(fi, ST_TEI_NOP);
	}
}
開發者ID:xricson,項目名稱:knoppix,代碼行數:22,代碼來源:tei.c

示例10: start_t200

inline void
start_t200(layer2_t *l2, int i)
{
	FsmAddTimer(&l2->t200, l2->T200, EV_L2_T200, NULL, i);
	test_and_set_bit(FLG_T200_RUN, &l2->flag);
}
開發者ID:Distrotech,項目名稱:mISDNuser,代碼行數:6,代碼來源:net_l2.c


注:本文中的FsmAddTimer函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。