generated from thinkode/modelRepository
save peripherals in project file
This commit is contained in:
@@ -40,7 +40,20 @@ func (f *FTDIFinder) Initialize() error {
|
||||
|
||||
// GetName returns the name of the finder
|
||||
func (f *FTDIFinder) GetName() string {
|
||||
return "FTDI Finder"
|
||||
return "FTDI"
|
||||
}
|
||||
|
||||
// GetPeripheral gets the peripheral that correspond to the specified ID
|
||||
func (f *FTDIFinder) GetPeripheral(peripheralID string) (Peripheral, bool) {
|
||||
// Return the specified peripheral
|
||||
peripheral := f.peripherals[peripheralID]
|
||||
if peripheral == nil {
|
||||
fmt.Println("Unable to get the peripheral in the finder")
|
||||
return nil, false
|
||||
}
|
||||
fmt.Println("Peripheral found in the finder")
|
||||
|
||||
return peripheral, true
|
||||
}
|
||||
|
||||
//go:embed third-party/ftdi/detectFTDI.exe
|
||||
@@ -100,7 +113,7 @@ func (f *FTDIFinder) Scan(ctx context.Context) error {
|
||||
location = -1
|
||||
}
|
||||
// Add the peripheral to the temporary list
|
||||
peripheral, err := NewFTDIPeripheral(deviceInfo[2], deviceInfo[1], location)
|
||||
peripheral, err := NewFTDIPeripheral(deviceInfo[2], deviceInfo[1], location, f.GetName())
|
||||
if err != nil {
|
||||
return fmt.Errorf("Unable to create the FTDI peripheral: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user