Exemplo n.º 1
0
/*---------------------------------------------------------------------------*/
static int
send_data(struct rudolph2_conn *c, clock_time_t interval)
{
  int len;

  len = format_data(c, c->snd_nxt);
  polite_send(&c->c, interval, POLITE_HEADER);
  PRINTF("%d.%d: send_data chunk %d, rcv_nxt %d\n",
	 rimeaddr_node_addr.u8[RIMEADDR_SIZE-2], rimeaddr_node_addr.u8[RIMEADDR_SIZE-1],
	 c->snd_nxt, c->rcv_nxt);

  return len;
}
Exemplo n.º 2
0
/*---------------------------------------------------------------------------*/
static void
send_nack(struct rudolph0_conn *c)
{
  struct rudolph0_hdr *hdr;
  packetbuf_clear();
  packetbuf_hdralloc(sizeof(struct rudolph0_hdr));
  hdr = packetbuf_hdrptr();

  hdr->type = TYPE_NACK;
  hdr->version = c->current.h.version;
  hdr->chunk = c->current.h.chunk;

  PRINTF("Sending nack for %d:%d\n", hdr->version, hdr->chunk);
  polite_send(&c->nackc, c->send_interval / 2, sizeof(struct rudolph0_hdr));
}
Exemplo n.º 3
0
/*---------------------------------------------------------------------------*/
static void
send_nack(struct rudolph2_conn *c)
{
  struct rudolph2_hdr *hdr;
  packetbuf_clear();
  packetbuf_hdralloc(sizeof(struct rudolph2_hdr));
  hdr = packetbuf_hdrptr();

  hdr->hops_from_base = c->hops_from_base;
  hdr->type = TYPE_NACK;
  hdr->version = c->version;
  hdr->chunk = c->rcv_nxt;

  PRINTF("%d.%d: Sending nack for %d\n",
	 rimeaddr_node_addr.u8[RIMEADDR_SIZE-2], rimeaddr_node_addr.u8[RIMEADDR_SIZE-1],
	 hdr->chunk);
  polite_send(&c->c, NACK_TIMEOUT, POLITE_HEADER);
}