struct tt__PTZConfiguration* getPTZConfiguration(struct soap* soap) {
	struct tt__PTZConfiguration* result =
			(struct tt__PTZConfiguration*) my_soap_malloc(soap,
					sizeof(struct tt__PTZConfiguration));
//	result->DefaultAbsolutePantTiltPositionSpace =
//			getAbsolutePantTiltPositionSpaceURI(soap);
//	result->DefaultAbsoluteZoomPositionSpace = getAbsoluteZoomPositionSpaceURI(
//			soap);
	result->DefaultContinuousPanTiltVelocitySpace =
			getContinuousPanTiltVelocitySpaceURI(soap);
	result->DefaultContinuousZoomVelocitySpace =
			getContinuousZoomVelocitySpaceURI(soap);
//	result->DefaultRelativePanTiltTranslationSpace =
//			getRelativePanTiltTranslationSpaceURI(soap);
//	result->DefaultRelativeZoomTranslationSpace =
//			getRelativeZoomTranslationSpaceURI(soap);
//	result->DefaultPTZSpeed = getPTZConfigurationPTZSpeed(soap);
	result->DefaultPTZTimeout = (LONG64*) my_soap_malloc(soap, sizeof(LONG64));
	*result->DefaultPTZTimeout = getDefaultPTZTimeout();
	result->Name = getPTZName(soap, 0);
	result->token = getPTZConfigurationToken(soap, 0);
	result->NodeToken = getPTZNodeToken(soap, 0);
//	result->PanTiltLimits = getPTZConfigurationPanTiltLimits(soap);
//	result->ZoomLimits = getPTZConfigurationZoomLimits(soap);
	return result;
}
struct tt__PTZConfigurationOptions* getPTZConfigurationOptions(
		struct soap* soap) {
	struct tt__PTZConfigurationOptions* result =
			(struct tt__PTZConfigurationOptions*) my_soap_malloc(soap,
					sizeof(struct tt__PTZConfigurationOptions));
	result->PTZTimeout = getDurationRange(soap, 0, getDefaultPTZTimeout());
	result->PTControlDirection = NULL;
	result->Spaces = getPTZSpaces(soap);
	result->PTControlDirection =
			(struct tt__PTControlDirectionOptions*) my_soap_malloc(soap,
					sizeof(struct tt__PTControlDirectionOptions));
	return result;
}
struct tt__ZoomLimits* getPTZConfigurationZoomLimits(struct soap* soap) {
	struct tt__ZoomLimits* result = (struct tt__ZoomLimits*) my_soap_malloc(
			soap, sizeof(struct tt__PanTiltLimits));
	result->Range = getPTZSpace1DDescription(soap,
			getContinuousZoomVelocitySpaceURI(soap), -100, 100);
	return result;
}
Example #4
0
struct tt__IntRange* getIntRangeByOnvifRange(struct soap* soap, OnvifRange* range) {
	struct tt__IntRange* result = (struct tt__IntRange *) my_soap_malloc(soap,
			sizeof(struct tt__IntRange));
	result->Min = range->min;
	result->Max = range->max;
	return result;
}
struct tt__FloatRange* getFloatRange(struct soap* soap, int min, int max) {
	struct tt__FloatRange* result = (struct tt__FloatRange*) my_soap_malloc(
			soap, sizeof(struct tt__FloatRange));
	result->Min = min;
	result->Max = max;
	return result;
}
struct tt__Vector1D* getVector1D(struct soap* soap, char* uri, const float x) {
	struct tt__Vector1D* result = (struct tt__Vector1D*) my_soap_malloc(soap,
			sizeof(struct tt__Vector1D));
	result->space = uri;
	result->x = x;
	return result;
}
struct tt__Space1DDescription* getPTZSpace1DDescription(struct soap* soap,
		char* uri, int xmin, int xmax) {
	struct tt__Space1DDescription* result =
			(struct tt__Space1DDescription*) my_soap_malloc(soap,
					sizeof(struct tt__Space1DDescription));
	result->URI = uri;
	result->XRange = getFloatRange(soap, xmin, xmax);
	return result;
}
struct tt__DurationRange* getDurationRange(struct soap* soap, LONG64 lMin,
		LONG64 lMax) {
	struct tt__DurationRange* result =
			(struct tt__DurationRange*) my_soap_malloc(soap,
					sizeof(struct tt__DurationRange));
	result->Max = lMax;
	result->Min = lMin;
	return result;
}
struct tt__PTZSpeed* getPTZConfigurationPTZSpeed(struct soap* soap) {
	struct tt__PTZSpeed* result = (struct tt__PTZSpeed*) my_soap_malloc(soap,
			sizeof(struct tt__PTZSpeed));
	result->PanTilt = getVector2D(soap,
			getContinuousPanTiltVelocitySpaceURI(soap), 0.0, 0.0);
	result->Zoom = getVector1D(soap, getContinuousZoomVelocitySpaceURI(soap),
			0.0);
	return result;
}
Example #10
0
static int my_soap_subcode2_fault(struct soap *soap, const char *faultcode,
		const char *faultsubcodeQName, const char *faultsubcodeQName1,
		const char *faultstring, const char *faultdetailXML) {
	int result = my_soap_copy_fault(soap, faultcode, faultsubcodeQName,
			faultstring, faultdetailXML);
	soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Subcode =
			(struct SOAP_ENV__Code*) my_soap_malloc(soap,
					(sizeof(struct SOAP_ENV__Code)));
	soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Subcode->SOAP_ENV__Value =
			soap_strdup(soap, faultsubcodeQName1);
	return result;
}
struct tt__PTZNode* getPTZNodeInfo(struct soap* soap, int index) {
	struct tt__PTZNode* result = (struct tt__PTZNode*) my_soap_malloc(soap,
			sizeof(struct tt__PTZNode));
	result->Name = getPTZName(soap, index);
	result->token = getPTZNodeToken(soap, index);
	result->FixedHomePosition = getxsdBoolean(soap, false);
	int presets = 0;
	getPTZPresetsCapacity(&presets);
	result->MaximumNumberOfPresets = presets;
	result->SupportedPTZSpaces = getPTZSpaces(soap);
	return result;
}
struct tt__PTZSpaces* getPTZSpaces(struct soap* soap) {
	struct tt__PTZSpaces* result = (struct tt__PTZSpaces*) my_soap_malloc(soap,
			sizeof(struct tt__PTZSpaces));
	// getPTZNodeInfoSupportRelateSpace(soap, result);
	// getPTZNodeInfoSupportAbsoluteSpace(soap, result);
	getPTZNodeInfoSupportContinuousSpace(soap, result);
	result->PanTiltSpeedSpace = getPTZSpace1DDescription(soap,
			getContinuousPanTiltVelocitySpaceURI(soap), -100, 100);
	result->ZoomSpeedSpace = getPTZSpace1DDescription(soap,
			getContinuousZoomVelocitySpaceURI(soap), -100, 100);
	return result;
}
Example #13
0
struct soap* CSoapUtils::newSoap(CBaseSoapSecurityInfo* securityInfo)
{
	struct soap* psoap = NULL;
	psoap = soap_new();
	if (NULL == psoap)
	{
		printf("soap new error\r\n");
		return NULL;
	}
	soap_set_namespaces(psoap, namespaces);
	psoap->recv_timeout = SOAP_RECV_TIMEOUT;
	psoap->send_timeout    = SOAP_SEND_TIMEOUT;
    psoap->connect_timeout = SOAP_CONNECT_TIMEOUT;
	struct SOAP_ENV__Header* header = static_cast<struct SOAP_ENV__Header*>(my_soap_malloc(psoap, sizeof(struct SOAP_ENV__Header)));
	
