I saw a post by someone wanting to perform powercontrol on CC2420 in tinyOS-2.x and hence forwarding this mail. Jonthan had given me some pointers as to how it can be done with some of the code that he had checked in.
-Avinash
---------- Forwarded message ----------
From: Jonathan Hui <[EMAIL PROTECTED]>
Date: Mar 23, 2006 3:44 PM
Subject: Re: [Tinyos-help] tinyos-2.x how is the CC2420Config interface exposed to higher layers in tinyOS-2.x
To: [EMAIL PROTECTED]
You need to explicitly wire to the CC2420PacketC interface in order to
get/set the transmit power for a specific packet. Once you've set the
transmission power, just send the packet and it will be sent with what
you specified. The transmission power for that packet will stay the
same until you set it again. The default transmission power is full
power (31), so if you've never called set() on a packet, it will
default to that.
I've included the relavant portion of the CC2420Packet interface so
that you can start writing some code.
/**
* Get transmission power setting for current packet.
*
* @param the message
*/
async command uint8_t getPower( message_t* p_msg );
/**
* Set transmission power for a given packet. Valid ranges are
* between 0 and 31.
*
* @param p_msg the message.
* @param power transmission power.
*/
async command void setPower( message_t* p_msg, uint8_t power );
--
Jonathan W. Hui
[EMAIL PROTECTED]
http://www.cs.berkeley.edu/~jwhui/
On 3/23/06, Avinash Sridharan < [EMAIL PROTECTED]> wrote:
> Hi Jonathan,
> I guess it will take a while to get the CC2420Packet interface. Could you
> describe to me meanwhile how can I use this interface ? Since currently I am
> just using the ActiveMessage and AMSender components. Do I need to
> explicitly use the CC2420Packet component.
>
> Thanks for all the help,
> regards,
>
> Avinash
>
> On 3/23/06, Jonathan Hui <[EMAIL PROTECTED]> wrote:
> > Everything cc2420 related is in tos/chips/cc2420.
> >
> > --
> > Jonathan W. Hui
> > [EMAIL PROTECTED]
> > http://www.cs.berkeley.edu/~jwhui/
> >
> >
> > On 3/23/06, Avinash Sridharan < [EMAIL PROTECTED]> wrote:
> > > Hi Jonathan,
> > > Where exactly can I find this interface ? under chips/cc2420 ? or
> under
> > > micaz ? I just updated the CVS so not sure if I got your changes.
> > >
> > > Thanks,
> > > Avinash
> > >
> > >
> > > On 3/23/06, Jonathan Hui < [EMAIL PROTECTED] > wrote:
> > > > I've updated the tinyos-2.x cc2420 stack to support changing of
> > > > transmission power. The 2.x method is different from 1.x in that
> > > > transmission power is specified on a per-packet basis using the
> > > > CC2420Packet interface.
> > > >
> > > > Note: if you are on anonymous access with sourceforge, it may take up
> > > > to 24 hours to propagate the changes.
> > > >
> > > > --
> > > > Jonathan W. Hui
> > > > [EMAIL PROTECTED]
> > > > http://www.cs.berkeley.edu/~jwhui/
> > > >
> > > > On 3/23/06, Avinash Sridharan < [EMAIL PROTECTED]> wrote:
> > > > > Hi All,
> > > > > I wanted to set the power of my radio dynamically (at runtime). I
> > > figured
> > > > > out that the CC2420Config.nc provides such an interface to set the
> > > > > transmission power and it is implemented in CC2420ControlP.nc.
> However I
> > > am
> > > > > not able to find any of the generic interfaces (that hide the
> hardware
> > > > > specifics) in tinyOS-2.x that are are exposing the full
> functionality of
> > > > > CC2420Config.nc (that is the ability to set the tx power of the
> radios)
> > > to
> > > > > applications.
> > > > >
> > > > > Do I need to access the CC2420Control component directly to
> perform
> > > the
> > > > > above operation ?
> > > > >
> > > > > Thanks,
> > > > > Avinash
> > > > >
> > > > > --
> > > > > Phd Dept. of Electrical Engineering
> > > > > University of Southern California
> > > > > http://www-scf.usc.edu/~asridhar
> > > > > _______________________________________________
> > > > > Tinyos-help mailing list
> > > > > [email protected]
> > > > >
> > >
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
> > > > >
> > > > >
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > >
> > > Phd Dept. of Electrical Engineering
> > > University of Southern California
> > > http://www-scf.usc.edu/~asridhar
> >
>
>
>
> --
>
> Phd Dept. of Electrical Engineering
> University of Southern California
> http://www-scf.usc.edu/~asridhar
--
Phd Dept. of Electrical Engineering
University of Southern California
http://www-scf.usc.edu/~asridhar
_______________________________________________ Tinyos-help mailing list [email protected] https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
