> command void* AMSendSync.getPayload(message_t* msg){
> sync_init= (sync_InitSec_msg_t*)(call subAMSendSync.getPayload(msg));
> return &(sync_init->sync);
> //return call subAMSendSync.getPayload(msg);
> }
This looks odd at best. (sync_init is a global? not good)
It looks ever worse because the pointer assignment and dereference
happen differently...
Make it a local, do whatever, return it. And don't use unneeded casts
(they can cover real problems).
> command error_t AMSendSync.send(am_addr_t addr, message_t* msg, uint8_t
> len){
> sync_init->Org=myOrg;
> for(k=0;k<8;k++){
> sync_init->cle[k]=cPi[k];
> }
> return call subAMSendSync.send(addr, msg,
> (uint8_t)sizeof(sync_InitSec_msg_t));
> //return call subAMSendSync.send(addr, msg, len);
> }
Once again, the use of the global sync_init here is very odd.
A simple bad memory address could cause a node to hang, etc.
Without knowing better what the situation is, it is hard to suggest a solution.
HTH,
Paul
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help