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 ๋ฆฌํด