本文整理汇总了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);
}
}
示例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();
}
}
示例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;
}
}
示例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]);
}
}
}
示例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;
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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;
}
}
示例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");*/
}