• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ PROCESS_WAIT_UNTIL函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: PROCESS_THREAD

/*---------------------------------------------------------------------------*/
PROCESS_THREAD(depth_blink_process, ev, data)
{
    static struct etimer et;
    static int count;

    PROCESS_BEGIN();

    while(1) {
        etimer_set(&et, CLOCK_SECOND * 10);
        PROCESS_WAIT_UNTIL(etimer_expired(&et));
        count = collect_depth(&tc);
        if(count == COLLECT_MAX_DEPTH) {
            leds_on(LEDS_BLUE);
        } else {
            leds_off(LEDS_BLUE);
            count /= COLLECT_LINK_ESTIMATE_UNIT;
            while(count > 0) {
                leds_on(LEDS_RED);
                etimer_set(&et, CLOCK_SECOND / 32);
                PROCESS_WAIT_UNTIL(etimer_expired(&et));
                leds_off(LEDS_RED);
                etimer_set(&et, CLOCK_SECOND / 8);
                PROCESS_WAIT_UNTIL(etimer_expired(&et));
                --count;
            }
        }
    }

    PROCESS_END();
}
开发者ID:CCH55,项目名称:contiki,代码行数:31,代码来源:sky-collect.c


示例2: PROCESS_THREAD

/*---------------------------------------------------------------------------*/
PROCESS_THREAD(blinker_process, ev, data)
{
	static struct etimer et;
	static uint8_t red, green;
	PROCESS_BEGIN();

	etimer_set(&et, CLOCK_SECOND / 2);
	while(1) {
		PROCESS_WAIT_UNTIL(etimer_expired(&et));
		etimer_reset(&et);
		if(0) {
			leds_on(LEDS_RED);
			red = 1;
			} else {
			red = 0;
		}
		if(!ip64_hostaddr_is_configured()) {
			leds_on(LEDS_GREEN);
			green = 1;
			} else {
			green = 0;
		}
		PROCESS_WAIT_UNTIL(etimer_expired(&et));
		etimer_reset(&et);
		if(red) {
			leds_off(LEDS_RED);
		}
		if(green) {
			leds_off(LEDS_GREEN);
		}
	}
	PROCESS_END();
}
开发者ID:songjw0820,项目名称:contiki_atmel,代码行数:34,代码来源:router-node.c


示例3: PROCESS_THREAD

/*---------------------------------------------------------------------------*/
PROCESS_THREAD(example_collect_process, ev, data)
{
  static struct etimer periodic;
  static struct etimer et;

  PROCESS_BEGIN();

  collect_open(&tc, 130, COLLECT_ROUTER, &callbacks);

  if(linkaddr_node_addr.u8[0] == 1 &&
     linkaddr_node_addr.u8[1] == 0) {
    printf("I am sink\n");
    collect_set_sink(&tc, 1);
  }

  /* Allow some time for the network to settle. */
  etimer_set(&et, 120 * CLOCK_SECOND);
  PROCESS_WAIT_UNTIL(etimer_expired(&et));

  while(1) {

    /* Send a packet every 30 seconds. */
    etimer_set(&periodic, CLOCK_SECOND * 30);
    etimer_set(&et, random_rand() % (CLOCK_SECOND * 30));

    PROCESS_WAIT_UNTIL(etimer_expired(&et));

    {
      static linkaddr_t oldparent;
      const linkaddr_t *parent;

      printf("Sending\n");
      packetbuf_clear();
      packetbuf_set_datalen(sprintf(packetbuf_dataptr(),
                                    "%s", "Hello") + 1);
      collect_send(&tc, 15);

      parent = collect_parent(&tc);
      if(!linkaddr_cmp(parent, &oldparent)) {
        if(!linkaddr_cmp(&oldparent, &linkaddr_null)) {
          printf("#L %d 0\n", oldparent.u8[0]);
        }
        if(!linkaddr_cmp(parent, &linkaddr_null)) {
          printf("#L %d 1\n", parent->u8[0]);
        }
        linkaddr_copy(&oldparent, parent);
      }
    }

    PROCESS_WAIT_UNTIL(etimer_expired(&periodic));
  }

  PROCESS_END();
}
开发者ID:1847123212,项目名称:contiki,代码行数:55,代码来源:example-collect.c


示例4: PROCESS_THREAD