	soap_default_SOAP_ENV__Header(psoap, header);
	
	char guid_string[100] = { 0 };
	GUID guid;
	
	if (CoCreateGuid(&guid))
	{
		deleteSoap(psoap);
		printf("create guid error\r\n");
		return NULL;
	}
	
	header->wsa__MessageID = static_cast<char*>(my_soap_malloc(psoap, 100));
	strcpy(header->wsa__MessageID, guid_string);
	psoap->header = header;
	if ((NULL != securityInfo) && (securityInfo->getUserName().length() > 0)){
		std::auto_ptr<ISetSoapSecurity> ap(CFactoryImpl::getInstance().createSetSoapSecurity());
		if (!CAppTools::getInstance().isRetSuccess(ap->setSecurity(psoap, securityInfo))) {
			deleteSoap(psoap);
			printf("set security error\r\n");
			return NULL;
		}
	}
	return psoap;
}
SOAP_FMAC5 int SOAP_FMAC6 __tptz__GetServiceCapabilities(
		struct soap* soap,
		struct _tptz__GetServiceCapabilities *tptz__GetServiceCapabilities,
		struct _tptz__GetServiceCapabilitiesResponse *tptz__GetServiceCapabilitiesResponse) {
	logInfo("__tptz__GetServiceCapabilities");
	tptz__GetServiceCapabilitiesResponse->Capabilities =
			(struct tptz__Capabilities*) my_soap_malloc(soap,
					sizeof(struct tptz__Capabilities));
	tptz__GetServiceCapabilitiesResponse->Capabilities->EFlip = getxsdBoolean(
			soap, false);
	tptz__GetServiceCapabilitiesResponse->Capabilities->Reverse = getxsdBoolean(
			soap, false);
	return SOAP_OK;
}
Example #15
0
struct soap* CSoapUtils::newProbeSoap(wsdd__ProbeType *req_, CBaseSoapSecurityInfo* securityInfo, CBaseRetInfo* retInfo)
{
	struct  soap* psoap = newSoapRetInfo(securityInfo, retInfo);
	if (NULL == psoap)
		return NULL;
    struct SOAP_ENV__Header* header = psoap->header;
	header->wsa__To = "urn:schemas-xmlsoap-org:ws:2005:04:discovery";
	header->wsa__Action = "http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe";

