In fact, i use the following structure to exchange message between node on
network.

 

typedef struct riseg_msg{

  nx_uint8_t type;    /*the type of the riseg message*/

  uint8_t *data;

  nx_uint32_t mac;    /* the mac field, present in all riseg message */

} riseg_msg_t;

 

 

/*Default size=19 bytes*/

typedef struct join_key_msg{

 

  nx_uint16_t next;    /* the address of the next hop in the ring */

  nx_uint8_t gid;    /* the group identity */

  uint8_t key[KEY_SIZE]; /*the group key. Default size=16 bytes*/

 

} join_key_msg_t;

 

riseg_msg_t *risegMsgSent;

 

However, when I print the size of message I get 12 instead of 9 (1+4+4).

====output using printf=========================

sizeof(riseg_msg_t):12, sizeof(join_key_msg_t):19 

sizeof(riseg_msg_t->type):1, sizeof(riseg_msg_t->data):4,
sizeof(riseg_msg_t->mac):4 

sizeof(risegMsgSent):4, sizeof(*risegMsgSent):12,

 

I do not understand. 

 

Can anybody explain to me why 12? What is the size of pointer in TinyOS?

 

Thanks in advance,

 

De : Prabhakar Misra [mailto:misra.pra...@gmail.com] 
Envoyé : jeudi 8 juillet 2010 21:22
À : Omar Cheikhrouhou (yahoo)
Objet : Re: [Tinyos-help] problem sending message

 

Hi,
Your problem is a bit vague, may be you could be a bit more exact.
Is the sending being done over a radio or something??

On Thu, Jul 8, 2010 at 1:31 PM, Omar Cheikhrouhou (yahoo)
<enis01a...@yahoo.fr> wrote:

When i send two succesive message in telosb mote I got that the second
packet has as value the first one when I print its value in senddone and
receive.

Do you  have any explication for this problem…


_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help




-- 
Regards,
Prabhakar Misra,
Senior Undergraduate,
Department of Computer Science and Enginnering.
Indian Institute of Technology Kanpur,
India.

_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to