Hi David,
On Friday 04 May 2007 09:48, David Moss wrote:
> Instead of stopping/starting the radio, have you tried using
> CC2420Config.sync()?
>
> Here's what I do when I want to change the local node's ID:
>
> command error_t Config.setAddress(am_addr_t address) {
> // Store the address to the non-volatile config, to the CC2420, and to
> // the address component to completely convert the system
> config.address = address;
> atomic call setAmAddress(config.address);
> call CC2420Config.setShortAddr(config.address);
> call CC2420Config.sync();
> call Configurator.store();
> return SUCCESS;
> }
Ah, a definite improvement!
> Some architecture needs to be in place so when you call setAmAddress(), the
> radio automatically changes its address too. If we simply added an event
> to ActiveMessageAddressC that signals when the address is changed, anything
> that cares would be able to reconfigure itself.
It would be nice to see AM group handling in the same manner, at least for the
current application I'm working on.
Steve
> -----Original Message-----
> From: Philip Levis [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 03, 2007 5:04 AM
> To: David Moss; Jonathan Hui
> Subject: Fwd: [Tinyos-help] Dynamic assignment of node id -- problems in
> radio layers
>
> Begin forwarded message:
> > From: Steve McKown <[EMAIL PROTECTED]>
> > Date: May 2, 2007 6:50:57 PM PDT
> > To: [email protected]
> > Subject: [Tinyos-help] Dynamic assignment of node id -- problems in
> > radio layers
> >
> > Hi,
> >
> > Our tos2 app has the gateway assigning node id's dynamically to nodes.
> > Something like this:
> >
> > node sends join request, including GUID
> > gateway broadcasts reply with GUID + assigned nodeid
> > node assigns nodeid as local address
> >
> > I'm using setAmAddress() provided by ActiveMessageAddressC to
> > assign the
> > address, as well as updating TOS_NODE_ID. This only partially
> > works; the
> > CC2420 will not pass unicast messages to the new local address up
> > the stack.
> > It turns out the CC2420 code sets the radio's definition of the
> > local address
> > only in CC2420ControlP's Init(), like so:
> >
> > command error_t Init.init() {
> > call CSN.makeOutput();
> > call RSTN.makeOutput();
> > call VREN.makeOutput();
> > m_short_addr = call AMPacket.address(); /*** <- ***/
> > return SUCCESS;
> > }
> >
> > I can update the local addr in the radio's SplitControl.start() in
> > CC2420CsmaP.nc, with a few minor changes:
> >
> > call CC2420Config.setShortAddr(call AMPacket.address());
> >
> > With this little hack, the node can stop and restart its radio to
> > propogate
> > the new local address to the radio.
> >
> > I've scanned the list and the TEPs. Have I missed a "right way" to
> > do this in
> > tos2?
> >
> > Thanks,
> > Steve
> > _______________________________________________
> > Tinyos-help mailing list
> > [email protected]
> > https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/
> > tinyos-help
>
> !DSPAM:463b594c286188120612385!
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help