You might want to brush up on your C pointers,
this is a reasonable resource:
http://en.wikibooks.org/wiki/C_Programming

Basically you need to copy your string into your buffer,
both errors you show are attempts at pointer assignment
which is a different beast. The string.h functions should
be available to do the copies.

MS

Tuan Ta wrote:
> Hi,
> 
> I'm new to nesC and TinyOS. I'm trying to send packet over the radio 
> with payload is a fixed-size string. When I used char[MAX_STR_LEN] in my 
> message structure, I received an error saying char[] is not a network 
> type. So I switched to uint8_t[MAX_STR_LEN].
> 
> However, in my module implementation,
> uint8_t str[100];
> str = "Hello";
> or
> str = (uint8_t*) "Hello";
> 
> both gave me an "invalid lvalue in assignment" error.
> 
> What is the best way to manipulate strings in nesC? Can I use C 
> functions in "string.h" such as strcat(), itoa(),...?
> 
> Thank you very much,
> 
> Johnny
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to