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 correct. 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 advance.
>
>
> with regards
>
> Jung
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help