Apps     Components     Interfaces     All Files     Source Tree     source: tos.lib.FS.Read.nc

Component: Read

Required Interfaces

Provided Interfaces

Variables

Function Index

Function Descriptions

FileRead.open

command result_t FileRead.open (uint8_t fd, const char *filename)

open a file for sequential reads.

Parameters:

filename - Name of file to open. Must not be stack allocated.

Returns: SUCCESS: attempt proceeds, opened will be signaled
FAIL: filesystem is busy or another file is open for reading

FileRead.read

command result_t FileRead.read (uint8_t fd, void *buffer, filesize_t n)

Read bytes sequentially from open file.

Parameters:

buffer - Target to read into

n - Number of bytes to read

Returns: SUCCESS: attempt proceeds, readDone will be signaled
FAIL: no file was open for reading, or a read is in progress

FileRead.getRemaining

command result_t FileRead.getRemaining (uint8_t fd)

Return number of bytes remaining in file.
Returns: SUCCESS: attempt proceeds, remaining will be signaled
FAIL: no file was open for reading, or a read is in progress