Hi~daniel??
First of all , Thanks so much for your fast reply.
I don't want to bother you. But I have a further question about this.
Actually, I've got the point of yours.
The fact is I need to parameterized interface. and I need to know how to use it.
Let me explain the why I need it.
enum{AckOne=0,AckTwo=1,...};
configuration A{
}
{ components TimerC, ...,..., ;
BeaconMoteM.Ack[AckOne] -> TimerC.Timer[unique("Timer")];
BeaconMoteM.Ack[AckTwo] -> TimerC.Timer[unique("Timer")];
BeaconMoteM.Ack[AckThree] -> TimerC.Timer[unique("Timer")];
BeaconMoteM.Ack[AckFour] -> TimerC.Timer[unique("Timer")];
}
module A{
uses interface Timer Ack[4];
}
Originally, I need parameterized interace with Timer interface type.
I want to start and stop the timer by Ack[index] indivisually. by not unique
interface instance name one by one.
That's why I need parameterized interface.
The Reference manual of nesC v1.1 says that you can use interface SendMsg
S[uint8_t id ] as a parameter interface
instead of interface X as Y as simple interface.
Is there a way to call start function of the timer by index of Ack[index]. not
acktimer1 or acktimer2.
like these one, call Ack[index].start (.....) or call
Ack.start[index](.........).
I'm not sure that it is enough for you to understand what I want.
Thanks for your reply again.
With regards
Jung > > Hi,> > You should view parameterized interface as array of
interfaces. > > Hence:> --------------> module A {> uses interface
SendMsg[uint8_t channel];> }> --------------> should be viewed as:>
--------------> module A {> uses interface SendMsg as SendMsg1;> uses interface
SendMsg as SendMsg2;> uses interface SendMsg as SendMsg3;> uses interface
SendMsg as SendMsg4;> ...> uses interface SendMsg as SendMsg255;> }>
--------------> > However, this array is not similar with array declaration of
variables:> ---------> uint8_t myData[4];> ---------> Therefore, you cannot
expand single interface into multiple interfaces:> ---------> uses interface
SendMsg mySendMsg[4]; // ILLEGAL> ---------> > The correct thing is to describe
them one by one:> ---------> uses interface SendMsg as SendMsg1;> uses
interface SendMsg as SendMsg2;> uses interface SendMsg as SendMsg3;> uses
interface SendMsg as SendMsg4;> ---------> > So, your previous method (uses
interface X as Y) was correc!
t. You don't> need parameterized interface for this case> > Hope that helps> >
Regards,> -daniel> > > On Mon, 2008-04-07 at 08:20 +0000, JungDoyeong wrote:> >
Hi~ everyone~!> > I've programmed some embedded solution in nesC v 1.1. > > I
have one question about interface parameter.> > > > Actually, I need to use
interface parameter on my work.> > So, I read nesC manual again carefully. The
manual says that > > > > interface SendMsg S[uint_t id] that is possible
expression within> > specification range.> > > > But when I coded like below> >
> > module A1 {> > .> > .> > . > > > > uses interface SendMsg Send[(uint8_t)
4]; // Actually I need four> > parameterized interface instance.> > > > }> > >
> then I just see complie error related to syntax .> > parse error before
'Send'> > > > What should I do with this?> > > > The definition of single
interface instance is working well.(e.g. uses> > interface X as Y;)> > > > How
can I use parameterized interface instance ??> > > > If you !
can help me with this problem, Plz let me know > > > > Thanks in advan
ce.> > > > > > with regards> > > > Jung> > >
_________________________________________________________________
확 달라진 MSN 홈페이지, 지금 바로 만나보세요!
http://www.msn.co.kr
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help