peripheral optimizations

This commit is contained in:
2025-01-04 00:36:29 +01:00
parent 556f24991e
commit e4392c8902
10 changed files with 408 additions and 342 deletions

View File

@@ -21,12 +21,14 @@ type PeripheralInfo struct {
Settings []interface{} `yaml:"settings"` // Number of DMX universes handled by the peripheral
}
// PeripheralDriver represents how compatible peripheral drivers are implemented
type PeripheralDriver interface {
// PeripheralFinder represents how compatible peripheral drivers are implemented
type PeripheralFinder interface {
Initialize() error // Initializes the protocol
Start(context.Context) error // Start the detection
Stop() error // Stop the detection
ForceScan() // Explicitly scans for peripherals
CreatePeripheral(ctx context.Context) (Peripheral, error) // Creates a new peripheral
DeletePeripheral(serialNumber string) error // Removes a peripheral
GetName() string // Get the name of the finder
GetPeripheral(string) (Peripheral, bool) // Get the peripheral
Scan(context.Context) error // Scan for peripherals
CreatePeripheral(ctx context.Context) (Peripheral, error) // Creates a new peripheral
RemovePeripheral(serialNumber string) error // Removes a peripheral
}