KoynovStas / onvif_srvd

ONVIF Device(IP camera) Service server (Linux daemon)
GNU General Public License v2.0
279 stars 115 forks source link

How to add soapPTZBindingService #11

Closed santhku closed 5 years ago

santhku commented 5 years ago

Hi,

I am trying to add the APPLY(PTZBindingService, soap) in onvif_srvd.c, i am getting the error as below

src/onvif_srvd.c:146:9: error: ‘PTZBindingService’ was not declared in this scope APPLY(PTZBindingService, soap)
^ src/onvif_srvd.c:171:40: note: in definition of macro ‘DECLARE_SERVICE’

define DECLARE_SERVICE(service, soap) service service ## _inst(soap);

                                    ^

src/onvif_srvd.c:424:5: note: in expansion of macro ‘FOREACH_SERVICE’ FOREACH_SERVICE(DECLARE_SERVICE, soap) ^ src/onvif_srvd.c:146:9: error: ‘PTZBindingService_inst’ was not declared in this scope APPLY(PTZBindingService, soap)
^ src/onvif_srvd.c:174:26: note: in definition of macro ‘DISPATCH_SERVICE’ else if (service ## _inst.dispatch() != SOAP_NO_METHOD) {\ ^ src/onvif_srvd.c:441:9: note: in expansion of macro ‘FOREACH_SERVICE’ FOREACH_SERVICE(DISPATCH_SERVICE, soap) ^ Makefile:160: recipe for target 'src/onvif_srvd_debug.o' failed make: *** [src/onvif_srvd_debug.o] Error 1

How can i resolve this issue

KoynovStas commented 5 years ago

You should read the comment in this file more carefully: /src/onvif_srvd.c

santhku commented 5 years ago

ok

santhku commented 5 years ago

I found the below comment but, but getting errors while i do it. Let me know how can i proceed ahead /*

KoynovStas commented 5 years ago

To add a new service, follow these steps:

  1. You should learn the Makefile.
  2. Read the ONVIF specification
  3. Add the WSDL file for the service: https://www.onvif.org/profiles/specifications/
  4. To generate a using gsoap files of the parser (the Makefile will do this automatically) you May need to clean
  5. Add an implementation for the service (write handlers)
  6. Add an implementation file to the Makefile.
  7. Add the service to the macro FOREACH_SERVICE

You can read the early comments to understand how I've added say MediaBindingService.

santhku commented 5 years ago

Thanks was able to add and compile, now getting some errors i will try and resolve them

santhku commented 5 years ago

Hi, I was able to add the PTZ section and facing difficulty in the sending the response to ZoomSpeedSpace tptz__GetNodesResponse.PTZNode.back()->SupportedPTZSpaces->ZoomSpeedSpace.push_back(soap_new_tt__Space1DDescription(this->soap));

How can i send response URI and XRange and YRange value (Min and Max) to the client

Tried the below, compiles fine but gives soap error when the code is run struct ttSpace1DDescription* result = (struct ttSpace1DDescription*) my_soap_malloc(soap,sizeof(struct tt__Space1DDescription)); result->URI=getContinuousZoomVelocitySpaceURI(soap); result->XRange = getFloatRange(soap, 10, 20);

//std::string 
tptz__GetNodesResponse.PTZNode.back()->SupportedPTZSpaces->ZoomSpeedSpace.push_back(result);

Let me know how can i proceed

KoynovStas commented 5 years ago

I dont know. I did not work with PTZ. Try to examine the source of the gsoap parser.

santhku commented 5 years ago

Thanks I reviewed gsoap parser and was able to solve

santhku commented 5 years ago

I truly Appreciate your support so far PTZ is now up and running

Thanks ..

Now trying with PTZ presets

roleoroleo commented 4 years ago

Hi @santhku Could you share your work about PTZ?