implement devices

This commit is contained in:
2025-12-02 18:58:56 +01:00
parent b864f3ff7b
commit 5998f0d1cb
8 changed files with 136 additions and 16 deletions

View File

@@ -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)))
}