generated from thinkode/modelRepository
implement devices
This commit is contained in:
@@ -50,6 +50,7 @@ func (f *Provider) OnRemoval(cb func(context.Context, hardware.Endpoint)) {
|
||||
// Create creates a new endpoint, based on the endpoint information (manually created)
|
||||
func (f *Provider) Create(ctx context.Context, endpointInfo hardware.EndpointInfo) (hardware.EndpointInfo, error) {
|
||||
// If the SerialNumber is empty, generate another one
|
||||
// TODO: Move the serialnumber generator to the endpoint itself
|
||||
if endpointInfo.SerialNumber == "" {
|
||||
endpointInfo.SerialNumber = strings.ToUpper(fmt.Sprintf("%08x", rand.Intn(1<<32)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user