Dear All:
I am using the EEPROMWrite function to save the data collected from MTS400 to
the EEPROM module in mica2. Here are some of the code I am using:
task void write_EEPROM()
{
if (call EEPROMWrite.startWrite() == SUCCESS)
{
if (call EEPROMWrite.write(curWriteLine,
(uint8_t*)msg_radio->data) == FAIL)
{
call EEPROMWrite.endWrite();
}
call Leds.yellowOn(); // Writes to the EEPROM correctly.
curWriteLine++;
if (curWriteLine == EEPROM_LOGGER_APPEND_END)
curWriteLine = EEPROM_LOGGER_APPEND_START;
write_result = SUCCESS;
}
}
After this, I want to read the data from EEPROM and then send the data to Base.
Then I use the following code:
task void read_EEPROM()
{
if (call EEPROMRead.read(curReadLine,(uint8_t*)msg_radio->data))
{
msg_radio->data[SENSOR_ID] = SENSOR_BOARD_ID;
msg_radio->data[PACKET_ID] = 1;
msg_radio->data[NODE_ID] = TOS_LOCAL_ADDRESS;
msg_radio->addr = TOS_BCAST_ADDR;
msg_radio->type = 3;
msg_radio->length = MSG_LEN;
msg_radio->group = TOS_AM_GROUP;
curReadLine++;
call RadioSend.send(msg_radio);
call Leds.redOn();
}
}
But I think I should not use "(uint8_t*)msg_radio->data" in the EEPROMRead.read
function cause everytime the data sent to the base is not the data saved in the
EEPROM module, but the real time data collected from the sensor board.
Do you have any idea what kind of parameter can I use in the EEPROMRead.read to
extract data from EEPROM module?
Thank you so much!
Sincerely,
Michael
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help