/*---------------------------------------------------------------------------*/
PROCESS_THREAD(unicast_sender_process, ev, data)
{
  static struct etimer periodic_timer;
  static struct etimer send_timer;
  uip_ipaddr_t global_ipaddr;

  PROCESS_BEGIN();

  if(node_id == 0) {
    NETSTACK_RDC.off(0);
    printf("Node id unset, my mac is ");
    uip_debug_lladdr_print(&rimeaddr_node_addr);
    printf("\n");
    PROCESS_EXIT();
  }

  cc2420_set_txpower(RF_POWER);
  cc2420_set_cca_threshold(RSSI_THR);
  orpl_log_start();

  printf("App: %u starting\n", node_id);

  deployment_init(&global_ipaddr);
#if WITH_ORPL
  orpl_init(node_id == ROOT_ID, 0);
#endif /* WITH_ORPL */
  simple_udp_register(&unicast_connection, UDP_PORT,
                      NULL, UDP_PORT, receiver);

  if(node_id == ROOT_ID) {
    NETSTACK_RDC.off(1);
    etimer_set(&periodic_timer, 2 * 60 * CLOCK_SECOND);
    PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&periodic_timer));
    etimer_set(&periodic_timer, SEND_INTERVAL);
    while(1) {
      etimer_set(&send_timer, random_rand() % (SEND_INTERVAL));
      PROCESS_WAIT_UNTIL(etimer_expired(&send_timer));

      if(check_reachable_count()) {
        uip_ipaddr_t dest_ipaddr;
        static uint16_t target_id;
        static uint16_t i;
        do {
          target_id = get_node_id_from_index((random_rand()>>8)%get_n_nodes());
          set_ipaddr_from_id(&dest_ipaddr, target_id);
        } while (target_id == ROOT_ID || !orpl_routing_set_contains(&dest_ipaddr));
        app_send_to(target_id);
      }

      PROCESS_WAIT_UNTIL(etimer_expired(&periodic_timer));
      etimer_reset(&periodic_timer);
    }
  }
开发者ID:simonduq,项目名称:orpl,代码行数:54,代码来源:app-down-only.c


示例5: PROCESS_THREAD

PROCESS_THREAD(shell_broadcast_hi_process, ev, data)
{
	static struct etimer etimer;
	
//	PROCESS_EXITHANDLER(broadcast_close(&broadcast);)
//	PROCESS_EXITHANDLER(mesh_close(&mesh); broadcast_close(&broadcast);)
	PROCESS_BEGIN();

	static int8_t counter = 0;
	static uint8_t fail_count = 0;
	mesh_open(&mesh, 132, &callbacks);
	broadcast_open(&broadcast, 129, &broadcast_call);

	while(1) {
	counter++;

    leds_on(LEDS_ALL);
    etimer_set(&etimer, 3 * CLOCK_SECOND);
    PROCESS_WAIT_UNTIL(etimer_expired(&etimer));
    leds_off(LEDS_ALL);

	etimer_set(&etimer, random_rand() % 5 * CLOCK_SECOND + 
		random_rand() % 100 * CLOCK_SECOND / 100);
	PROCESS_WAIT_UNTIL(etimer_expired(&etimer));
	packetbuf_copyfrom("Hello", 6);
	broadcast_send(&broadcast);

	etimer_set(&etimer, random_rand() % 5 * CLOCK_SECOND + 
		random_rand() % 100 * CLOCK_SECOND / 100);
    PROCESS_WAIT_UNTIL(etimer_expired(&etimer));
	char message[6] = "Hello";
	rimeaddr_t addr;
	packetbuf_copyfrom(message, sizeof(message));
	addr.u8[0] = 62;
	addr.u8[1] = 41;
	uint8_t mesh_sent = 0;
	mesh_sent = mesh_send(&mesh, &addr);
	if (mesh_sent == 0) {
		fail_count++;
		if (counter == 10 && fail_count >= 4)
		{
			mesh_open(&mesh, 132, &callbacks);
			counter = 0;
			fail_count = 0;
		} else if (counter == 10)
			counter = 0;
	}
	}

	PROCESS_END();
}
开发者ID:beaucha3,项目名称:contikiV,代码行数:51,代码来源:say-hi.c


示例6: PROCESS_THREAD

