21-peripherals-settings (#22)

Added the concept of peripheral settings.

Reviewed-on: #22
This commit was merged in pull request #22.
This commit is contained in:
2025-01-25 17:43:45 +00:00
parent 0e3f57f5fb
commit c7fe171cb4
10 changed files with 258 additions and 52 deletions

View File

@@ -8,17 +8,19 @@ type Peripheral interface {
Disconnect(context.Context) error // Disconnect the peripheral
Activate(context.Context) error // Activate the peripheral
Deactivate(context.Context) error // Deactivate the peripheral
SetPeripheralSettings(map[string]interface{}) error // Set a peripheral setting
SetDeviceProperty(context.Context, uint32, uint32, byte) error // Update a device property
GetInfo() PeripheralInfo // Get the peripheral information
GetInfo() PeripheralInfo // Get the peripheral information
GetSettings() map[string]interface{} // Get the peripheral settings
}
// PeripheralInfo represents a peripheral information
type PeripheralInfo struct {
Name string `yaml:"name"` // Name of the peripheral
SerialNumber string `yaml:"sn"` // S/N of the peripheral
ProtocolName string `yaml:"protocol"` // Protocol name of the peripheral
Settings []interface{} `yaml:"settings"` // Number of DMX universes handled by the peripheral
Name string `yaml:"name"` // Name of the peripheral
SerialNumber string `yaml:"sn"` // S/N of the peripheral
ProtocolName string `yaml:"protocol"` // Protocol name of the peripheral
Settings map[string]interface{} `yaml:"settings"` // Peripheral settings
}
// PeripheralFinder represents how compatible peripheral drivers are implemented