Skip to main content

StorageController Class

Package: GHIElectronics.Endpoint.Devices.Storage
Namespace: GHIElectronics.Endpoint.Devices.Storage

The SD card slot or the USB drives. Events come on the library's storage thread. A drive that is pulled out is unmounted by the library. The SD card is at /media/sd/; USB drives get the first free /media/usbN/, as Windows gives the first free drive letter. A controller stays alive until it is disposed.

class StorageController(IDisposable): ...

Properties​

Name​

Name: str # @property

The name this controller was created with (e.g. EPM815.StorageController.SdCard).

Returns string

Methods​

Disable()​

def Disable(self) -> None:

Stops reporting drives. Already-reported drives stay mounted; call FileSystem.Unmount to unmount them.

Dispose()​

def Dispose(self) -> None:

Stops the events (one being delivered finishes first)

Enable()​

def Enable(self) -> None:

Starts reporting drives: first the ones already plugged in

FromName(string name)​

@staticmethod
def FromName(name: str) -> StorageController:

EPM815.StorageController.SdCard or EPM815.StorageController.UsbHostMassStorage

Returns StorageController

Events​

ConnectionChanged​

ConnectionChanged # += / -= handler

A drive connected or disconnected