/*---------------------------------------------------------------------------*/
PROCESS_THREAD(unicast_sender_process, ev, data)
{
  static struct etimer periodic_timer;
  static struct etimer send_timer;
  uip_ipaddr_t global_ipaddr;

  PROCESS_BEGIN();

  printf("App: %u starting\n", node_id);

  uip_ip6addr(&root_ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 1);

  if(node_id == ROOT_ID) {
    memcpy(&global_ipaddr, &root_ipaddr, 16);
    uip_ds6_addr_add(&global_ipaddr, 0, ADDR_MANUAL);
    rpl_dag_t *dag = rpl_set_root(RPL_DEFAULT_INSTANCE, &global_ipaddr);
    rpl_set_prefix(dag, &global_ipaddr, 64);
  } else {
    uip_ip6addr(&global_ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 0);
    uip_ds6_set_addr_iid(&global_ipaddr, &uip_lladdr);
    uip_ds6_addr_add(&global_ipaddr, 0, ADDR_AUTOCONF);
  }

  orpl_init(&global_ipaddr, node_id == ROOT_ID, 1);
  simple_udp_register(&unicast_connection, UDP_PORT,
                      NULL, UDP_PORT, receiver);

  if(node_id == ROOT_ID) {
    NETSTACK_RDC.off(1);
  } else {
    etimer_set(&periodic_timer, SEND_INTERVAL);
    while(1) {
      etimer_set(&send_timer, random_rand() % (SEND_INTERVAL));
      PROCESS_WAIT_UNTIL(etimer_expired(&send_timer));

      if(orpl_current_edc() != 0xffff) {
        app_send_to(ROOT_ID);
      } else {
        printf("App: not in DODAG\n");
      }

      PROCESS_WAIT_UNTIL(etimer_expired(&periodic_timer));
      etimer_reset(&periodic_timer);
    }
  }

  PROCESS_END();
}
开发者ID:Johnyren,项目名称:orpl,代码行数:49,代码来源:app-collect-only.c


示例7: PROCESS_THREAD

/*---------------------------------------------------------------------------*/
PROCESS_THREAD(acc_process, ev, data)
{
  static struct etimer etimer;
  
  PROCESS_BEGIN();
  
  printf("Starting measuring acceleration\r\n");
  boardPrintStringDescription();
  SENSORS_ACTIVATE(acc_sensor);
  
  // Enable High Range.
  //acc_sensor.configure(ACC_RANGE, ACC_HIGH_RANGE);
  
  // Enable High Pass Filter.
  //acc_sensor.configure(ACC_HPF, ACC_1HZ);


  while(1) {
    etimer_set(&etimer, CLOCK_SECOND/2);
    
    PROCESS_WAIT_UNTIL(etimer_expired(&etimer));
    
    printf("(X,Y,Z): (%d,%d,%d) mg      \r",acc_sensor.value(ACC_X_AXIS),acc_sensor.value(ACC_Y_AXIS),acc_sensor.value(ACC_Z_AXIS));
    
  }
  
  
  PROCESS_END();
}
开发者ID:13416795,项目名称:contiki,代码行数:30,代码来源:acc-example.c


示例8: PROCESS_THREAD

PROCESS_THREAD(button_process, ev, data)
{
  static struct etimer etimer;

  PROCESS_EXITHANDLER(goto exit);
  PROCESS_BEGIN();

  printf("button_process starting\n");

  while(1) {
    PROCESS_WAIT_EVENT();

    if(ev == PROCESS_EVENT_MSG && data != NULL
       && ((struct button_msg *)data)->type == BUTTON_MSG_TYPE) {
      printf("button press\n");

      leds_toggle(LEDS_ALL);
      etimer_set(&etimer, CLOCK_SECOND);
      PROCESS_WAIT_UNTIL(etimer_expired(&etimer));
      leds_toggle(LEDS_ALL);
    }
  }

 exit:
  printf("button_process exiting\n");
  PROCESS_END();
}
开发者ID:EDAyele,项目名称:ptunes,代码行数:27,代码来源:dhclient.c


示例9: PROCESS_THREAD

