Typecast data field of the message (TOS_Msg.data).  If that doesn't
make sense to you, consult a C programming manual.  TOS_Msg defines
data to be int8_t instead of uint8_t so that mig defines that data
array as a byte array instead of a short array in Java.  Here are
examples of typecasting:

    TOS_Msg msg;

    void f1() {
        uint8_t* body = (uint8_t*)msg.data;
        // ...
    }

    void f2() {
        MyStruct_t* body = (MyStruct_t*)msg.data;
        // ...
    }

Cory

On 2/15/06, Ian Welch <[EMAIL PROTECTED]> wrote:
> I'm trying to make a TOS_Msg with a data size of one byte as apposed to 2
> bytes. I looked in AM.h and it defines the array as "int8_t" How is this
> different that uint8_t? So my question is, do I modify this struct to make
> the data elements in the array of size 1byte. If so how?
>
> Thanks,
>   Ian
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
>
>

_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to