[Tinyos-host-mote-wg] Re: [Tinyos-2.0wg] nesC passing strings to
generic components/modules
Philip Levis
pal at cs.berkeley.edu
Wed May 18 23:39:33 PDT 2005
On May 18, 2005, at 9:46 PM, Joe Polastre wrote:
> I have tried to pass a string and I get the following error when I use
> the string inside "unique" inside of a module:
>
> argument to `unique' must be a string
>
> same thing happens with uniqueCount
>
> I've defined by components with:
>
> generic configuration BusArbitrationC(char busname[]) { ... }
>
> generic module BusArbitrationM(char busname[]) {
> void foo() {
> uint8_t bar = uniqueCount(busname);
> }
> }
>
> char name[] seems to be acceptible to nesC while (rationally) char*
> is not
>
> I've checked the OSKI code and Phil seems to use char[] and char* in
> various pieces of code, but none of that code is actually compiles.
>
> suggestions?
>
I ran into the same issue: components I was working on use [] while
those I haven't gotten to yet use *. David Gay said that he would
have to look into it; he seemed to recall some complexities as to why
unique() only took char[]. Making it take char* might be a good deal
of work.
I wasn't able to get char[] to compile in my code either. He's
looking at that too. Once it's worked out, Cory said he'd probably be
changing some of his components: he didn't realize you could do this.
Phil
_______________________________________________
Tinyos-2.0wg mailing list
Tinyos-2.0wg at Mail.Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-2.0wg
More information about the Tinyos-host-mote-wg
mailing list