/*---------------------------------------------------------------------------*/
PROCESS_THREAD(burn_process, ev, data)
{
  PROCESS_BEGIN();

  etimer_set(&etimer, 5*CLOCK_SECOND);
  PROCESS_WAIT_UNTIL(etimer_expired(&etimer));

  watchdog_stop();
  leds_on(LEDS_RED);
#if NODEID
  printf("Burning node id %d\n", NODEID);
  node_id_burn(NODEID);
  leds_on(LEDS_BLUE);
  node_id_restore();
  printf("Restored node id %d\n", node_id);
#else
#error "burn-nodeid must be compiled with nodeid=<the ID of the node>"
  node_id_restore();
  printf("Restored node id %d\n", node_id);
#endif
  leds_off(LEDS_RED + LEDS_BLUE);
  watchdog_start();
  while(1) {
    PROCESS_WAIT_EVENT();
  }
  PROCESS_END();
}
开发者ID:Inscribe,项目名称:msp430xf1611,代码行数:28,代码来源:burn-nodeid.c


示例10: PROCESS_THREAD

/*---------------------------------------------------------------------------*/
PROCESS_THREAD(shell_change_detect_process, ev, data)
{
	static struct etimer etimer;

	PROCESS_BEGIN();
	
	leds_init();
	while(1) {
		sensor_init();
		etimer_set(&etimer, CLOCK_SECOND / 4);
		PROCESS_WAIT_UNTIL(etimer_expired(&etimer));
		sample = sensor_read();
		sensor_uinit();
		printf("sample = %d\n",sample);
		
		if(abs_sub(sample, sample_mean) > (sample_std_dev * NUM_DEVS)) {
			// Change detected, turn on LED(s)?
			leds_on(LEDS_RED);
		} else {
			// Turn off LED(s).
			leds_off(LEDS_RED);
		}
	}

	PROCESS_END();
}
开发者ID:beaucha3,项目名称:contikiV,代码行数:27,代码来源:test-change-detect.c


示例11: PROCESS_THREAD

/*---------------------------------------------------------------------------*/
PROCESS_THREAD(test_process, ev, data)
{
  PROCESS_BEGIN();

  // Wait a second...
  etimer_set(&timer, CLOCK_SECOND);
  PROCESS_WAIT_UNTIL(etimer_expired(&timer));

  PRINTD("Starting test...\n");

  // Run tests...
  char *result = run_tests();
  if (result != 0) {
    printf("%s\n", result);
  } else {
    printf("ALL TESTS PASSED\n");
  }
  printf("Tests run: %d\n", tests_run);

  return result != 0;

  cfs_fat_umount_device();
  
//  printf("#################################################################");

  while (1);

  PROCESS_END();
}
开发者ID:DrMcCoy,项目名称:contiki-inga,代码行数:30,代码来源:run-tests.c


示例12: PROCESS_THREAD

/*---------------------------------------------------------------------------*/
PROCESS_THREAD(shell_download_process, ev, data)
{
  const char *nextptr;
  static rimeaddr_t addr;
  int len;
  char buf[32];

  PROCESS_BEGIN();

  /* Parse node addr */
  addr.u8[0] = shell_strtolong(data, &nextptr);
  if(nextptr == data || *nextptr != '.') {
    shell_output_str(&download_command,
        "download <node addr> <filename>: need node address", "");
    PROCESS_EXIT();
  }
  ++nextptr;
  addr.u8[1] = shell_strtolong(nextptr, &nextptr);

  /* Get the length of the file, excluding a terminating NUL character. */
  while(nextptr[0] == ' ') {
    nextptr++;
  }
  len = strlen(nextptr);

  /*snprintf(buf, sizeof(buf), "%d.%d", addr.u8[0], addr.u8[1]);*/
  /*shell_output_str(&download_command, "Downloading from: ", buf);*/

  if(len > PACKETBUF_SIZE - 32) {
    snprintf(buf, sizeof(buf), "%d", len);
    shell_output_str(&download_command, "filename too large: ", buf);
    PROCESS_EXIT();
  }

  /*shell_output_str(&download_command, "Downloading file: ", nextptr);*/

  /* Send file request */
  downloading = 1;
  rucb_open(&rucb, RUCB_CHANNEL, &rucb_call);
  packetbuf_clear();
  *((uint8_t *)packetbuf_dataptr()) = ++req_seq_counter;
  memcpy(((char *)packetbuf_dataptr()) + 1, nextptr, len + 1);
  packetbuf_set_datalen(len + 2);
  PRINTF("requesting '%s'\n", nextptr);
  runicast_send(&runicast, &addr, MAX_RETRANSMISSIONS);

  /* Wait for download to finish */
  leds_on(LEDS_BLUE);
  PROCESS_WAIT_UNTIL(!runicast_is_transmitting(&runicast) && !downloading);
  leds_off(LEDS_BLUE);

  rucb_close(&rucb);
  /*shell_output_str(&download_command, "Done!", "");*/

  PROCESS_END();
}
开发者ID:EDAyele,项目名称:ptunes,代码行数:57,代码来源:shell-download.c


