本文整理汇总了C++中process_post_synch函数的典型用法代码示例。如果您正苦于以下问题:C++ process_post_synch函数的具体用法?C++ process_post_synch怎么用?C++ process_post_synch使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了process_post_synch函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: PROCESS_THREAD
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(etimer_process, ev, data, buf, user_data)
{
struct etimer *t;
PROCESS_BEGIN();
while(1) {
PROCESS_YIELD();
PRINTF("%s():%d timerlist %p\n", __FUNCTION__, __LINE__, timerlist);
for(t = timerlist; t != NULL; t = t->next) {
PRINTF("%s():%d timer %p remaining %d triggered %d\n",
__FUNCTION__, __LINE__,
t, timer_remaining(&t->timer), etimer_is_triggered(t));
if(etimer_expired(t) && !etimer_is_triggered(t)) {
PRINTF("%s():%d timer %p expired, process %p\n",
__FUNCTION__, __LINE__, t, t->p);
if (t->p == NULL) {
PRINTF("calling tcpip_process\n");
process_post_synch(&tcpip_process, PROCESS_EVENT_TIMER, t, NULL);
} else {
process_post_synch(t->p, PROCESS_EVENT_TIMER, t, NULL);
}
}
}
update_time();
}
PROCESS_END();
}
开发者ID:32bitmicro,项目名称:zephyr,代码行数:32,代码来源:etimer.c
示例2: cc26xx_web_demo_restore_defaults
/*---------------------------------------------------------------------------*/
void
cc26xx_web_demo_restore_defaults(void)
{
cc26xx_web_demo_sensor_reading_t *reading = NULL;
leds_on(LEDS_ALL);
for(reading = list_head(sensor_list);
reading != NULL;
reading = list_item_next(reading)) {
reading->publish = 1;
}
#if CC26XX_WEB_DEMO_MQTT_CLIENT
process_post_synch(&mqtt_client_process,
cc26xx_web_demo_load_config_defaults, NULL);
#endif
#if CC26XX_WEB_DEMO_NET_UART
process_post_synch(&net_uart_process, cc26xx_web_demo_load_config_defaults,
NULL);
#endif
save_config();
leds_off(LEDS_ALL);
}
开发者ID:Abdellazizhammami,项目名称:contiki,代码行数:28,代码来源:cc26xx-web-demo.c
示例3: contiki_appcall
static void contiki_appcall(void *data)
{
contiki_data_t *s = (contiki_data_t *)data;
if (uip_closed() || uip_aborted() || uip_timedout()) {
//xprintf("closed or aborted or timedout\n");
if (s->state == READING || s->state == WRITTING) {
s->state = ERROR;
} else {
s->state = CLOSED;
}
process_post_synch(s->process, xively_event, s);
} else if (uip_connected()) {
s->state = CONNECTED;
PSOCK_INIT(&s->p, NULL, 0);
process_post_synch(s->process, xively_event, s);
} else if (uip_newdata()) {
if (s->state == READING) {
s->state = READ_END;
process_post_synch(s->process, xively_event, s);
}
}
if (s->state == CLOSING) {
uip_close();
}
handle_output(s);
}
开发者ID:foss-for-synopsys-dwc-arc-processors,项目名称:libxively,代码行数:27,代码来源:contiki_io_layer.c
示例4: tcpip_input
/*---------------------------------------------------------------------------*/
void
tcpip_input(void)
{
//printf("Guess I managed to go the stack up \n");
process_post_synch(&tcpip_process, PACKET_INPUT, NULL);
uip_clear_buf();
}
开发者ID:martinabr,项目名称:laneflood,代码行数:8,代码来源:tcpip.c
示例5: etimer_request_poll
/*---------------------------------------------------------------------------*/
clock_time_t
etimer_request_poll(void)
{
process_post_synch(&etimer_process, PROCESS_EVENT_POLL,
NULL, NULL);
return next_expiration;
}
开发者ID:32bitmicro,项目名称:zephyr,代码行数:8,代码来源:etimer.c
示例6: process_start
/*---------------------------------------------------------------------------*/
void
process_start(struct process *p, const char *arg)
{
struct process *q;
/* First make sure that we don't try to start a process that is
already running. */
for(q = process_list; q != p && q != NULL; q = q->next);
/* If we found the process on the process list, we bail out. */
if(q == p) {
return;
}
/* Put on the procs list.*/
p->next = process_list;
process_list = p;
p->state = PROCESS_STATE_RUNNING;
PT_INIT(&p->pt);
PRINTF("process: starting '%s'\n", PROCESS_NAME_STRING(p));
/* Post a synchronous initialization event to the process. */
process_post_synch(p, PROCESS_EVENT_INIT, (process_data_t)arg);
}
开发者ID:cherishyou,项目名称:ArduinoLib-SMeshlink,代码行数:26,代码来源:process.c
示例7: i2cb
bool
i2cb(u8_t addr, u8_t wrlen, u8_t rdlen, u8_t buf[])
{
static i2c_t t = {.buf = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};
t.addr = addr;
t.wrlen = wrlen;
t.rdlen = rdlen;
t.cb = internal_cb;
memcpy(t.buf, buf, wrlen);
i2c(&t);
pending = true;
while (pending) {
if (i2c_process.needspoll) {
process_post_synch(&i2c_process, PROCESS_EVENT_POLL, NULL);
i2c_process.needspoll = false;
}
}
memcpy(buf+wrlen,t.buf+wrlen,rdlen);
return i2c_status;
}
开发者ID:aminmatrix,项目名称:contiki-jn51xx,代码行数:25,代码来源:i2c.c
示例8: tsch_reset
/*---------------------------------------------------------------------------*/
static void
tsch_reset(void)
{
int i;
frame802154_set_pan_id(0xffff);
/* First make sure pending packet callbacks are sent etc */
process_post_synch(&tsch_pending_events_process, PROCESS_EVENT_POLL, NULL);
/* Empty all neighbor queues */
/* tsch_queue_flush_all(); */
/* Remove unused neighbors */
tsch_queue_free_unused_neighbors();
tsch_queue_update_time_source(NULL);
/* Initialize global variables */
tsch_join_priority = 0xff;
ASN_INIT(current_asn, 0, 0);
current_link = NULL;
/* Reset timeslot timing to defaults */
for(i = 0; i < tsch_ts_elements_count; i++) {
tsch_timing[i] = US_TO_RTIMERTICKS(tsch_default_timing_us[i]);
}
#ifdef TSCH_CALLBACK_LEAVING_NETWORK
TSCH_CALLBACK_LEAVING_NETWORK();
#endif
#if TSCH_AUTOSELECT_TIME_SOURCE
best_neighbor_eb_count = 0;
nbr_table_register(eb_stats, NULL);
tsch_set_eb_period(TSCH_EB_PERIOD);
#endif
}
开发者ID:1847123212,项目名称:ampm_contiki_wisun,代码行数:30,代码来源:tsch.c
示例9: tcpip_input
/*---------------------------------------------------------------------------*/
void
tcpip_input(void)
{
process_post_synch(&tcpip_process, PACKET_INPUT, NULL);
uip_len = 0;
#if UIP_CONF_IPV6
uip_ext_len = 0;
#endif /*UIP_CONF_IPV6*/
}
开发者ID:kenog,项目名称:contiki-inga,代码行数:10,代码来源:tcpip.c
示例10: complete_pending
static void complete_pending(mqtt_state_t* state, int event_type)
{
mqtt_event_data_t event_data;
state->pending_msg_type = 0;
mqtt_flags |= MQTT_FLAG_READY;
event_data.type = event_type;
process_post_synch(state->calling_process, mqtt_event, &event_data);
}
开发者ID:EmuxEvans,项目名称:contiki-mqtt,代码行数:9,代码来源:mqtt-service.c
示例11: tcpip_icmp6_call
void
tcpip_icmp6_call(uint8_t type)
{
if(uip_icmp6_conns.appstate.p != PROCESS_NONE) {
/* XXX: This is a hack that needs to be updated. Passing a pointer (&type)
like this only works with process_post_synch. */
process_post_synch(uip_icmp6_conns.appstate.p, tcpip_icmp6_event, &type);
}
return;
}
开发者ID:kenog,项目名称:contiki-inga,代码行数:10,代码来源:tcpip.c
示例12: PT_THREAD
static PT_THREAD(handle_output(contiki_data_t *s))
{
PSOCK_BEGIN(&s->p);
if (s->state == WRITTING) {
PSOCK_SEND(&s->p, s->out_buf, s->out_len);
s->state = WRITE_END;
process_post_synch(s->process, xively_event, s);
}
PSOCK_END(&s->p);
}
开发者ID:foss-for-synopsys-dwc-arc-processors,项目名称:libxively,代码行数:10,代码来源:contiki_io_layer.c
示例13: net_context_tcp_send
int net_context_tcp_send(struct net_buf *buf)
{
/* Prepare data to be sent */
process_post_synch(&ip_buf_context(buf)->tcp,
tcpip_event,
INT_TO_POINTER(TCP_WRITE_EVENT),
buf);
return ip_buf_sent_status(buf);
}
开发者ID:32bitmicro,项目名称:zephyr,代码行数:11,代码来源:net_context.c
示例14: tcpip_input
/*---------------------------------------------------------------------------*/
void
tcpip_input(void)
{
// printf("Tcpip: input");
// rpl_trace(rpl_dataptr_from_packetbuf());
process_post_synch(&tcpip_process, PACKET_INPUT, NULL);
uip_len = 0;
#if UIP_CONF_IPV6
uip_ext_len = 0;
#endif /*UIP_CONF_IPV6*/
}
开发者ID:Johnyren,项目名称:orpl,代码行数:12,代码来源:tcpip.c
示例15: response_handler
void response_handler(ChannelState *state, DataPayload *dp){
if (state->state != STATE_CONNECTED && state->state != STATE_PING){
PRINTF("Not connected to device!\n");
return;
}
state->ticks = 100;
ResponseMsg *rmsg = (ResponseMsg *)dp->data;
PRINTF("%s %d\n", rmsg->name, uip_ntohs(rmsg->data));
/*RESET PING TIMER*/
ctimer_restart(&(state->timer));
process_post_synch(state->ccb.client_process, KNOT_EVENT_DATA_READY, rmsg);
}
开发者ID:fergul,项目名称:KNoT,代码行数:12,代码来源:knot-controller.c
示例16: input_to_child_command
/*---------------------------------------------------------------------------*/
static void
input_to_child_command(struct shell_command *c,
char *data1, int len1,
const char *data2, int len2)
{
struct shell_input input;
if(process_is_running(c->process)) {
input.data1 = data1;
input.len1 = len1;
input.data2 = data2;
input.len2 = len2;
process_post_synch(c->process, shell_event_input, &input);
}
}
开发者ID:uoaerg,项目名称:wise,代码行数:15,代码来源:shell.c
示例17: deliver_publish_continuation
static void deliver_publish_continuation(mqtt_state_t* state, uint16_t offset, uint8_t* buffer, uint16_t length)
{
mqtt_event_data_t event_data;
event_data.type = MQTT_EVENT_TYPE_PUBLISH_CONTINUATION;
event_data.topic_length = 0;
event_data.topic = NULL;
event_data.data_length = length;
event_data.data_offset = offset;
event_data.data = (char*)buffer;
((char*)event_data.data)[event_data.data_length] = '\0';
process_post_synch(state->calling_process, mqtt_event, &event_data);
}
开发者ID:EmuxEvans,项目名称:contiki-mqtt,代码行数:14,代码来源:mqtt-service.c
示例18: PROCESS_THREAD
//process
PROCESS_THREAD(ntp_client_Process, ev, data)
{
static struct etimer ntp_timer;
PROCESS_BEGIN();
//printf("ntp_client_Process begin\n");
process_start(&ntp_connectPprocess, NULL);
ntp.client_sock = -1;
ntp.exit_process = 0;
ntp.retry_cnt = 0;
ntp.client_sock = udpcreate(NTP_LOCAL_PORT, &ntp_connectPprocess);
if(ntp.client_sock == -1) {
printf("create udp socket fail");
ntp.exit_process = 1;
} else {
//printf("create socket:%d\n", ntp.client_sock);
//us.pool.ntp.org(108.61.56.35)
if( uiplib_ipaddrconv("108.61.56.35", &ntp.server_ip) == 0) {
printf("erro ip format\n");
ntp.exit_process = 1;
}
}
memset( &packet, 0, sizeof( ntp_packet ) );
*( ( char * ) &packet + 0 ) = 0x1b; // Represents 27 in base 10 or 00011011 in base 2.
while(!ntp.exit_process) {
if(ntp.retry_cnt > MAX_RETRYCNT) {
printf("ntp client can not rece ntp server data, please check network\n");
break;
}
etimer_set(&ntp_timer, 1 * CLOCK_SECOND);
PROCESS_WAIT_EVENT_UNTIL(ev == PROCESS_EVENT_TIMER);
if(udpsendto(ntp.client_sock, (char *)&packet, sizeof(packet), &ntp.server_ip, NTP_SERVER_PORT) == -1) {
printf("udpsendto fail\n");
}
ntp.retry_cnt++;
}
if(udpclose(ntp.client_sock) == -1) {
printf("udpclose fail\n");
}
process_post_synch(&ntp_connectPprocess, PROCESS_EVENT_EXIT, NULL);
//printf("ntp_client_Process end\n");
PROCESS_END();
}
开发者ID:greatlevi,项目名称:AI6060H,代码行数:50,代码来源:ntp_client.c
示例19: tcpip_uipcall
/*---------------------------------------------------------------------------*/
void
tcpip_uipcall(void)
{
static uip_udp_appstate_t *ts;
#if UIP_UDP
if(uip_conn != NULL) {
ts = &uip_conn->appstate;
} else {
ts = &uip_udp_conn->appstate;
}
#else /* UIP_UDP */
ts = &uip_conn->appstate;
#endif /* UIP_UDP */
#if UIP_TCP
{
static unsigned char i;
register struct listenport *l;
/* If this is a connection request for a listening port, we must
mark the connection with the right process ID. */
if(uip_connected()) {
l = &s.listenports[0];
for(i = 0; i < UIP_LISTENPORTS; ++i) {
if(l->port == uip_conn->lport &&
l->p != PROCESS_NONE) {
ts->p = l->p;
ts->state = NULL;
break;
}
++l;
}
/* Start the periodic polling, if it isn't already active. */
start_periodic_tcp_timer();
}
}
#endif /* UIP_TCP */
if(ts->p != NULL) {
#if SHORTCUTS_CONF_NETSTACK
/* Directly invoke the relevant thread to reduce stack usage by 15 bytes */
ts->p->thread(&ts->p->pt, tcpip_event, ts->state);
#else
process_post_synch(ts->p, tcpip_event, ts->state);
#endif
}
}
开发者ID:brycel,项目名称:ContikiCC2530Port,代码行数:50,代码来源:tcpip.c
示例20: tcpip_input
/*---------------------------------------------------------------------------*/
void
tcpip_input(void)
{
#if SHORTCUTS_CONF_NETSTACK
/* calling process_post_sync, adds many bytes onto stack with the
* only affect being process.c::process_current modified and restored
* this is unnessary overhead, since it always leads to packet_input
*/
packet_input();
#else
process_post_synch(&tcpip_process, PACKET_INPUT, NULL);
#endif
uip_len = 0;
#if UIP_CONF_IPV6
uip_ext_len = 0;
#endif /*UIP_CONF_IPV6*/
}
开发者ID:brycel,项目名称:ContikiCC2530Port,代码行数:18,代码来源:tcpip.c
注:本文中的process_post_synch函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论