Apps     Components     Interfaces     All Files     Source Tree     source: tos.interfaces.AllocationReq.nc

Interface: AllocationReq

This interface is used as a two-phase allocation protocol for ByteEEPROM. Applications that require memory from the flash call request or requestAddr in their StdControl.init command. They later get a requestProcessed event back reporting success or failure of the allocation.
Author: Nelson Lee
  David Gay

Components providing this interface:
tos.platform.mica.ByteEEPROM
tos.system.ByteEEPROMAllocate

Components requiring this interface:
apps.HighFrequencySampling.HFSM
apps.TestEEPROM.Byte.TestByteEEPROMC
apps.TestEEPROM.ByteSpeed.ETimingM
tos.lib.FS.MetaData

Commands

Events

Commands - Details

request

result_t request(uint32_t numBytesReq)

Request a numBytesReq byte section of the flash. This request must be made at initilisation time (at the same time as ByteEEPROM is initialised)

Parameters:

numBytesReq - Number of bytes required

Returns: FAIL for invalid arguments, or if the flash has already been allocated. requestProcessed will be signaled if SUCCESS is returned.

requestAddr

result_t requestAddr(uint32_t byteAddr, uint32_t numBytesReq)

Request a specific section of the flash. This request must be made at initilisation time (at the same time as ByteEEPROM is initialised)

Parameters:

byteAddr - The starting byte offset. This must be on a page boundary (the TOS_BYTEEEPROM_PAGESIZE constant gives the page size)

numBytesReq - Number of bytes required

Returns: FAIL for invalid arguments, or if the flash has already been allocated. requestProcessed will be signaled if SUCCESS is returned.

Events - Details

requestProcessed

result_t requestProcessed(result_t success)

Signal result of a flash allocation request.

Parameters:

success - SUCCESS if the requested flash section was allocated.

Returns: Ignored.