On Tuesday 05 June 2007 13:46, jose m wrote: > > On Monday 04 June 2007 13:38, jose m wrote: > > > Checking out the AMStandard.nc file I see that, if you are transmitting a > > > radio message, the AMStandard component is occupied until the tx is done, > > > and you cannot tx to UART until then. Why? any problem tx to radio and > > > UART at the same time? > > > > On Tuesday 05 June 2007 13:20, Steve McKown wrote: > > Assuming the radio and serial UART don't share any common resources, their > > operations can certainly be interleaved. For example, you can call > > AMSend.send(...) and then on the very next line call UartStream.send(...). > > The actual order of execution occurs based upon the TinyOS concurrency > > model. AMSend.sendDone() and UartStream.sendDone() will be each called as > > their relevant split-phase operations complete. > > > > If you want to learn more about TinyOS concurrency, check out Philip Levis' > > programming guide @ > > http://csl.stanford.edu/~pal/pubs/tinyos-programming.pdf > > Thanks! Ok, don't worry, I understand concurrency. However, when you use AM > protocol, you use AMStandard (not UartStream), and AMStandard doesn't allow > send radio and uart packets "at the same time", even when the uart (or > radio) is idle (a variable named "state" is checked). This behavior looks > intentional... any reason for this?
I'm sorry, I missed the fact you were using TinyOS-2.x and made some bad assumptions. I don't use TinyOS-1.x, but took a quick look at AMStandard.nc. I think I have an answer to your question; hopefully someone will jump in and correct if I'm wrong. AMStandard.nc implements a single AM stack instance that just happens to use two physical devices internally. An AM stack has several behavioral rules, one of them being that only one send can be pending at a time. So, to keep AMStandard.nc behaviorally consistent, it can't schedule overlapping sends. In contrast, TinyOS-2.x addressed this issue by creating separate AM stack instances for the radio and the uart. In this way, the components using the stacks could schedule a send on each 'simultaneously'. If you need overlapping sends between devices, I'd be tempted to create AMRadio.nc and AMUart.nc, which effectively copy AMStandard.nc but use a single device only. You should poke around in your tos1 distribution, as there may already be a better solution available. All the best, Steve _______________________________________________ Tinyos-help mailing list [email protected] https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
