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.
| Parameter | Type | Description |
|---|---|---|
api | NativeApi |
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)
| Parameter | Type | Description |
|---|---|---|
address | long | |
count | int | The maximum number of bytes to read. |
buffer | byte[] | |
offset | int | |
timeout | TimeSpan |
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)
| Parameter | Type | Description |
|---|---|---|
address | long | |
count | int | The number of bytes to write. |
buffer | byte[] | |
offset | int | |
timeout | TimeSpan |
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)
| Parameter | Type | Description |
|---|---|---|
sector | long | |
count | int | |
timeout | TimeSpan |
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)
| Parameter | Type | Description |
|---|---|---|
address | long | |
count | int |
Returns bool
EraseAll(TimeSpan timeout)
public extern void EraseAll(TimeSpan timeout)
Erases every sector on the media. (inherited)
| Parameter | Type | Description |
|---|---|---|
timeout | TimeSpan |