示例13: PROCESS_THREAD

/*---------------------------------------------------------------------------*/
PROCESS_THREAD(udp_client_process, ev, data)
{
  static struct etimer et, wake_timer, periodic_timer;
  uip_ipaddr_t ipaddr;

  PROCESS_BEGIN();
  PRINTF("UDP client process started\n");

#if UIP_CONF_ROUTER
  set_global_address();
#endif

  print_local_addresses();

  set_connection_address(&ipaddr);

  /* new connection with remote host */
  client_conn = udp_new(&ipaddr, UIP_HTONS(3000), NULL);
  udp_bind(client_conn, UIP_HTONS(3001));

  PRINTF("Created a connection with the server ");
  PRINT6ADDR(&client_conn->ripaddr);
  PRINTF(" local/remote port %u/%u\n",
	UIP_HTONS(client_conn->lport), UIP_HTONS(client_conn->rport));

  etimer_set(&et, CLOCK_SECOND*10);
  PROCESS_WAIT_UNTIL(etimer_expired(&et)); // Wait for DAD and Router Discovery procedure to end.

  etimer_set(&et, SEND_INTERVAL);
  etimer_set(&wake_timer, AWAKE_INTERVAL);
  etimer_set(&periodic_timer, 1);

  while(1) {
    PROCESS_YIELD();
    if(etimer_expired(&wake_timer)){  // if timer hasn't expired do not go in deep sleep, in order to receive a response.
		printf("Sleeping...\r\n");
		sensorsPowerDown();
		sleep_seconds(SLEEP_INTERVAL_SECONDS); // Put system in deep sleep mode for a while.
		sensorsPowerUp();
		printf("Awake\r\n");
    }
    if(etimer_expired(&et)) {
      timeout_handler();
      etimer_restart(&et);
      etimer_restart(&wake_timer);
    } else if(ev == tcpip_event) {
      tcpip_handler();
    }

    /* Make the process be called almost immediately,
     * so that it can force the system to go into deep sleep. */
    etimer_restart(&periodic_timer);
  }

  PROCESS_END();
}
开发者ID:pkocsis,项目名称:contiki-mirror,代码行数:57,代码来源:udp-client.c


示例14: test_rtimer

static void test_rtimer(void)
{
	while(1)
	{
		printf("Now = %u\r\n",RTIMER_NOW());
		rtimer_set(&task, RTIMER_NOW() + RTIMER_SECOND*2, RTIMER_SECOND, &callback, NULL);
		PROCESS_WAIT_UNTIL(sem);
		sem=0;
	}
}
开发者ID:Spike0,项目名称:Contiki_my,代码行数:10,代码来源:rtimer-arch.c


示例15: PROCESS_THREAD

PROCESS_THREAD(led_process, ev, data)
{
  static struct etimer etimer;

  PROCESS_BEGIN();
  while (1) {
    PRINTD("LED1\r\n");
    PORTB |= (1<<PB1);
    PORTD |= (1<<PD3);
    etimer_set(&etimer, CLOCK_SECOND*0.5);
    PROCESS_WAIT_UNTIL(etimer_expired(&etimer));
    PORTB &= ~(1<<PB1);
    PORTD &= ~(1<<PD3);
    etimer_set(&etimer, CLOCK_SECOND*0.5);
    PROCESS_WAIT_UNTIL(etimer_expired(&etimer));
  }

  PROCESS_END();
}
开发者ID:Ammar-85,项目名称:contiki-arduino,代码行数:19,代码来源:contiki-stk500-main.c


示例16: PROCESS_THREAD

/*-------------------------------------------------------*/
PROCESS_THREAD(example_process, ev, data)
{
	PROCESS_BEGIN();
		do_something();
		PROCESS_PAUSE();
		do_something_else();
		PROCESS_WAIT_UNTIL(temperatur > 30);
		do_something_completely_else();
	PROCESS_END();
}
开发者ID:Angel707,项目名称:htwdd-sensornetze-latex,代码行数:11,代码来源:pt_process.c


示例17: PROCESS_THREAD

