I'm a beginner and I try to create a struct in nesc for a tinyos app, but i have this error that i don't know how to fix. Any ideas? The code of the struct is:
typedef nx_struct Message
{
nx_uint16_t ID
float info;
} messaget;
On
You missed a ; after nx_uint16_t ID. A sample message may go like this:
typedef nx_struct test_message
{
nx_uint16_t ID
float info;
} test_message_t;
If you want to learn more about how to use structs to define message formats and directly access messages. You may refer to section 3.5.3 Platform-independent types in TinyOS Programming , a Book by David Gay and Philip A. Levis.
I think you're just missing a semicolon after
ID. Also, the name you are giving your type is very close tomessage_twhich is already used by TinyOS - I would recommend giving it a more descriptive name, likeMyInformationMessage_t.