You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
4.1 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 years ago
​
​
​
7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __ONVIF_CLIENT_DEVICE__
  2. #define __ONVIF_CLIENT_DEVICE__
  3. #include <string>
  4. #include <map>
  5. #include <iostream>
  6. #include <list>
  7. #include <ctime>
  8. #include "../onvifgen/soapStub.h"
  9. #include "../onvifgen/soapDeviceBindingProxy.h"
  10. #include "../gsoap/wsseapi.h"
  11. using namespace std;
  12. class ONVIFLIB_API OnvifClientDevice
  13. {
  14. public:
  15. OnvifClientDevice(string &strUrl, string &strUser, string &strPass);
  16. ~OnvifClientDevice();
  17. public:
  18. int GetCapabilities(_tds__GetCapabilitiesResponse &cap);
  19. int GetCapabilities();
  20. public:
  21. bool GetMediaUrl(string &strUrl);
  22. bool GetPTZUrl(string &strUrl);
  23. bool GetImagingUrl(string &strUrl);
  24. bool GetReceiverUrl(string &strUrl);
  25. bool GetRecordingUrl(string &strUrl);
  26. bool GetSearchUrl(string &strUrl);
  27. bool GetReplayUrl(string &strUrl);
  28. bool GetEventUrl(string &strUrl);
  29. //Device Service Functions
  30. int GetDeviceInformation(_tds__GetDeviceInformationResponse &DeviceInformationResponse);
  31. int GetSystemDateAndTime(_tds__GetSystemDateAndTimeResponse &SystemDateAndTimeResponse);
  32. int SetSystemDateAndTime(_tds__SetSystemDateAndTimeResponse &SetSystemDateAndTimeResponse, tt__SetDateTimeType &DateTimeType, bool DayLightSavings, tt__TimeZone &Timezone, tt__DateTime &UTCDateTime);
  33. int GetHostname(_tds__GetHostnameResponse &GetHostnameResponse);
  34. int SetHostname(_tds__SetHostnameResponse &SetHostnameResponse, string Name);
  35. int GetDNS(_tds__GetDNSResponse &GetDNSResponse);
  36. int SetDNS(_tds__SetDNSResponse &SetDNSResponse, bool FromDHCP, vector<string,allocator<string>> SearchDomain, vector<tt__IPAddress*,allocator<tt__IPAddress*>> &DNSManual);
  37. int GetNTP(_tds__GetNTPResponse &GetNTPResponse);
  38. int SetNTP(_tds__SetNTPResponse &SetNTPResponse, bool FromDHCP, vector<tt__NetworkHost*,allocator<tt__NetworkHost*>> &NTPManual);
  39. int GetDynamicDNS(_tds__GetDynamicDNSResponse &GetDynamicDNSResponse);
  40. int SetDynamicDNS(_tds__SetDynamicDNSResponse &SetDynamicDNSResponse,tt__DynamicDNSType &Type,tt__DNSName &Name, LONG64 &durationTTL);
  41. int GetNetworkInterfaces(_tds__GetNetworkInterfacesResponse &GetNetworkInterfacesResponse);
  42. int SetNetworkInterfaces(_tds__SetNetworkInterfacesResponse &SetNetworkInterfacesResponse,string InterfaceToken,tt__NetworkInterfaceSetConfiguration &NetworkInterface);
  43. int GetNetworkProtocols(_tds__GetNetworkProtocolsResponse &GetNetworkProtocolsResponse);
  44. int SetNetworkProtocols(_tds__SetNetworkProtocolsResponse &SetNetworkProtocolsResponse,vector<tt__NetworkProtocol*,allocator<tt__NetworkProtocol*>> &NetworkProtocols);
  45. int GetNetworkDefaultGateway(_tds__GetNetworkDefaultGatewayResponse &GetNetworkDefaultGatewayResponse);
  46. int SetNetworkDefaultGateway(_tds__SetNetworkDefaultGatewayResponse &SetNetworkDefaultGatewayResponse,vector<string,allocator<string>> &IPv4,vector<string,allocator<string>> &IPv6);
  47. int SystemReboot(_tds__SystemRebootResponse &SystemRebootResponse);
  48. int SynchronizeDateAndTimeWithCamera(string &strUrl,string &strUser,string &strPass,_tds__SetSystemDateAndTimeResponse &SetSystemDateAndTimeResponse);
  49. int SynchronizeDateAndTimeWithCamera(_tds__SetSystemDateAndTimeResponse &SetSystemDateAndTimeResponse);
  50. public:
  51. bool GetUserPasswd(string &strUser, string &strPass)
  52. {
  53. strUser = m_strUser;
  54. strPass = m_strPass;
  55. return true;
  56. }
  57. bool SetUrlUserPasswd(string &strUrl, string &strUser, string &strPass)
  58. {
  59. m_strUrl = strUrl;
  60. m_strUser = strUser;
  61. m_strPass = strPass;
  62. return true;
  63. }
  64. bool GetUrl(string &_strUrl)
  65. {
  66. _strUrl = m_strUrl;
  67. return true;
  68. }
  69. private:
  70. string m_strUrl;
  71. string m_strUser;
  72. string m_strPass;
  73. bool m_hasGetCap;
  74. /* If the Device support blow service */
  75. bool m_hasMedia;
  76. bool m_hasPTZ;
  77. bool m_hasImaging;
  78. bool m_hasReceiver;
  79. bool m_hasRecording;
  80. bool m_hasSearch;
  81. bool m_hasReplay;
  82. bool m_hasEvent;
  83. /* The Url of blow service */
  84. string m_strMedia;
  85. string m_strPTZ;
  86. string m_strImaging;
  87. string m_strReceiver;
  88. string m_strRecording;
  89. string m_strSearch;
  90. string m_strReplay;
  91. string m_strEvent;
  92. DeviceBindingProxy deviceBindProxy;
  93. double findDiffTime(struct tm local_sys,tt__DateTime cameraTime,bool isDST);
  94. int LocalAddUsernameTokenDigest(struct soap *soapOff,double cam_pc_offset);
  95. };
  96. #endif