Interface: moteiv.tos.lib.Flash.BlockRead
interface BlockRead
Read interface for the block storage abstraction described in
TEP103.
- Author:
-
Jonathan Hui <jwhui@cs.berkeley.edu>
Commands
command result_t computeCrc(block_addr_t addr, block_addr_t len)
command block_addr_t getSize()
command result_t read(block_addr_t addr, void *buf, block_addr_t len)
command result_t verify()
Events
event void computeCrcDone(storage_result_t result, uint16_t crc, block_addr_t addr, block_addr_t len)
event void readDone(storage_result_t result, block_addr_t addr, void *buf, block_addr_t len)
event void verifyDone(storage_result_t result)
Commands - Details
computeCrc
command result_t computeCrc(block_addr_t addr, block_addr_t len)
- Parameters:
-
addr
- starting address.
-
len
- the number of bytes to compute the crc over.
- Returns:
-
SUCCESS if the request was accepted, FAIL otherwise.
getSize
command block_addr_t getSize()
- Returns:
-
Volume size.
read
command result_t read(block_addr_t addr, void *buf, block_addr_t len)
- Parameters:
-
addr
- starting address to begin reading.
-
buf
- buffer to place read data.
-
len
- number of bytes to read.
- Returns:
-
SUCCESS if the request was accepted, FAIL otherwise.
verify
command result_t verify()
- Returns:
-
SUCCESS if the request was accepted, FAIL otherwise.
Events - Details
computeCrcDone
event void computeCrcDone(storage_result_t result, uint16_t crc, block_addr_t addr, block_addr_t len)
- Parameters:
-
addr
- stating address.
-
len
- number of bytes the crc was computed over.
-
crc
- the resulting crc value.
-
result
- notification of how the operation went.
readDone
event void readDone(storage_result_t result, block_addr_t addr, void *buf, block_addr_t len)
- Parameters:
-
addr
- starting address of read.
-
buf
- buffer where read data was placed.
-
len
- number of bytes read.
-
result
- notification of how the operation went.
verifyDone
event void verifyDone(storage_result_t result)
- Parameters:
-
error
- notification of how the operation went.