I am working with TinyOS 2.0 and using MIG for generating Java files. I have a problem with structure size (there are different sizes in a header file and in Java class). When I define a structure in header file:

typedef nx_struct attribute {
nx_uint8_t messageType:3;
nx_uint8_t queryId;
nx_uint8_t attribute:5;
} attribute_t;

it takes total 16 bits (3+8+5 = 16) what is 2 bytes. However in Java class generated by MIG with makefile line:

AttributeMsg.java:
mig java -target=null -java-classname=$(APP_PACKET).AttributeMsg Comm.h attribute -o $@

the structure size is different:

public static final int DEFAULT_MESSAGE_SIZE = 3;

When I use only full types of variables in header file, size in Java class is correct. When using bits, there is always one byte more in Java class (and this in independent of the amount of bit-variables). I would like to send more these structures in one message and every byte is for me very valueable.

How can this problem be solved?

Thanks in advance.

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

Reply via email to