Hi Phil

Came across this error, no idea, was is going on !

mkdir -p build/micaz
placing object files in build/micaz
writing XML schema to app.xml
compiling QueueAppC to object file sim.o
ncc -c -shared -fPIC -o build/micaz/sim.o -g3 -O0 -tossim -fnesc-nido-tosnodes=1000 -fnesc-simulate -fnesc-nido-motenumber=sim_node\(\) -finline-limit=100000 -Wall -Wshadow -Wnesc-all -target=micaz -fnesc-cfile=build/micaz/app.c -board=micasb -I./../../interfaces -I./../../lib/net/QueuedSend -Wno-nesc-data-race QueueAppC.nc -fnesc-dump=components -fnesc-dump=variables -fnesc-dump=constants -fnesc-dump=typedefs -fnesc-dump=interfacedefs -fnesc-dump=tags -fnesc-dumpfile=app.xml
In file included from QueueAppC.nc:13:
In component `QueuedSendC':
./../../lib/net/QueuedSend/QueuedSendC.nc:29: redefinition of `QueuedSendP'
./../../lib/net/QueuedSend/QueuedSendC.nc:29: syntax error
make: *** [sim-exe] Error 1

This is code for QueuedSendC.nc:

#include <AM.h>
#include <message.h>
#define QUEUEDSEND_CLIENTID "QueuedSend.ClientId"
generic configuration QueuedSendC(am_id_t AMId, uint8_t size){
   provides {
       interface QueuedAMSend;
       interface Packet;
       interface AMPacket;
       interface PacketAcknowledgements as Acks;
   }
}implementation{
   enum{
       IdClient = unique(QUEUEDSEND_CLIENTID)
   };

   components QueuedSendP, new AMSenderC(AMId) as SubSend,
           new QueueC(message_t*, size) as QueueP,

   QueuedSendP.Queue[IdClient] -> QueueP.Queue;
   QueuedSendP.SubSend[IdClient] -> SubSend.AMSend;
   QueuedSendP.Packet -> SubSend.Packet;
   QueuedSendP.AMPacket -> SubSend.AMPacket;
   QueuedAMSend = QueuedSendP.QueuedAMSend[IdClient];
   Packet = SubSend.Packet;
   AMPacket = SubSend.AMPacket;
   Acks = SubSend.Acks;
}

And header of QueuedSendP.nc:

module QueuedSendP{
   provides {
       interface QueuedAMSend[uint8_t id];
   }
   uses{
       interface AMSend as SubSend[uint8_t id];
       interface AMPacket;
       interface Packet;
       interface Queue<message_t*>[uint8_t id];
   }
}implementation{ ... }

Solutions ?

Thanks, Filipe Alves

----- Original Message ----- From: "Philip Levis" <[EMAIL PROTECTED]>
To: "Filipe Alves" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: terça-feira, 13 de Março de 2007 17:40
Subject: Re: [Tinyos-help] TinyOS 2.x: Generic configurations/modules


On Mar 13, 2007, at 10:22 AM, Filipe Alves wrote:


Hi Phil,

Thanks for the input ! I will probably ( like 99.99% ) follow that approach, but given that QueuedAMSenderM, is equal for every body, and it doesn't depend on any parameters should it be non generic, i.e., a normal module, maybe using parameterized interfaces to tell the clients appart ? Would this work ?

generic configuration QueuedAMSenderC(am_id_t id, uint8_t size) {
 provides QueuedAMSend;
 provides Packet;
 provides AMPacket;
}
implementation {

   enum{
         id = unique("queuedSend.client");
   }

components new QueuedAMSenderM, new AMSenderC(id), new QueueC (message_t*, size);

QueuedAMSend -> QueuedAMSenderM[id]; // This a realtive certain that works
 Packet -> AMSenderC;
 AMPacket -> AMSenderC;

 QueuedAMSenderM.SubSend[id] -> AMSenderC;  // This not that sure
 QueuedAMSenderM.SendQueue[id] -> QueueC;    // dido

}

It absolutely would. This is definitely a better way to do it. I tried to keep my example simple (at the cost of a waste of code space).

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

Reply via email to