IOTechSystems / onvif

full and enhanced onvif protocol stack in golang.
MIT License
21 stars 13 forks source link

feat: generate functions for all message types #13

Closed ajcasagrande closed 2 years ago

ajcasagrande commented 2 years ago

Signed-off-by: Anthony Casagrande anthony.j.casagrande@intel.com

Note: I will leave comments below on many of the files to help make code review a little easier

Note 2: All */function.go files are auto generated.

There are a lot of commands defined in the code that are not accessible because they do not have proper mappings. This code consists of a python script that scrapes the response types and formulates functions based on that. It may not be perfect, but I do not believe there is any missing commands from before the generator ran.

Also, fixes a small bug in the DevicesFromProbeResponses where there is no http timeout. While not usually going to be an issue, better be safe than sorry. Was discovered when running the unit tests.

weichou1229 commented 2 years ago

This code consists of a python script that scrapes the response types and formulates functions based on that.

So If the user wants to add a new ONVIF function,

@ajcasagrande Could you help resolve the conflicts and add this new feature to the doc?

ajcasagrande commented 2 years ago

This code consists of a python script that scrapes the response types and formulates functions based on that.

So If the user wants to add a new ONVIF function,

  • user needs to add the definition in types.go file
  • and run the gen_commands.py to generate the mapping and function code for the device-onvif-camera.

@ajcasagrande Could you help resolve the conflicts and add this new feature to the doc?

@weichou1229 Yes, you are correct, but some clarification: For the second bullet, this only allows the consumer of this library (such as device-onvif-camera) to make those calls from go code, however it will not expose them to EdgeX command service, as they need to be added to the device profile for that.

I can add some documentation for it, and the conflicts should be easy to resolve.

ajcasagrande commented 2 years ago

@weichou1229 Ready for re-review. I have:

Note: This PR should not be used in device-onvif-camera until post-release just to be safe.