On Oct 20, 2008, at 5:14 AM, Daniel Patrick wrote:
> HI All,
>
> I know TOSSIM allow us to inspect in a running TinyOS application.
> But I'd like to update a variable. Is it possible?
> I've been looking for how to do this and I've found the
> Variable::getData() method (tossim.c).
>
> variable_string_t Variable::getData() {
> if (data != NULL && ptr != NULL) {
> str.ptr = data;
> str.type = format;
> str.len = len;
> str.isArray = isArray;
> // printf("Getting %s %s %s\n", format, isArray? "[]":"", name);
> memcpy(data, ptr, len);
> }
> else {
> str.ptr = (char*)"<no such variable>";
> str.type = (char*)"<no such variable>";
> str.len = strlen("<no such variable>");
> str.isArray = 0;
> }
> return str;
> }
>
> What I understand here is the "data" is my variable, so I have to set
> a new value in this variable. Is it true?
You can't set a variable. That's what TinyOS code does. If you want to
set a variable, write an AM handler in your application, and send the
node a packet over the UART.
Phil
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help