Fix radio hangups when trying to transmit with radio off.

The border-router tries to transmit and do other stuff after turning
the radio off, and the radio driver didn't handle that very well.
With this fix, it's no longer necessary to reset the border router
after starting tunslip6.
This commit is contained in:
Jim Paris 2014-06-30 23:13:21 -04:00
parent 6937b29670
commit 6db05caed9
2 changed files with 8 additions and 3 deletions

View file

@ -193,6 +193,9 @@ prepare(const void *payload, unsigned short payload_len)
static int
transmit(unsigned short transmit_len)
{
if(!radio_is_on)
return RADIO_TX_ERR;
/* Transmit the packet */
if(transmit_len > MAX_PACKET_LEN) {
transmit_len = MAX_PACKET_LEN;
@ -224,6 +227,9 @@ read(void *buf, unsigned short buf_len)
uint8_t packet_len;
int8_t rssi;
if(!radio_is_on)
return 0;
if(buf_len > MAX_PACKET_LEN) {
buf_len = MAX_PACKET_LEN;
}
@ -296,7 +302,7 @@ get_value(radio_param_t param, radio_value_t *value)
case RADIO_PARAM_RSSI:
{
int8_t dbm;
if(RadioRadioGetRSSI(&dbm) != RIE_Success) {
if(!radio_is_on || RadioRadioGetRSSI(&dbm) != RIE_Success) {
return RADIO_RESULT_ERROR;
}
*value = dbm;

View file

@ -73,8 +73,7 @@ the SLIP tunnel on the host machine:
-s /dev/serial/by-id/usb-SEGGER_J-Link_000541011111-if00 \
-B 115200 -v3 aaaa::1/64
Press the RESET button on the eval board, then open the border router
home page at: http://[aaaa::3230:3030:3132:3334]/
Open the border router's home page at: http://[aaaa::3230:3030:3132:3334]/
#### Web Server ####