Hi,

The wiring looks okay to me (although I'm no expert!) - you seem to me to be 
wiring the CC2420Packet interface used by your RadioCountToLedsC module to the 
CC2420PacketC component which provides it, which seems correct to me:


App.CC2420Packet -> CC2420PacketC

So not sure what to suggest, maybe the problem is not with the wiring but 
somewhere else? Look for the usual programming problems such as:

- Are you sure there isn't some other mistake in your code which is causing the 
compiler to give you a misleading error message? e.g. Check the code 
immediately before and after the App.CC2420Packet -> wiring bit, and the code 
arounf you changepower function for missing semicolons etc.
- Are you sure you've specified the correct component in your Makefile?
- Are you running make from the correct directory?
- Are you building for a platform which actually supports CC2420 (what is the 
make command you are using?)
- Are you sure you've spelled everything correctly? I notice the name of your 
component is the same as an example app, are you sure you've not got your files 
mixed up? When extending an example app I prefer to rename components to avoid 
conflicts and confusion. Also you seem to say that your RadioCountToLedsAppC 
configuration is inside 'xxApp.nc', not 'xxAppC.nc', are you sure you've named 
your files and components correctly to match?


Hope this helps


James

________________________________
From: tinyos-help-boun...@millennium.berkeley.edu 
<tinyos-help-boun...@millennium.berkeley.edu> on behalf of desword 
<cgl1428719...@163.com>
Sent: 27 February 2017 06:26:34
To: tinyos-help@millennium.berkeley.edu
Subject: [Tinyos-help] how to wire CC2420Packet to user code encounters in 
tinyOS?

Recently I want to use the interface CC2420Packet to set transmission power.
By using the command setPower. I am now working at Tinyos 2.1.2.

However, I encounter this error:

RadioCountToLedsC.nc: In function `changepower':
RadioCountToLedsC.nc:139: CC2420Packet.setPower not connected

In xxApp.nc

configuration RadioCountToLedsAppC {}
implementation {
  components MainC, RadioCountToLedsC as App, LedsC;
  components CC2420PacketC;
  // for change power
  //components CC2420ActiveMessageC;
  App.CC2420Packet -> CC2420PacketC;

in xC.nc

module RadioCountToLedsC @safe() {
  uses {
...
  // for change tx power
  interface CC2420Packet;
  }
}
implementation {
...
call CC2420Packet.setPower(&packet2, 3);
...
}

I have removed the extra code and only reserved the most relevant code.
where am I wrong? Thanks! How to wire the CC2420Packet correctly?



--
View this message in context: 
http://tinyos-help.10906.n7.nabble.com/how-to-wire-CC2420Packet-to-user-code-encounters-in-tinyOS-tp25063.html
Sent from the TinyOS - Help mailing list archive at Nabble.com.
_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to