PE Project 4 - goofcode/UR GitHub Wiki

Requirements

  • ์ผ๋ถ€๋Ÿฌ delay๋ฅผ ์ฃผ๋Š” ๊ฒƒ ๋Œ€์‹  callback์„ ์‚ฌ์šฉํ•˜์—ฌ ํ•˜๋‚˜์˜ tx๊ฐ€ ์™„๋ฃŒ๋œ ์ดํ›„ ๋ฐ”๋กœ tx

๊ตฌํ˜„

  • callback: ํ•จ์ˆ˜ ํฌ์ธํ„ฐ๋ฅผ ํ•˜๋‚˜ ๋” ๋„˜๊ธฐ๋ฉด ๊ฐ€๋Šฅ
static void
broadcast_recv(struct broadcast_conn *c, const linkaddr_t *from){
}

static void
broadcast_sent (struct broadcast_conn *ptr, int status, int num_tx){
}

static const struct broadcast_callbacks recv_callbacks = {broadcast_recv, broadcast_sent};
  • MAC_TX_OK๋ฅผ ๋ฐ›์•˜์„ ๋•Œ, ๋‹ค์‹œ ์ „์†ก -> ์ด๋ฒคํŠธ(sync) ์ฒ˜๋ฆฌ๋ฐฉ์‹ ์‚ฌ์šฉ
  • CSMA์—์„œ๋„ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ๋ฐฉ์‹
    • ๋ชจ๋“  ์‹œ๋„๊ฐ€ ์‹คํŒจํ–ˆ์„ ๊ฒฝ์šฐ -> ์‹คํŒจ
    • ํ•œ๋ฒˆ์ด๋ผ๋„ ์„ฑ๊ณตํ•œ ๊ฒฝ์šฐ -> ์„ฑ๊ณต
static void
broadcast_sent (struct broadcast_conn *ptr, int status, int num_tx){

  if (status == MAC_TX_OK)
    tx_count++;
//else
//  printf("broadcast sent: %d\n",status);

  // start next tx
  process_post(&sender_proc, PROCESS_EVENT_CONTINUE, "");
}

์ค‘๊ฐ„์— ์•Œ๊ฒŒ ๋œ ๊ฒƒ๋“ค

  • nullmac ์—์„œ collision์„ detect?
    • cca ๋ฅผ 20 symbols ๋™์•ˆ ์ˆ˜ํ–‰
    • cca์— ์‹คํŒจํ•  ๊ฒฝ์šฐ RADIO_TX_COLLISION ๋ฆฌํ„ด