generated from thinkode/modelRepository
load peripheral settings in front
This commit is contained in:
@@ -23,6 +23,18 @@ func (a *App) AddPeripheral(protocolName string, peripheralID string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetPeripheralSettings gets the peripheral settings
|
||||
func (a *App) GetPeripheralSettings(protocolName, peripheralID string) (map[string]interface{}, error) {
|
||||
// Get the device from its finder
|
||||
p, found := a.hardwareManager.GetPeripheral(protocolName, peripheralID)
|
||||
if !found {
|
||||
log.Error().Str("file", "peripheral").Str("protocolName", protocolName).Str("periphID", peripheralID).Msg("unable to found the specified peripheral")
|
||||
return nil, fmt.Errorf("unable to found the peripheral ID '%s'", peripheralID)
|
||||
}
|
||||
// Return the peripheral settings
|
||||
return p.GetSettings(), nil
|
||||
}
|
||||
|
||||
// RemovePeripheral adds a peripheral to the project
|
||||
func (a *App) RemovePeripheral(protocolName string, peripheralID string) error {
|
||||
// TODO: Disconnect the peripheral
|
||||
|
||||
Reference in New Issue
Block a user