Problem in the event rreqsender.sendDone.
Led is set when the route_record[i] of i is below 8 , if not there is no
signal..
implementation{
bool busy;
message_t pkt;
event void Boot.booted() {
call Radio.start();
call Leds.set(1);
}
event void Radio.startDone(error_t err) {
if (!busy) {
RouteDiscovery_t *rreq = (RouteDiscovery_t*)(call
Packet.getPayload(&pkt, sizeof (RouteDiscovery_t)));
/// logics to send code
if (call rreqsender.send(AM_BROADCAST_ADDR, &pkt,
sizeof(RouteDiscovery_t)) == SUCCESS) {
busy = TRUE;
}
}
}
event void rreqsender.sendDone(message_t *msg, error_t error) {
if ((error==SUCCESS)&&(&pkt == msg)){
busy = FALSE;
call Leds.set(7); //// here the problem wrt modifications in the
structure
}
}
event void Radio.stopDone(error_t err) {
}
}
/// this is the structure, and gets corrupted if i change route_record[]
if it is below 8, rreq.sender sets the LED if not there is no indication.
typedef nx_struct RouteDiscovery_t{
nx_uint8_t type;
nx_uint16_t src ;
nx_uint16_t desn ;
nx_uint16_t reqid;
nx_uint16_t repid;
nx_uint16_t nodeid;
nx_uint16_t route_record[7]; /// here is the problem, if i increase array
size
nx_uint8_t numhops;
nx_uint8_t route_num;
} RouteDiscovery_t;
Swetha
[email protected]
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help