First a couple suggestions....upgrade to a later version of TOS1.x,
say something over .7 and use the defines in the
contrib/xbow/apps/MakeXbowlocal file (or just do your development
in the xbow tree, otherwise the CC1000 will not work very well
(in my experience...).
Also setPower() may not have much effect in the simulator. I don't
know if it is implemented in any sensible way.
The doc/tutorial should help you on how to include components,
but here's a quick rundown:
In your config file, something like:
--------------------------------------------------------------------------------------
/** Robot.nc -- Master Config file for the RoboII Mote application
**/
includes RoboHardware;
includes RoboMsg;
configuration Robot { }
implementation
{
components Main, RobotM, TimerC, LedsC,
GenericComm as RComm, // for RADIO & UART comm
CC1000ControlM, // for mica2 radio control
MotionM, RoboMsgM;
Main.StdControl -> RobotM.StdControl;
Main.StdControl -> TimerC;
RobotM.CC1000ControlM-> CC1000ControlM; // to get radio control functions
RobotM.RCommControl -> RComm; // to init the radio
communications
RobotM.Motion -> MotionM;
RobotM.RoboMsg -> RoboMsgM;
// Host commands to be received (from Radio or UART)
RoboMsgM.RCmdStartMsg -> RComm.ReceiveMsg[AM_ROBOCMDSTARTMSG];
RoboMsgM.RCmdStopMsg -> RComm.ReceiveMsg[AM_ROBOCMDSTOPMSG];
RoboMsgM.RCmdStatMsg -> RComm.ReceiveMsg[AM_ROBOCMDSTATMSG];
RoboMsgM.RCmdDataMsg -> RComm.ReceiveMsg[AM_ROBOCMDDATAMSG];
// Status replies to send
RoboMsgM.RStatusMsg -> RComm.SendMsg[AM_ROBOSTATUSMSG];
RoboMsgM.RDataMsg -> RComm.SendMsg[AM_ROBODATAMSG];
}
--------------------------------------------------------------------------------------
and in your component module:
--------------------------------------------------------------------------------------
/** RobotM.nc -- Main program for RoboII
**/
includes RoboMsg; /* the basic request and status messages */
module RobotM
{
provides interface StdControl;
uses
{
interface Timer;
interface Leds;
interface StdControl as RCommControl
interface CC1000ControlM;
interface RoboMsg;
}
}
implementation
{
int someFunction()
{
CC1000ControlM.setPower( x );
}
// ....
}
--------------------------------------------------------------------------------------
MS
bou ahm wrote:
HELLO,
I am new to tinyos ,I work on the version Tinyos1.1.0 with the use of
TOSSIM simulator and nesc language.I want to add the component
CC1000RadioC in my configuration,the requered interface is CC1000Control
as it provides SetRFPower(Power) command .please I need a simple exemple
of use interface CC1000Control and command SetRFPower.
THANK YOU
------------------------------------------------------------------------
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails
<http://www.trueswitch.com/yahoo-fr/> vers Yahoo! Mail
------------------------------------------------------------------------
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help