Skip to main content

StorageControllerApiWrapper Class

Namespace: GHIElectronics.TinyCLR.Devices.Storage.Provider · Assembly: GHIElectronics.TinyCLR.Devices.Storage

Concrete IStorageControllerProvider backed by the native TinyCLR storage HAL.

public sealed class StorageControllerApiWrapper : IStorageControllerProvider, IApiImplementation

Constructors

StorageControllerApiWrapper(NativeApi api)

public StorageControllerApiWrapper(NativeApi api)

Wraps the given native API as a provider.

ParameterTypeDescription
apiNativeApi

Properties

Api

public NativeApi Api { get; }

The underlying native API descriptor.

Descriptor

public extern StorageDescriptor Descriptor { get; }

Media geometry and capabilities. (inherited)

Methods

Dispose()

public void Dispose()

Releases the native controller.

Open()

public extern void Open()

Powers on and initializes the media. (inherited)

Close()

public extern void Close()

When overridden by a descendant class, closes the response stream. (inherited)

Read(long address, int count, byte[] buffer, int offset, TimeSpan timeout)

public extern int Read(long address, int count, byte[] buffer, int offset, TimeSpan timeout)

Read a block of data from a cluster. (inherited)

ParameterTypeDescription
addresslong
countintThe maximum number of bytes to read.
bufferbyte[]
offsetint
timeoutTimeSpan

Returns int

Write(long address, int count, byte[] buffer, int offset, TimeSpan timeout)

public extern int Write(long address, int count, byte[] buffer, int offset, TimeSpan timeout)

Write a block of data to a cluster. (inherited)

ParameterTypeDescription
addresslong
countintThe number of bytes to write.
bufferbyte[]
offsetint
timeoutTimeSpan

Returns int

Erase(long sector, int count, TimeSpan timeout)

public extern int Erase(long sector, int count, TimeSpan timeout)

Erases count sectors starting at address. (inherited)

ParameterTypeDescription
sectorlong
countint
timeoutTimeSpan

Returns int

IsErased(long address, int count)

public extern bool IsErased(long address, int count)

True when the addressed span is in its erased (all-0xFF) state. (inherited)

ParameterTypeDescription
addresslong
countint

Returns bool

EraseAll(TimeSpan timeout)

public extern void EraseAll(TimeSpan timeout)

Erases every sector on the media. (inherited)

ParameterTypeDescription
timeoutTimeSpan