I see sorry,
another way you might try is

struct
{
  uint8_t flag;
  uint8_t length;
} Command;

this definitely works for me. All other thing i see that might be different..


julien falco wrote:

it doesnt work (i declared struct and not typedef struct) and anyway it did not work with typedef struct either! there must be someting else... :-(



On 6/11/07, *Gideon Spreeth* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Declare Cmd1 just by saying:

    Command Cmd1;

    julien falco wrote:
    >
    >
    >
    > I am trying to set a value to an uint8_t type in a structure. i
    wrote
    > it the C way:
    >
    >
    > struct Command
    > {
    >    uint8_t flag;
    >    uint8_t length;
    > };
    >
    > struct Command Cmd1;
    >
    >     Cmd1.flag = '0';
    >
    > but at compiling it says that
    >
    > ReaderControllerM.nc :52: unexpected interface reference in
    declaration
    > of `Cmd1.
    > flag'
    >
    > What does it mean? How to give a value to a byte in tinyos in
    general,
    > and what are the types? I am actually trying to go a bit further
    with
    > the struct and do something like this below, but since i am already
    > stucked with a simple one...:
    >
    > struct Command
    > {
    >    uint8_t flag[2];
    >    uint8_t length[4];
    > };
    >
    > thanks guys.
    >
    >
    >
    ------------------------------------------------------------------------
    >
    > _______________________________________________
    > Tinyos-help mailing list
    > Tinyos-help@Millennium.Berkeley.EDU
    <mailto:Tinyos-help@Millennium.Berkeley.EDU>
    >
    https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
    <https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help>



_______________________________________________
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to