[Tinyos Core WG] 2.0.2 release plans
Martin Turon
mturon at xbow.com
Tue Jul 10 10:30:05 PDT 2007
I agree that platform #ifdef are really to be avoided. In TinyOS, they
mostly cropped up due to a lack of a standardized radio PHY driver
abstraction. Does T2 have such a Radio HIL yet? The basic interface
is:
interface RadioControl {
// Frequency & Channel //
/// Tune the radio frequency to an available preset.
command result_t setRfChannel(uint8_t freqPreset);
/// Get preset back.
command uint8_t getRfChannel();
/// Tune the radio to a given frequency manually.
command result_t setRfFrequency(uint16_t DesiredFreqInMHz);
/// Get frequency back.
command uint16_t getRfFrequency();
// Output Power //
/// Set the transmit RF power value.
command result_t setRfPower(uint8_t power);
/// Get the present RF power index.
command uint8_t getRfPower();
}
/**
* @author Martin Turon
* @date August 28, 2006
*
* @version mturon 2006/8/28 Initial revision
*
* $Id: RadioRegister.nc,v 1.1 2006/08/30 01:13:18 mturon Exp $
*/
interface RadioRegister<register_size_t> {
/**
* Transmit <register_size_t> data
*
* @return status byte from the radio. 0xff is return of command
failed.
*/
async command uint8_t write(uint8_t addr, register_size_t data);
/**
* Read <register_size_t> data
*
* @return <register_size_t> register value
*/
async command register_size_t read(uint8_t addr);
}
/**
* Unified radio layer abstraction.
* @author Martin Turon
*/
configuration XRadioC
{
provides {
interface StdControl as Control;
interface BareSendMsg as Send;
interface ReceiveMsg as Receive;
interface RadioControl;
// RadioRegister -- access to this interface is not cross-platform!
interface RadioRegister<uint16_t>;
}
Martin
__________________________________________________
Martin Turon | Crossbow Technology, Inc.
-----Original Message-----
From: tinyos-2.0wg-bounces at Mail.Millennium.Berkeley.EDU
[mailto:tinyos-2.0wg-bounces at Mail.Millennium.Berkeley.EDU] On Behalf Of
Philip Levis
Sent: Tuesday, July 10, 2007 10:45 AM
To: Vlado Handziski
Cc: TinyOS Core WG; Razvan Musaloiu-E.; Mike Chieh-Jan Liang; Omprakash
Gnawali
Subject: Re: [Tinyos Core WG] 2.0.2 release plans
Vlado Handziski wrote:
> Do we have any policy again mixing of platform-dependent and
> platform-independent applications in the top /apps dir? This would be
> the only platform specific app in the top dir apart from the TOSSIM
> apps. the /apps/tests is currently a mixed bag.
>
> On another note. One of the things I hated most in TinyOS 1.x were the
> platform #ifdefs. We managed to keep the T2 code pretty clear until
> now, but with this app, with Deluge, the CC2420 tests, etc. they are
> creeping back in. I know it is very convenient, but it makes life much
> harder for the non-core platforms, forcing the maintainers to shadow
> and patch complete components, etc. In almost all cases, it is much
> better to factor our the platform dependent code in separate
> components, with clear interfaces between them and the
> platform-independent logic.
I think everyone would agree that the fewer #define statements the
better. At some point, #define statements are needed for things like
compile-time constant specification, but I don't think that's
the big deal. Rather, #define specified module and configuration code.
Generally, #define statements pop up where the abstractions are not
quite right or where we haven't quite figured out how to structure
things well; they tend to be at the edge of system design. So let's
revisit them for 2.1 and see if we can figure out how to reduce them.
Phil
_______________________________________________
Tinyos-2.0wg mailing list
Tinyos-2.0wg at Mail.Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-2.0
wg
More information about the Tinyos-2.0wg
mailing list