[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[uracoli-devel] radio_set_state(): how long to wait?
From: |
Joerg Wunsch |
Subject: |
[uracoli-devel] radio_set_state(): how long to wait? |
Date: |
Fri, 27 Nov 2009 23:54:28 +0100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
I'm trying to use the high-level radio interface.
Right now, I'm running into a situation where radio_error() is called,
because the state transition is not completed within the expected
time. The expected state is TX_ARET_ON (25), but the current state is
BUSY_TX_ARET (18). The code where this happens is:
retries = 140; /* enough to await an ongoing frame
* reception */
do
{
currstatus = trx_bit_read(SR_TRX_STATUS);
if (expstatus == currstatus)
{
break;
}
/** @todo must wait longer for 790/868/900 MHz radios */
DELAY_US(32);
}
while (retries--);
Note the @todo (I'm working in 868 MHz where things are slow), but the
key point here is: this is a TX_ARET transaction, which can take
*much* longer to complete (in particular in case of a busy channel, or
a peer that doesn't respond at the first attempt).
So the big question is: How long to wait here? Perhaps it's better to
wait indefinitely while the current status is one of the BUSY_*
states? At least, for BUSY_TX_ARET, I could not imagine of a way to
precalculate a max wait time.
(Btw., the requested state transition is the automatic one that
attempts to put the radio into the configured "idle_state" after a
transmission.)
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/ NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)
- [uracoli-devel] radio_set_state(): how long to wait?,
Joerg Wunsch <=