Dear All:
In my tinyos-2.x application, I would like to check the channel before
sending a packet. By copying the following code from CC2420TransmitP.nc,
I found the congest is always set as TRUE even I have only one mote turn
on. Could anyone help to solve this problem or any other smarter way to
check CCA? Thanks.
uint8_t status;
bool congestion = TRUE;
atomic{
call CSN.clr();
status = call STXONCCA.strobe();
if ( !( status & CC2420_STATUS_TX_ACTIVE ) ) {
status = call SNOP.strobe();
if ( status & CC2420_STATUS_TX_ACTIVE ) {
congestion = FALSE;
}
}
call CSN.set();
}
- Hui
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help