Example #1
0
PROCESS_THREAD(shell_ruc_close_process, ev, data)
{
  uint16_t channel;
  long channel_long;
  const char *next;
  char buf[6];
  PROCESS_BEGIN();

  channel_long = shell_strtolong((char *)data, &next);
  if(channel_long <= 0 || channel_long > 65535){
    shell_output_str(&ruc_close_command, "channel has to be in range of [1-65535]", "");
    PROCESS_EXIT();
  }
  channel = (uint16_t) channel_long;
  snprintf(buf, sizeof(buf), "%d", channel);
  struct runicast_entry *e = list_head(runicast_list);
  while(e != NULL){
    if(e->channel == channel){
      struct runicast_entry *to_remove = e;
      e = e->next;
      runicast_close(&to_remove->c);
      list_remove(runicast_list, to_remove);
      memb_free(&runicast_mem, to_remove);
      shell_output_str(&ruc_close_command, "closed unicast connection on channel: ", buf);
      PROCESS_EXIT();
    }
  }
  shell_output_str(&ruc_close_command, "uc_close error: channel not open","");

  PROCESS_END();
}
Example #2
0
/*---------------------------------------------------------------------------*/
void
collect_close(struct collect_conn *tc)
{
#if COLLECT_ANNOUNCEMENTS
    announcement_remove(&tc->announcement);
#else
    neighbor_discovery_close(&tc->neighbor_discovery_conn);
#endif /* COLLECT_ANNOUNCEMENTS */
    runicast_close(&tc->runicast_conn);
}
Example #3
0
File: rmh.c Project: aiss83/nucbit
/*---------------------------------------------------------------------------*/
void
rmh_close(struct rmh_conn *c)
{
    runicast_close(&c->c);
}
Example #4
0
int
sensor_destroy(){
	broadcast_close(&sensor_chan.bc);
	runicast_close(&sensor_chan.rc);
}
void close_runicast(void)
{
	runicast_close(&runicast);
}