Hello !

I 'm implementing an application written in nesc language using tinyos2.x.
It is successfuly compiled, but I have some warnings related to the
incompatibility of some variables. I don't know if these warnings can have
an effect on simulation or when testing on the mote.
This is a snippet of code:
1) I declare a structure packet in the header File like this:

typedef nx_struct D_Packet_t {

nx_uint8_t level;

nx_uint32_t index;

nx_uint8_t kc_2_0[8];

nx_uint8_t mac[8];

nx_uint8_t dis[8];

} D_Packet_t;

2) Then I implement some functions and commands like this in a module:

error_t get_key(uint8_t lvl, uint32_t chn, uint32_t idx, uint8_t *keyplace)
{

// code

}

command error_t Sender.generate(uint8_t lvl, uint32_t snd_time, D_Packet_t
*packet,Sender_t *p ) {

if(!get_key(lvl+1,seq+2,0,packet->kc_2_0)) return FAIL;

if(!call Primitive.MAC(tmp,(uint8_t *)&(packet->index),12,packet->mac))

return FAIL;

//code

 return get_key(lvl,chn,idx-1,packet->dis);

//code

 return get_key(lvl,chn-1,sc.kc_len[lvl],packet->dis);

}

3) When I compile, I have warnings like this:

In function 'Sender.generate'

warning: passing argument 4 of 'get_key' from incompatbile pointer type

warning: passing argument4 of 'Primitive.MAC' from incompatible pointer
type.

/opt/tinyos-2.x/tos/chips/cc2420/lpl/DummyLplC.nc :39:2. warning : low power
communications disabled.

I have verified the compatibility of variables and it seems correct.

I don't know if these warnings could have an effect on the simulation on
motes or no , though it is successfully compiled and simulated.



Any suggestion and help will be more appreciated.

Kind Regards,

-- 


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

Reply via email to