Dear sir,

When I try a simple test under tinyOS 2.0 system, a problem makes me
confused. the Error will be depicted as follows.

In a simple application, I want to use a multi-interface to map different
same interface to it like that: (key codes was marked with "*")

TmpAppC.nc : main configuration componet
       1 configuration TmpAppC
       2 {
       3 }
       4 implementation
       5 {
       6   components MainC, TmpC, pvdtmp1, pvdtmp2;
       7
       8   TmpC -> MainC.Boot;
       9
*     10   TmpC.tmp[unique("tmp")] -> pvdtmp1.tmp;
*     11   TmpC.tmp[unique("tmp")] -> pvdtmp2.tmp;
      12 }
      13
 
TmpC.nc: uses a multiple tmp interface
       1 module TmpC
       2 {
       3   uses interface Boot;
*     4   uses interface tmp[uint8_t id];
       5 }
       6
       7 implementation
       8 {
       9   event void Boot.booted()
      10   {
      11     int i;
      12       for(i=0; i < uniqueCount("tmp"); i++) {
      13         call tmp.cmd1[i]();
      14       }
      15   }
      16
      17   event void tmp.evt1[uint8_t id] () {
      18      call tmp.cmd1[id]();
      19   }
      20 }
      21
 
pvdtmp1.nc: provide a tmp interface
       1 module pvdtmp1 {
*     2   provides interface tmp;
       3 }
       4 implementation {
       5   command bool tmp.cmd1() {
       6     return TRUE;
       7   }
       8   default event void tmp.evt1() {
       9   }
      10 }
 
pvdtmp2.nc: provide another tmp interface
       1 module pvdtmp2 {
*     2   provides interface tmp;
       3 }
       4 implementation {
       5   command bool tmp.cmd1() {
       6     return TRUE;
       7   }
       8   default event void tmp.evt1() {
       9   }
      10 }
 
tmp.nc: define the tmp interface
       1 interface tmp {
       2   command bool cmd1();
       3   event void evt1();
       4 }
 
Makefile:
       1 COMPONENT=TmpAppC
       2 include $(MAKERULES)
 
When I compile this application, following compile error arose:
[EMAIL PROTECTED] tmp]# make mica2
mkdir -p build/mica2
     compiling TmpAppC to a mica2 binary ncc -o build/mica2/main.exe -Os
-finline-limit=100000 -Wall -Wshadow -Wnesc-all -target=mica2
-fnesc-cfile=build/mica2/app.c -board=micasb -fnesc-dump=wiring
-fnesc-dump='interfaces(!abstract())' 
-fnesc-dump='referenced(interfacedefs, components)' 
-fnesc-dumpfile=build/mica2/wiring-check.xml TmpAppC.nc -lm In component
`TmpC':
TmpC.nc: In function `Boot.booted':
TmpC.nc:13: tmp.cmd1 not connected
make: *** [exe0] Error 1
[EMAIL PROTECTED] tmp]#

what's wrong with my components. I had connected the tmp interface in
TmpC.nc with tmp interface in pvdtmp1.nc and pvdtmp2.nc, but why the
compiler considered I did not? Actually, if I define multiple tmp interfaces
independently rather than with array interface, the error could be
suppressed successfully, but It's a boring solution that I have to duplicate
"event" source code for many times.
 
beg you do me a favor to explain this error. the sources file also attaches
at the tail of this mail, but I am not sure whether the automatic mail
system will filter the attachments out.
 
 
thanks in advance.

handsomezhu
2007.9.9

Attachment: tmp.tgz
Description: Binary data

_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to