[Tinyos-help] BlockStorageC with telosb
harun
oezturgu at fh-coburg.de
Mon Aug 21 03:34:02 PDT 2006
Dear All,
I am trying to use the BlockStorageC with a telosb mote for network-reprogramming. But I don´t know how to use it.
That´s why, I searched to find information how to use it and I found an example in the Mailing List, but it doesn´t work. I get always a FAIL in the Mount.mountDone event.
//...
result_t checkStorageResult(storage_result_t result) {
if(result == STORAGE_OK) {
return SUCCESS;
} else {
return FAIL;
}
}
command result_t StdControl.init() {
return call Leds.init();
}
command result_t StdControl.start() {
call Mount.mount(0);
return SUCCESS;
}
command result_t StdControl.stop() {
return SUCCESS;
}
event void Mount.mountDone(storage_result_t result, volume_id_t id) {
if(!checkStorageResult(result)) {
call Leds.redOn();
return;
}
if(!call BlockWrite.write(0x0, &my_write_buffer, sizeof(my_write_buffer))) {
}
}
event void BlockWrite.writeDone(storage_result_t result, block_addr_t addr, void* buf,
block_addr_t len) {
if(checkStorageResult(result)) {
if(!call BlockRead.read(0x0, &my_read_Buffer, sizeof(my_write_buffer))) {
}
}
}
//...
Can anyone help me ?
Could someone give me any simple hint, start point or a example ?
I have one more question: Is BlockStorageC the correct choice ?
Thank you in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20060821/27778de3/attachment.htm
More information about the Tinyos-help
mailing list