Hellow all.
   
  I used the example from /SenseLightToLog/SimpleCmdMsg.nc line 116 and tried 
to read log from EEPROM. But I am not sure if I use the correct syntax and I 
got no result back. 
   
  Here is part of line 116 of SimpleCmdMsg.nc
  call LoggerRead.readNext(((struct LogMsg *)log_msg.data)->log)
  log_msg is defined as:
  TOS_Msg log_msg
   
  Besides, in file SimpleCmd.h the structure of LogMsg is defined as:
  typedef struct LogMsg {
    uint16_t sourceaddr; 
    uint8_t log[16];
} LogMsg;
   
  In my application case, I make my own structure as follows:
  typedef struct BodyMsg
{
 uint16_t source;
 uint16_t time;
 uint16_t reading;
} BodyMsg;
   
  typedef struct CmdMsg
{
 int8_t action;
 union {
  BodyMsg body_msgs;
  uint8_t log[6];
 } Data;
} CmdMsg;
   
  I want to point the read log data to the portion of log[6].
  So I use the syntax like this:
  TOS_Msg SendPkt;
  call LoggerRead.read( cur_line, ((struct CmdMsg *)SendPkt.data)->Data.log );
   
  After that I send out the data read from log like this:
  struct CmdMsg *Cmd_ptr;
  Cmd_ptr = (struct CmdMsg *) SendPkt_ptr->data;
Cmd_ptr -> action = LOAD;
  call SendLog.send( BASE_STATION, sizeof(struct CmdMsg), SendPkt_ptr );
   
  But I did not get the logging data sent out. And I did not know if I have 
read the data from EEPROM or not. I think I have stored the data to the EEPROM 
correctly.
   
  Can anyone point my out the mistake? Right now I am guessing 
   
  Gary

       
---------------------------------
Moody friends. Drama queens. Your life? Nope! - their life, your story.
 Play Sims Stories at Yahoo! Games. 
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to