Server 如何实施onvif';gsoap在服务器端提供的实时拉点通知接口
对不起,我的英语很差,提前谢谢你 我想通过gsoap开发一个onvif服务器。到目前为止,discovery和GetDeviceInfo功能运行良好。根据onvif core规范章节第8.8.5部分环境条件,我希望我的服务器设备为客户端提供温度检查,但我不知道如何实现createPullPointSubscription和PullMessage接口 我参考了onvif核心规范的P9.10通知示例,但不起作用,以下是我的编码Server 如何实施onvif';gsoap在服务器端提供的实时拉点通知接口,server,event-handling,ip-camera,gsoap,onvif,Server,Event Handling,Ip Camera,Gsoap,Onvif,对不起,我的英语很差,提前谢谢你 我想通过gsoap开发一个onvif服务器。到目前为止,discovery和GetDeviceInfo功能运行良好。根据onvif core规范章节第8.8.5部分环境条件,我希望我的服务器设备为客户端提供温度检查,但我不知道如何实现createPullPointSubscription和PullMessage接口 我参考了onvif核心规范的P9.10通知示例,但不起作用,以下是我的编码 SOAP_FMAC5 int SOAP_FMAC6 __tev__Cre
SOAP_FMAC5 int SOAP_FMAC6 __tev__CreatePullPointSubscription(struct soap* soap, struct _tev__CreatePullPointSubscription *tev__CreatePullPointSubscription, struct _tev__CreatePullPointSubscriptionResponse *tev__CreatePullPointSubscriptionResponse)
{
tev__CreatePullPointSubscriptionResponse->SubscriptionReference.Address = (char *)soap_malloc(soap, sizeof(char) * 128);
strcpy(tev__CreatePullPointSubscriptionResponse->SubscriptionReference.Address, "http://192.168.12.1/Subscription?Idx=0");
tev__CreatePullPointSubscriptionResponse->wsnt__CurrentTime=time(NULL);
tev__CreatePullPointSubscriptionResponse->wsnt__TerminationTime=tev__CreatePullPointSubscriptionResponse->wsnt__CurrentTime+60;
return 0;
}
再次感谢
SOAP_FMAC5 int SOAP_FMAC6 __tev__PullMessages(struct soap* soap, struct _tev__PullMessages *tev__PullMessages, struct _tev__PullMessagesResponse *tev__PullMessagesResponse)
{
printf("---------------------__tev__PullMessage------------------------------\n");
#if 1
tev__PullMessagesResponse->CurrentTime=time(NULL);
tev__PullMessagesResponse->TerminationTime=tev__PullMessagesResponse->CurrentTime+60;
tev__PullMessagesResponse->__sizeNotificationMessage = 1;
tev__PullMessagesResponse->wsnt__NotificationMessage = (char *)soap_malloc(soap, sizeof(struct wsnt__NotificationMessageHolderType));
tev__PullMessagesResponse->wsnt__NotificationMessage->Message.tt__Message = (char *)soap_malloc(soap, sizeof(struct _tt__Message));
tev__PullMessagesResponse->wsnt__NotificationMessage->Message.tt__Message->UtcTime=time(NULL);
tev__PullMessagesResponse->wsnt__NotificationMessage->Message.tt__Message->Source=(char *)soap_malloc(soap, sizeof(struct tt__ItemList));
tev__PullMessagesResponse->wsnt__NotificationMessage->Message.tt__Message->Source->__sizeSimpleItem = 1;
tev__PullMessagesResponse->wsnt__NotificationMessage->Message.tt__Message->Source->SimpleItem = (char *)soap_malloc(soap, sizeof(struct _tt__ItemList_SimpleItem));
tev__PullMessagesResponse->wsnt__NotificationMessage->Message.tt__Message->Source->SimpleItem->Name=(char *)soap_malloc(soap, sizeof(char)*128);
strcpy(tev__PullMessagesResponse->wsnt__NotificationMessage->Message.tt__Message->Source->SimpleItem->Name,"VideoSourceConfigurationToken");
tev__PullMessagesResponse->wsnt__NotificationMessage->Message.tt__Message->Source->SimpleItem->Value=(char *)soap_malloc(soap, sizeof(char)*128);
strcpy(tev__PullMessagesResponse->wsnt__NotificationMessage->Message.tt__Message->Source->SimpleItem->Value,"1");
tev__PullMessagesResponse->wsnt__NotificationMessage->Message.tt__Message->Data=(char *)soap_malloc(soap, sizeof(struct tt__ItemList));
tev__PullMessagesResponse->wsnt__NotificationMessage->Message.tt__Message->Data->__sizeSimpleItem=1;
tev__PullMessagesResponse->wsnt__NotificationMessage->Message.tt__Message->Data->SimpleItem=(char *)soap_malloc(soap, sizeof(struct _tt__ItemList_SimpleItem));
tev__PullMessagesResponse->wsnt__NotificationMessage->Message.tt__Message->Data->SimpleItem->Name=(char *)soap_malloc(soap, sizeof(char)*128);
strcpy(tev__PullMessagesResponse->wsnt__NotificationMessage->Message.tt__Message->Data->SimpleItem->Name, "hello");
tev__PullMessagesResponse->wsnt__NotificationMessage->Message.tt__Message->Data->SimpleItem->Value=(char *)soap_malloc(soap, sizeof(char)*128);
strcpy(tev__PullMessagesResponse->wsnt__NotificationMessage->Message.tt__Message->Data->SimpleItem->Value, "world");
printf("end \n");
#endif
return 0;
}