generated from thinkode/modelRepository
fixed multiple MIDI devices S/N
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// OS2LDriver represents how the protocol is defined
|
||||
@@ -27,7 +28,7 @@ func (d *OS2LDriver) Initialize() error {
|
||||
// CreatePeripheral creates a new OS2L peripheral
|
||||
func (d *OS2LDriver) CreatePeripheral(ctx context.Context) (Peripheral, error) {
|
||||
// Create a random serial number for this peripheral
|
||||
randomSerialNumber := fmt.Sprintf("%08x", rand.Intn(1<<32))
|
||||
randomSerialNumber := strings.ToUpper(fmt.Sprintf("%08x", rand.Intn(1<<32)))
|
||||
peripheral := NewOS2LPeripheral("OS2L", randomSerialNumber)
|
||||
d.peripherals[randomSerialNumber] = peripheral
|
||||
return peripheral, nil
|
||||
|
||||
Reference in New Issue
Block a user