Giter VIP home page Giter VIP logo

Comments (4)

ajcasagrande avatar ajcasagrande commented on August 16, 2024

@cloudxxx8 @weichou1229 Any updates on this?

from device-onvif-camera.

weichou1229 avatar weichou1229 commented on August 16, 2024

@ajcasagrande
Not sure how to handle the device name and other information properly. If we can't query the GetDeviceInformation API, the device name is just a UUID and hard to identify by the label.
https://github.com/edgexfoundry-holding/device-onvif-camera/blob/a683f0edb2f5badebbf413b4efd12f153319264c/internal/driver/driver.go#L332-L335

Or we might need to change the mechanism to provide the credential. For example, using secretPath list for matching the credential like below:

[Driver]
DefaultSecretPathes= ["credentials001", "credentials002"]

from device-onvif-camera.

cloudxxx8 avatar cloudxxx8 commented on August 16, 2024

@ajcasagrande let's adopt your proposal. We can change here
https://github.com/edgexfoundry-holding/device-onvif-camera/blob/a683f0edb2f5badebbf413b4efd12f153319264c/internal/driver/driver.go#L321-L324

to:

		devInfo, edgexErr := d.getDeviceInformation(dev)
		endpointRef := onvifDevice.GetDeviceParams().EndpointRefAddress
		var discovered sdkModel.DiscoveredDevice
		if edgexErr != nil {
			d.lc.Warnf("failed to get the device information for the camera %s, %v", endpointRef , edgexErr)
			dev.Protocols[OnvifProtocol][SecretPath] = endpointRef 
			discovered = sdkModel.DiscoveredDevice{
				Name:        endpointRef,
				Protocols:   dev.Protocols,
				Description: "Auto discovered Onvif camera",
				Labels:      []string{"auto-discovery"},
			}
		} else {
			dev.Protocols[OnvifProtocol][Manufacturer] = devInfo.Manufacturer
			dev.Protocols[OnvifProtocol][Model] = devInfo.Model
			dev.Protocols[OnvifProtocol][FirmwareVersion] = devInfo.FirmwareVersion
			dev.Protocols[OnvifProtocol][SerialNumber] = devInfo.SerialNumber
			dev.Protocols[OnvifProtocol][HardwareId] = devInfo.HardwareId
			discovered = sdkModel.DiscoveredDevice{
				Name:        fmt.Sprintf("%s-%s-%s", devInfo.Manufacturer, devInfo.Model, endpointRef),
				Protocols:   dev.Protocols,
				Description: fmt.Sprintf("%s %s Camera", devInfo.Manufacturer, devInfo.Model),
				Labels:      []string{"auto-discovery", devInfo.Manufacturer, devInfo.Model},
			}
			d.lc.Debugf("Discovered camera from the address '%s'", onvifDevice.GetDeviceParams().Xaddr)
		}
		discoveredDevices = append(discoveredDevices, discovered)

Is it ok with you?

from device-onvif-camera.

weichou1229 avatar weichou1229 commented on August 16, 2024

@ajcasagrande Could you help review the PR? #10

from device-onvif-camera.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.