	wsdd__ScopesType* sScope_ = static_cast<wsdd__ScopesType*>(my_soap_malloc(psoap, sizeof(wsdd__ScopesType)));
	soap_default_wsdd__ScopesType(psoap, sScope_);
	sScope_->__item = "";
	soap_default_wsdd__ProbeType(psoap, req_);
	req_->Scopes = sScope_;
	req_->Types = ""; //"dn:NetworkVideoTransmitter";
	return psoap;
}
SOAP_FMAC5 int SOAP_FMAC6 __tptz__GetPresets(struct soap* soap,
		struct _tptz__GetPresets *tptz__GetPresets,
		struct _tptz__GetPresetsResponse *tptz__GetPresetsResponse) {
	logInfo("__tptz__GetPresets");
	OnvifPTZAllPresets onvifPTZAllPresets;
	if (!isRetCodeSuccess(getPTZAllPresets(&onvifPTZAllPresets))) {
		logInfo("__tptz__GetPresets getPTZAllPresets failed");
		return getOnvifPTZSoapActionNotSupport(soap, "PTZ GetPresets",
				"getPTZAllPresets failed");
	}
	tptz__GetPresetsResponse->__sizePreset = onvifPTZAllPresets.size;
	if (onvifPTZAllPresets.size > 0) {
		tptz__GetPresetsResponse->Preset =
				(struct tt__PTZPreset*) my_soap_malloc(soap,
						sizeof(struct tt__PTZPreset) * onvifPTZAllPresets.size);
		int i;
		for (i = 0; i < onvifPTZAllPresets.size; i++) {
			getPreset(soap, &(tptz__GetPresetsResponse->Preset[i]),
					&(onvifPTZAllPresets.presets[i]));
		}
	} else
		tptz__GetPresetsResponse->Preset = NULL;
	return SOAP_OK;
}
Example #17
0
enum xsd__boolean * getxsdBoolean(struct soap* soap, bool value) {
	enum xsd__boolean * result = (enum xsd__boolean *) my_soap_malloc(soap,
			sizeof(enum xsd__boolean));
	*result = value ? xsd__boolean__true_ : xsd__boolean__false_;
	return result;
}
Example #18
0
char* getIndexTokeName(struct soap *soap, const char* prefix, const int index) {
	char* result = (char *) my_soap_malloc(soap, sizeof(char) * INFO_LENGTH);
	sprintf(result, "%s%d", prefix, index);
	return result;
}