/*---------------------------------------------------------------------------*/
PROCESS_THREAD(uip_fw_process, ev, data)
{
  PROCESS_BEGIN();

  tcpip_set_outputfunc(uip_fw_output);

  PROCESS_WAIT_UNTIL(ev == PROCESS_EVENT_EXIT);

  PROCESS_END();
}
开发者ID:AlexandreRio,项目名称:contiki,代码行数:11,代码来源:uip-fw-drv.c


示例18: PROCESS_THREAD

/*---------------------------------------------------------------------------*/
PROCESS_THREAD(multicast_example_process, ev, data)
{
  PROCESS_BEGIN();

  /* Create a linkl-local multicast addresses. */
  uip_ip6addr(&addr, 0xff02, 0, 0, 0, 0, 0, 0x1337, 0x0001);

  /* Join local group. */
  if(uip_ds6_maddr_add(&addr) == NULL) {
    printf("Error: could not join local multicast group.\n");
  }

  /* Register UDP socket callback */
  udp_socket_register(&s, NULL, receiver);

  /* Bind UDP socket to local port */
  udp_socket_bind(&s, PORT);

  /* Connect UDP socket to remote port */
  udp_socket_connect(&s, NULL, PORT);

  while(1) {

    /* Set up two timers, one for keeping track of the send interval,
       which is periodic, and one for setting up a randomized send time
       within that interval. */
    etimer_set(&periodic_timer, SEND_INTERVAL);
    etimer_set(&send_timer, (random_rand() % SEND_INTERVAL));

    PROCESS_WAIT_UNTIL(etimer_expired(&send_timer));

    printf("Sending multicast\n");
    udp_socket_sendto(&s,
                      "hello", 6,
                      &addr, PORT);

    PROCESS_WAIT_UNTIL(etimer_expired(&periodic_timer));
  }

  PROCESS_END();
}
开发者ID:ADVANSEE,项目名称:mist,代码行数:42,代码来源:udp-multicast.c


示例19: PROCESS_THREAD

/*---------------------------------------------------------------------------*/
PROCESS_THREAD(shell_nodes_process, ev, data)
{
  static struct etimer etimer;
  struct netflood_msg *msg;
  char buf[10];
  PROCESS_BEGIN();

  if(!is_sink) {

    shell_output_str(&nodes_command,
		     "Setting up a collection network...", "");
#if TIMESYNCH_CONF_ENABLED
    timesynch_set_authority_level(0);
#endif
    collect_set_sink(&collect, 1);

    etimer_set(&etimer, CLOCK_SECOND * 2);
    PROCESS_WAIT_UNTIL(etimer_expired(&etimer));
    is_sink = 1;
  }
  
  packetbuf_clear();
  msg = packetbuf_dataptr();
  packetbuf_set_datalen(sizeof(struct netflood_msg));
  msg->type = NETFLOOD_TYPE_NODES;
  netflood_send(&netflood, nodes_seqno++);

  etimer_set(&etimer, CLOCK_SECOND * 10);
  waiting_for_nodes = 1;
  shell_output_str(&nodes_command,
		   "Request sent, waiting for replies...", "");
  messages_received = 0;

  PROCESS_WAIT_UNTIL(etimer_expired(&etimer));
  snprintf(buf, sizeof(buf), "%d", messages_received);
  shell_output_str(&nodes_command, buf, " nodes heard");
  
  waiting_for_nodes = 0;
  PROCESS_END();
}
开发者ID:EDAyele,项目名称:ptunes,代码行数:41,代码来源:shell-rime.c


示例20: PROCESS_THREAD

PROCESS_THREAD(run_test_session,ev,data)
{
  PROCESS_BEGIN();
  current = 0;
  simple_udp_register(&unicast_connection, UDP_RECEIVER_PORT,
                      NULL, UDP_SENDER_PORT, receiver);

  PROCESS_WAIT_UNTIL(current == TEST_AMOUNT-1);
  //PROCESS_WAIT_UNTIL(current == 2749);
 
  PROCESS_END();
  PROCESS_EXIT();
}
开发者ID:DrThyme,项目名称:TWAMP-Measurement-IoT,代码行数:13,代码来源:twamp_light_reflector.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PROCESS_YIELD函数代码示例发布时间:2022-05-30
下一篇:
C++ PROCESS_WAIT_EVENT_UNTIL函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap