当前位置: 首页>>代码示例>>C++>>正文


C++ ctimer_stop函数代码示例

本文整理汇总了C++中ctimer_stop函数的典型用法代码示例。如果您正苦于以下问题:C++ ctimer_stop函数的具体用法?C++ ctimer_stop怎么用?C++ ctimer_stop使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ctimer_stop函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: handle_dao_timer

/*---------------------------------------------------------------------------*/
static void
handle_dao_timer(void *ptr)
{
  rpl_instance_t *instance;
#if RPL_CONF_MULTICAST
  uip_mcast6_route_t *mcast_route;
  uint8_t i;
#endif

  instance = (rpl_instance_t *)ptr;

  if(!dio_send_ok && uip_ds6_get_link_local(ADDR_PREFERRED) == NULL) {
    PRINTF("RPL: Postpone DAO transmission\n");
    ctimer_set(&instance->dao_timer, CLOCK_SECOND, handle_dao_timer, instance);
    return;
  }

  /* Send the DAO to the DAO parent set -- the preferred parent in our case. */
  if(instance->current_dag->preferred_parent != NULL) {
    PRINTF("RPL: handle_dao_timer - sending DAO\n");
    /* Set the route lifetime to the default value. */
    dao_output(instance->current_dag->preferred_parent, instance->default_lifetime);

#if RPL_CONF_MULTICAST
    /* Send DAOs for multicast prefixes only if the instance is in MOP 3 */
    if(instance->mop == RPL_MOP_STORING_MULTICAST) {
      /* Send a DAO for own multicast addresses */
      for(i = 0; i < UIP_DS6_MADDR_NB; i++) {
        if(uip_ds6_if.maddr_list[i].isused
            && uip_is_addr_mcast_global(&uip_ds6_if.maddr_list[i].ipaddr)) {
          dao_output_target(instance->current_dag->preferred_parent,
              &uip_ds6_if.maddr_list[i].ipaddr, RPL_MCAST_LIFETIME);
        }
      }

      /* Iterate over multicast routes and send DAOs */
      mcast_route = uip_mcast6_route_list_head();
      while(mcast_route != NULL) {
        /* Don't send if it's also our own address, done that already */
        if(uip_ds6_maddr_lookup(&mcast_route->group) == NULL) {
          dao_output_target(instance->current_dag->preferred_parent,
                     &mcast_route->group, RPL_MCAST_LIFETIME);
        }
        mcast_route = list_item_next(mcast_route);
      }
    }
#endif
  } else {
    PRINTF("RPL: No suitable DAO parent\n");
  }

  ctimer_stop(&instance->dao_timer);

  if(etimer_expired(&instance->dao_lifetime_timer.etimer)) {
    set_dao_lifetime_timer(instance);
  }
}
开发者ID:Anagalcala,项目名称:contiki-upstream-unstable,代码行数:58,代码来源:rpl-timers.c

示例2: subscription_clean

void
subscription_clean(void) {
	struct subscription_item *si;
	for (si = list_head(subscription_list);
			si != NULL; si = list_item_next(si)) {
		ctimer_stop(&si->t);
		subscription_init();
	}
}
开发者ID:sengjea,项目名称:mware,代码行数:9,代码来源:mware.c

示例3: stunicast_cancel

/*---------------------------------------------------------------------------*/
void
stunicast_cancel(struct stunicast_conn *c)
{
  ctimer_stop(&c->t);
  if(c->buf != NULL) {
    queuebuf_free(c->buf);
    c->buf = NULL;
  }
}
开发者ID:Sowhat2112,项目名称:KreyosFirmware,代码行数:10,代码来源:stunicast.c

示例4: rrep_packet_received

/*---------------------------------------------------------------------------*/
static void
rrep_packet_received(struct unicast_conn *uc, const rimeaddr_t *from)
{
    struct rrep_hdr *msg = packetbuf_dataptr();
    struct route_entry *rt;
    rimeaddr_t dest;
    struct route_discovery_conn *c = (struct route_discovery_conn *)
                                     ((char *)uc - offsetof(struct route_discovery_conn, rrepconn));

    PRINTF("%d.%d: rrep_packet_received from %d.%d towards %d.%d len %d\n",
           rimeaddr_node_addr.u8[0], rimeaddr_node_addr.u8[1],
           from->u8[0],from->u8[1],
           msg->dest.u8[0],msg->dest.u8[1],
           packetbuf_datalen());

    PRINTF("from %d.%d hops %d rssi %d lqi %d\n",
           from->u8[0], from->u8[1],
           msg->hops,
           packetbuf_attr(PACKETBUF_ATTR_RSSI),
           packetbuf_attr(PACKETBUF_ATTR_LINK_QUALITY));

    insert_route(&msg->originator, from, msg->hops);

    if(rimeaddr_cmp(&msg->dest, &rimeaddr_node_addr))
    {
        PRINTF("rrep for us!\n");
        rrep_pending = 0;
        ctimer_stop(&c->t);
        if(c->cb->new_route)
        {
            rimeaddr_t originator;

            /* If the callback modifies the packet, the originator address
               will be lost. Therefore, we need to copy it into a local
               variable before calling the callback. */
            rimeaddr_copy(&originator, &msg->originator);
            c->cb->new_route(c, &originator);
        }

    }
    else
    {
        rimeaddr_copy(&dest, &msg->dest);

        rt = route_lookup(&msg->dest);
        if(rt != NULL)
        {
            PRINTF("forwarding to %d.%d\n", rt->nexthop.u8[0], rt->nexthop.u8[1]);
            msg->hops++;
            unicast_send(&c->rrepconn, &rt->nexthop);
        }
        else
        {
            PRINTF("%d.%d: no route to %d.%d\n", rimeaddr_node_addr.u8[0], rimeaddr_node_addr.u8[1], msg->dest.u8[0], msg->dest.u8[1]);
        }
    }
}
开发者ID:aiss83,项目名称:nucbit,代码行数:58,代码来源:route-discovery.c

示例5: bcpForwardingEngine_stdControlStop

/*---------------------------------------------------------------------------*/
error_t bcpForwardingEngine_stdControlStop() {
	pmesg(200, "%s :: %s :: Line #%d\n", __FILE__, __func__, __LINE__);
	isRunningForwardingEngine = false;

	//Stop Beacons
	ctimer_stop(&beacon_timer);

	return SUCCESS;
}
开发者ID:RanHuang,项目名称:nick-project-contiki,代码行数:10,代码来源:BcpForwardingEngine.c

示例6: polite_cancel

/*---------------------------------------------------------------------------*/
void
polite_cancel(struct polite_conn *c)
{
  ctimer_stop(&c->t);
  if(c->q != NULL) {
    queuebuf_free(c->q);
    c->q = NULL;
  }
}
开发者ID:EmuxEvans,项目名称:calipso,代码行数:10,代码来源:polite.c

示例7: ota_mgr_timer_start

void ota_mgr_timer_start(module_code_t msg_code, uint32_t interval, ota_timer_mode_t mode, void *handler)
{
	switch (msg_code)
	{
#if (OTA_COMMON_SUPPORT == 1)	
	case COMMON:
	{	
		if(ota_common_tmr_mode != TIMER_NONE)
		{
			ctimer_stop(&ota_common_tmr);
		}
	    ctimer_set(&ota_common_tmr,(interval*CLOCK_SECOND)/1000,handler,NULL);
		ota_common_tmr_hdlr = handler;
		if(TIMER_MODE_SINGLE == mode)
			ota_common_tmr_mode = TIMER_INTERVAL;
		else
		{
			ota_common_tmr_mode = TIMER_PERIODIC;
		}
	}
	break;
#endif		
#if (OTA_UPGRADE_SUPPORT == 1)		
	case UPGRADE:
	{
		if(ota_upgrade_tmr_mode != TIMER_NONE)
		{
			ctimer_stop(&ota_upgrade_tmr);
		}	
		ctimer_set(&ota_upgrade_tmr,(interval*CLOCK_SECOND)/1000,handler,NULL);
		ota_upgrade_tmr_hdlr = handler;
		if(TIMER_MODE_SINGLE == mode)
			ota_upgrade_tmr_mode = TIMER_INTERVAL;
		else
		{
			ota_upgrade_tmr_mode = TIMER_PERIODIC;		
		}
	}
	break;
#endif
	default:
		break;
	}
}
开发者ID:songjw0820,项目名称:contiki_atmel,代码行数:44,代码来源:sc6-ota-mgr.c

示例8: polite_close

/*---------------------------------------------------------------------------*/
void
polite_close(struct polite_conn *c)
{
  abc_close(&c->c);
  ctimer_stop(&c->t);
  if(c->q != NULL) {
    queuebuf_free(c->q);
    c->q = NULL;
  }
}
开发者ID:EmuxEvans,项目名称:calipso,代码行数:11,代码来源:polite.c

示例9: transition

static void
transition(int state)
{
  if(state != deluge_state) {
    switch(deluge_state) {
    case DELUGE_STATE_MAINTAIN:
      ctimer_stop(&summary_timer);
      ctimer_stop(&profile_timer);
      break;
    case DELUGE_STATE_RX:
      ctimer_stop(&rx_timer);
      break;
    case DELUGE_STATE_TX:
      ctimer_stop(&tx_timer);
      break;
    }
    deluge_state = state;
  }
}
开发者ID:1847123212,项目名称:ampm_contiki_wisun,代码行数:19,代码来源:deluge.c

示例10: neighbor_attr_set_timeout

/*---------------------------------------------------------------------------*/
void
neighbor_attr_set_timeout(uint16_t time)
{
  if(timeout == 0 && time > 0) {
    ctimer_set(&ct, TIMEOUT_SECONDS * CLOCK_SECOND, timeout_check, NULL);
  } else if(timeout > 0 && time == 0) {
    ctimer_stop(&ct);
  }
  timeout = time;
}
开发者ID:EDAyele,项目名称:wsn430,代码行数:11,代码来源:neighbor-attr.c

示例11: uip_packetqueue_free

/*---------------------------------------------------------------------------*/
void
uip_packetqueue_free(struct uip_packetqueue_handle *handle)
{
  PRINTF("uip_packetqueue_free %p\n", handle);
  if(handle->packet != NULL) {
    ctimer_stop(&handle->packet->lifetimer);
    memb_free(&packets_memb, handle->packet);
    handle->packet = NULL;
  }
}
开发者ID:ajwlucas,项目名称:lib_xtcp,代码行数:11,代码来源:uip-packetqueue.c

示例12: ipolite_close

/*---------------------------------------------------------------------------*/
void
ipolite_close(struct ipolite_conn *c)
{
  broadcast_close(&c->c);
  ctimer_stop(&c->t);
  if(c->q != NULL) {
    queuebuf_free(c->q);
    c->q = NULL;
  }
}
开发者ID:Anagalcala,项目名称:contiki-upstream-unstable,代码行数:11,代码来源:ipolite.c

示例13: rpl_free_dag

void
rpl_free_dag(rpl_dag_t *dag)
{
  PRINTF("RPL: Leaving the DAG ");
  PRINT6ADDR(&dag->dag_id);
  PRINTF("\n");

  /* Remove routes installed by DAOs. */
  rpl_remove_routes(dag);

  /* Remove parents and the default route. */
  remove_parents(dag, 0);
  rpl_set_default_route(dag, NULL);

  ctimer_stop(&dag->dio_timer);
  ctimer_stop(&dag->dao_timer);

  dag->used = 0;
  dag->joined = 0;
}
开发者ID:C3MA,项目名称:hexabus,代码行数:20,代码来源:rpl-dag.c

示例14: ota_mgr_timer_stop

void ota_mgr_timer_stop(module_code_t msg_code)
{
	switch (msg_code)
	{
#if (OTA_COMMON_SUPPORT == 1)	
		case COMMON:
			ctimer_stop(&ota_common_tmr);
			ota_common_tmr_mode = TIMER_NONE;
			break;
#endif		
#if (OTA_UPGRADE_SUPPORT == 1)			
		case UPGRADE:
			ctimer_stop(&ota_upgrade_tmr);
			ota_upgrade_tmr_mode = TIMER_NONE;
			break;
#endif
		default:
			break;
	}
}
开发者ID:songjw0820,项目名称:contiki_atmel,代码行数:20,代码来源:sc6-ota-mgr.c

示例15: remove_queued_packet

/*---------------------------------------------------------------------------*/
static void
remove_queued_packet(void *item)
{
    struct packetqueue_item *i = item;
    struct packetqueue *q = i->queue;

    list_remove(*q->list, i);
    queuebuf_free(i->buf);
    ctimer_stop(&i->lifetimer);
    memb_free(q->memb, i);
    /*  printf("removing queued packet due to timeout\n");*/
}
开发者ID:aiss83,项目名称:nucbit,代码行数:13,代码来源:packetqueue.c


注:本文中的ctimer_stop函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。