doorcontrol.go 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420
  1. package doorcontrol
  2. import (
  3. "context"
  4. "encoding/xml"
  5. "time"
  6. "lc/common/onvif/soap"
  7. )
  8. // against "unused imports"
  9. var _ time.Time
  10. var _ xml.Name
  11. //
  12. // The physical state of a Door.
  13. //
  14. // DoorPhysicalState type
  15. type DoorPhysicalState string
  16. const (
  17. // Value is currently unknown (possibly due to initialization or monitors not
  18. // giving a conclusive result).
  19. //
  20. // DoorPhysicalStateUnknown const
  21. DoorPhysicalStateUnknown DoorPhysicalState = "Unknown"
  22. // Door is open.
  23. // DoorPhysicalStateOpen const
  24. DoorPhysicalStateOpen DoorPhysicalState = "Open"
  25. // Door is closed.
  26. // DoorPhysicalStateClosed const
  27. DoorPhysicalStateClosed DoorPhysicalState = "Closed"
  28. // Door monitor fault is detected.
  29. // DoorPhysicalStateFault const
  30. DoorPhysicalStateFault DoorPhysicalState = "Fault"
  31. )
  32. //
  33. // The physical state of a Lock (including Double Lock).
  34. //
  35. // LockPhysicalState type
  36. type LockPhysicalState string
  37. const (
  38. // Value is currently not known.
  39. // LockPhysicalStateUnknown const
  40. LockPhysicalStateUnknown LockPhysicalState = "Unknown"
  41. // Lock is activated.
  42. // LockPhysicalStateLocked const
  43. LockPhysicalStateLocked LockPhysicalState = "Locked"
  44. // Lock is not activated.
  45. // LockPhysicalStateUnlocked const
  46. LockPhysicalStateUnlocked LockPhysicalState = "Unlocked"
  47. // Lock fault is detected.
  48. // LockPhysicalStateFault const
  49. LockPhysicalStateFault LockPhysicalState = "Fault"
  50. )
  51. //
  52. // Describes the state of a Door with regard to alarms.
  53. //
  54. // DoorAlarmState type
  55. type DoorAlarmState string
  56. const (
  57. // No alarm.
  58. // DoorAlarmStateNormal const
  59. DoorAlarmStateNormal DoorAlarmState = "Normal"
  60. // Door is forced open.
  61. // DoorAlarmStateDoorForcedOpen const
  62. DoorAlarmStateDoorForcedOpen DoorAlarmState = "DoorForcedOpen"
  63. // Door is held open too long.
  64. // DoorAlarmStateDoorOpenTooLong const
  65. DoorAlarmStateDoorOpenTooLong DoorAlarmState = "DoorOpenTooLong"
  66. )
  67. //
  68. // Describes the state of a Tamper detector.
  69. //
  70. // DoorTamperState type
  71. type DoorTamperState string
  72. const (
  73. // Value is currently not known.
  74. // DoorTamperStateUnknown const
  75. DoorTamperStateUnknown DoorTamperState = "Unknown"
  76. // No tampering is detected.
  77. // DoorTamperStateNotInTamper const
  78. DoorTamperStateNotInTamper DoorTamperState = "NotInTamper"
  79. // Tampering is detected.
  80. // DoorTamperStateTamperDetected const
  81. DoorTamperStateTamperDetected DoorTamperState = "TamperDetected"
  82. )
  83. //
  84. // Describes the state of a Door fault.
  85. //
  86. // DoorFaultState type
  87. type DoorFaultState string
  88. const (
  89. // Fault state is unknown.
  90. // DoorFaultStateUnknown const
  91. DoorFaultStateUnknown DoorFaultState = "Unknown"
  92. // No fault is detected.
  93. // DoorFaultStateNotInFault const
  94. DoorFaultStateNotInFault DoorFaultState = "NotInFault"
  95. // Fault is detected.
  96. // DoorFaultStateFaultDetected const
  97. DoorFaultStateFaultDetected DoorFaultState = "FaultDetected"
  98. )
  99. //
  100. // The DoorMode describe the mode of operation from a logical perspective.
  101. // Setting a door mode reflects the intent to set a door in a physical state.
  102. //
  103. // DoorMode type
  104. type DoorMode string
  105. const (
  106. // The mode of operation is unknown.
  107. // DoorModeUnknown const
  108. DoorModeUnknown DoorMode = "Unknown"
  109. //
  110. // The intention is to set the door to a physical locked state.
  111. // In this mode the device shall provide momentary access using the AccessDoor
  112. // method if supported by the door instance.
  113. //
  114. // DoorModeLocked const
  115. DoorModeLocked DoorMode = "Locked"
  116. //
  117. // The intention is to set the door to a physical unlocked state.
  118. // Alarms related to door timing operations such as open too long
  119. // or forced open are masked in this mode.
  120. //
  121. // DoorModeUnlocked const
  122. DoorModeUnlocked DoorMode = "Unlocked"
  123. //
  124. // The intention is to momentary set the door to a physical unlocked state.
  125. // After a predefined time the device shall revert the door to its previous mode.
  126. // Alarms related to timing operations such as door forced open are masked in this mode.
  127. //
  128. // DoorModeAccessed const
  129. DoorModeAccessed DoorMode = "Accessed"
  130. //
  131. // The intention is to set the door to a physical locked state and the
  132. // device shall not allow AccessDoor requests, i.e. it is not possible
  133. // for the door to go to the accessed mode.
  134. // All other requests to change the door mode are allowed.
  135. //
  136. // DoorModeBlocked const
  137. DoorModeBlocked DoorMode = "Blocked"
  138. //
  139. // The intention is to set the door to a physical locked state and the device
  140. // shall only allow the LockDownReleaseDoor request.
  141. // All other requests to change the door mode are not allowed.
  142. //
  143. // DoorModeLockedDown const
  144. DoorModeLockedDown DoorMode = "LockedDown"
  145. //
  146. // The intention is to set the door to a physical unlocked state and the
  147. // device shall only allow the LockOpenReleaseDoor request.
  148. // All other requests to change the door mode are not allowed.
  149. //
  150. // DoorModeLockedOpen const
  151. DoorModeLockedOpen DoorMode = "LockedOpen"
  152. //
  153. // The intention is to set the door with multiple locks to a physical double locked state.
  154. // If the door does not support double locking the devices shall
  155. // treat this as a normal locked mode.
  156. // When changing to an unlocked mode from the double locked mode, the physical state
  157. // of the door may first go to locked state before unlocking.
  158. //
  159. // DoorModeDoubleLocked const
  160. DoorModeDoubleLocked DoorMode = "DoubleLocked"
  161. )
  162. // GetServiceCapabilities type
  163. type GetServiceCapabilities struct {
  164. XMLName xml.Name `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl GetServiceCapabilities"`
  165. }
  166. // GetServiceCapabilitiesResponse type
  167. type GetServiceCapabilitiesResponse struct {
  168. XMLName xml.Name `xml:"GetServiceCapabilitiesResponse"`
  169. // The capability response message contains the requested DoorControl
  170. // service capabilities using a hierarchical XML capability structure.
  171. //
  172. Capabilities ServiceCapabilities `xml:"Capabilities,omitempty"`
  173. }
  174. // GetDoorInfoList type
  175. type GetDoorInfoList struct {
  176. XMLName xml.Name `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl GetDoorInfoList"`
  177. // Maximum number of entries to return. If Limit is omitted or if the
  178. // value of Limit is higher than what the device supports, then the device shall
  179. // return its maximum amount of entries.
  180. //
  181. Limit int32 `xml:"http://www.onvif.org/ver10/schema Limit,omitempty"`
  182. // Start returning entries from this start reference. If not specified,
  183. // entries shall start from the beginning of the dataset.
  184. //
  185. StartReference string `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl StartReference,omitempty"`
  186. }
  187. // GetDoorInfoListResponse type
  188. type GetDoorInfoListResponse struct {
  189. XMLName xml.Name `xml:"GetDoorInfoListResponse"`
  190. // StartReference to use in next call to get the following items. If
  191. // absent, no more items to get.
  192. //
  193. NextStartReference string `xml:"NextStartReference,omitempty"`
  194. // List of DoorInfo items.
  195. DoorInfo []DoorInfo `xml:"DoorInfo,omitempty"`
  196. }
  197. // GetDoorInfo type
  198. type GetDoorInfo struct {
  199. XMLName xml.Name `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl GetDoorInfo"`
  200. // Tokens of DoorInfo items to get.
  201. Token []ReferenceToken `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Token,omitempty"`
  202. }
  203. // GetDoorInfoResponse type
  204. type GetDoorInfoResponse struct {
  205. XMLName xml.Name `xml:"GetDoorInfoResponse"`
  206. // List of DoorInfo items.
  207. DoorInfo []DoorInfo `xml:"DoorInfo,omitempty"`
  208. }
  209. // GetDoorList type
  210. type GetDoorList struct {
  211. XMLName xml.Name `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl GetDoorList"`
  212. // Maximum number of entries to return. If not specified, less than one
  213. // or higher than what the device supports, the number of items is determined by the
  214. // device.
  215. //
  216. Limit int32 `xml:"http://www.onvif.org/ver10/schema Limit,omitempty"`
  217. // Start returning entries from this start reference. If not specified,
  218. // entries shall start from the beginning of the dataset.
  219. //
  220. StartReference string `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl StartReference,omitempty"`
  221. }
  222. // GetDoorListResponse type
  223. type GetDoorListResponse struct {
  224. XMLName xml.Name `xml:"GetDoorListResponse"`
  225. // StartReference to use in next call to get the following items. If
  226. // absent, no more items to get.
  227. //
  228. NextStartReference string `xml:"NextStartReference,omitempty"`
  229. // List of Door items.
  230. Door []Door `xml:"Door,omitempty"`
  231. }
  232. // GetDoors type
  233. type GetDoors struct {
  234. XMLName xml.Name `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl GetDoors"`
  235. // Tokens of Door items to get.
  236. Token []ReferenceToken `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Token,omitempty"`
  237. }
  238. // GetDoorsResponse type
  239. type GetDoorsResponse struct {
  240. XMLName xml.Name `xml:"GetDoorsResponse"`
  241. // List of Door items.
  242. Door []Door `xml:"Door,omitempty"`
  243. }
  244. // CreateDoor type
  245. type CreateDoor struct {
  246. XMLName xml.Name `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl CreateDoor"`
  247. // Door item to create
  248. Door Door `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Door,omitempty"`
  249. }
  250. // CreateDoorResponse type
  251. type CreateDoorResponse struct {
  252. XMLName xml.Name `xml:"CreateDoorResponse"`
  253. // Token of created Door item
  254. Token ReferenceToken `xml:"Token,omitempty"`
  255. }
  256. // SetDoor type
  257. type SetDoor struct {
  258. XMLName xml.Name `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl SetDoor"`
  259. // The Door item to create or modify
  260. Door Door `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Door,omitempty"`
  261. }
  262. // SetDoorResponse type
  263. type SetDoorResponse struct {
  264. XMLName xml.Name `xml:"SetDoorResponse"`
  265. }
  266. // ModifyDoor type
  267. type ModifyDoor struct {
  268. XMLName xml.Name `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl ModifyDoor"`
  269. // The details of the door
  270. Door Door `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Door,omitempty"`
  271. }
  272. // ModifyDoorResponse type
  273. type ModifyDoorResponse struct {
  274. XMLName xml.Name `xml:"ModifyDoorResponse"`
  275. }
  276. // DeleteDoor type
  277. type DeleteDoor struct {
  278. XMLName xml.Name `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl DeleteDoor"`
  279. // The Token of the door to delete.
  280. Token ReferenceToken `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Token,omitempty"`
  281. }
  282. // DeleteDoorResponse type
  283. type DeleteDoorResponse struct {
  284. XMLName xml.Name `xml:"DeleteDoorResponse"`
  285. }
  286. // GetDoorState type
  287. type GetDoorState struct {
  288. XMLName xml.Name `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl GetDoorState"`
  289. // Token of the Door instance to get the state for.
  290. Token ReferenceToken `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Token,omitempty"`
  291. }
  292. // GetDoorStateResponse type
  293. type GetDoorStateResponse struct {
  294. XMLName xml.Name `xml:"GetDoorStateResponse"`
  295. // The state of the door.
  296. DoorState DoorState `xml:"DoorState,omitempty"`
  297. }
  298. // AccessDoor type
  299. type AccessDoor struct {
  300. XMLName xml.Name `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl AccessDoor"`
  301. // Token of the Door instance to control.
  302. Token ReferenceToken `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Token,omitempty"`
  303. // Optional - Indicates that the configured extended time should be
  304. // used.
  305. //
  306. UseExtendedTime bool `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl UseExtendedTime,omitempty"`
  307. // Optional - overrides ReleaseTime if specified.
  308. AccessTime Duration `xml:"http://www.onvif.org/ver10/schema AccessTime,omitempty"`
  309. // Optional - overrides OpenTime if specified.
  310. //
  311. OpenTooLongTime Duration `xml:"http://www.onvif.org/ver10/schema OpenTooLongTime,omitempty"`
  312. // Optional - overrides PreAlarmTime if specified.
  313. PreAlarmTime Duration `xml:"http://www.onvif.org/ver10/schema PreAlarmTime,omitempty"`
  314. // Future extension.
  315. Extension AccessDoorExtension `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Extension,omitempty"`
  316. }
  317. // AccessDoorResponse type
  318. type AccessDoorResponse struct {
  319. XMLName xml.Name `xml:"AccessDoorResponse"`
  320. }
  321. // LockDoor type
  322. type LockDoor struct {
  323. XMLName xml.Name `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl LockDoor"`
  324. // Token of the Door instance to control.
  325. Token ReferenceToken `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Token,omitempty"`
  326. }
  327. // LockDoorResponse type
  328. type LockDoorResponse struct {
  329. XMLName xml.Name `xml:"LockDoorResponse"`
  330. }
  331. // UnlockDoor type
  332. type UnlockDoor struct {
  333. XMLName xml.Name `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl UnlockDoor"`
  334. // Token of the Door instance to control.
  335. Token ReferenceToken `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Token,omitempty"`
  336. }
  337. // UnlockDoorResponse type
  338. type UnlockDoorResponse struct {
  339. XMLName xml.Name `xml:"UnlockDoorResponse"`
  340. }
  341. // BlockDoor type
  342. type BlockDoor struct {
  343. XMLName xml.Name `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl BlockDoor"`
  344. // Token of the Door instance to control.
  345. Token ReferenceToken `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Token,omitempty"`
  346. }
  347. // BlockDoorResponse type
  348. type BlockDoorResponse struct {
  349. XMLName xml.Name `xml:"BlockDoorResponse"`
  350. }
  351. // LockDownDoor type
  352. type LockDownDoor struct {
  353. XMLName xml.Name `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl LockDownDoor"`
  354. // Token of the Door instance to control.
  355. Token ReferenceToken `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Token,omitempty"`
  356. }
  357. // LockDownDoorResponse type
  358. type LockDownDoorResponse struct {
  359. XMLName xml.Name `xml:"LockDownDoorResponse"`
  360. }
  361. // LockDownReleaseDoor type
  362. type LockDownReleaseDoor struct {
  363. XMLName xml.Name `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl LockDownReleaseDoor"`
  364. // Token of the Door instance to control.
  365. Token ReferenceToken `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Token,omitempty"`
  366. }
  367. // LockDownReleaseDoorResponse type
  368. type LockDownReleaseDoorResponse struct {
  369. XMLName xml.Name `xml:"LockDownReleaseDoorResponse"`
  370. }
  371. // LockOpenDoor type
  372. type LockOpenDoor struct {
  373. XMLName xml.Name `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl LockOpenDoor"`
  374. // Token of the Door instance to control.
  375. Token ReferenceToken `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Token,omitempty"`
  376. }
  377. // LockOpenDoorResponse type
  378. type LockOpenDoorResponse struct {
  379. XMLName xml.Name `xml:"LockOpenDoorResponse"`
  380. }
  381. // LockOpenReleaseDoor type
  382. type LockOpenReleaseDoor struct {
  383. XMLName xml.Name `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl LockOpenReleaseDoor"`
  384. // Token of the Door instance to control.
  385. Token ReferenceToken `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Token,omitempty"`
  386. }
  387. // LockOpenReleaseDoorResponse type
  388. type LockOpenReleaseDoorResponse struct {
  389. XMLName xml.Name `xml:"LockOpenReleaseDoorResponse"`
  390. }
  391. // DoubleLockDoor type
  392. type DoubleLockDoor struct {
  393. XMLName xml.Name `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl DoubleLockDoor"`
  394. // Token of the Door instance to control.
  395. Token ReferenceToken `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Token,omitempty"`
  396. }
  397. // DoubleLockDoorResponse type
  398. type DoubleLockDoorResponse struct {
  399. XMLName xml.Name `xml:"DoubleLockDoorResponse"`
  400. }
  401. // ServiceCapabilities type
  402. type ServiceCapabilities struct {
  403. XMLName xml.Name `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Capabilities"`
  404. //
  405. // The maximum number of entries returned by a single Get<Entity>List or
  406. // Get<Entity> request. The device shall never return more than this number of entities
  407. // in a single response.
  408. //
  409. MaxLimit uint32 `xml:"http://www.onvif.org/ver10/schema MaxLimit,attr,omitempty"`
  410. //
  411. // Indicates the maximum number of doors supported by the device.
  412. //
  413. MaxDoors uint32 `xml:"http://www.onvif.org/ver10/schema MaxDoors,attr,omitempty"`
  414. //
  415. // Indicates that the client is allowed to supply the token when creating doors.
  416. // To enable the use of the command SetDoor, the value must be set to true.
  417. //
  418. ClientSuppliedTokenSupported bool `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl ClientSuppliedTokenSupported,attr,omitempty"`
  419. }
  420. // DoorInfoBase type
  421. type DoorInfoBase struct {
  422. *DataEntity
  423. // A user readable name. It shall be up to 64 characters.
  424. //
  425. Name Name `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Name,omitempty"`
  426. // A user readable description. It shall be up to 1024 characters.
  427. //
  428. Description Description `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Description,omitempty"`
  429. }
  430. // DoorInfo type
  431. type DoorInfo struct {
  432. *DoorInfoBase
  433. // The capabilities of the Door.
  434. Capabilities DoorCapabilities `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Capabilities,omitempty"`
  435. }
  436. // Door type
  437. type Door struct {
  438. *DoorInfo
  439. //
  440. // The type of door. Is of type text. Can be either one of the following reserved
  441. // ONVIF types: "pt:Door", "pt:ManTrap", "pt:Turnstile", "pt:RevolvingDoor",
  442. // "pt:Barrier", or a custom defined type.
  443. //
  444. DoorType Name `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl DoorType,omitempty"`
  445. //
  446. // A structure defining times such as how long the door is unlocked when
  447. // accessed, extended grant time, etc.
  448. //
  449. Timings Timings `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Timings,omitempty"`
  450. Extension DoorExtension `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Extension,omitempty"`
  451. }
  452. // DoorExtension type
  453. type DoorExtension struct {
  454. }
  455. // Timings type
  456. type Timings struct {
  457. //
  458. // When access is granted (door mode becomes Accessed), the latch is unlocked.
  459. // ReleaseTime is the time from when the latch is unlocked until it is
  460. // relocked again (unless the door is physically opened).
  461. //
  462. ReleaseTime Duration `xml:"http://www.onvif.org/ver10/schema ReleaseTime,omitempty"`
  463. //
  464. // The time from when the door is physically opened until the door is set in the
  465. // DoorOpenTooLong alarm state.
  466. //
  467. OpenTime Duration `xml:"http://www.onvif.org/ver10/schema OpenTime,omitempty"`
  468. //
  469. // Some individuals need extra time to open the door before the latch relocks.
  470. // If supported, ExtendedReleaseTime shall be added to ReleaseTime if UseExtendedTime
  471. // is set to true in the AccessDoor command.
  472. //
  473. ExtendedReleaseTime Duration `xml:"http://www.onvif.org/ver10/schema ExtendedReleaseTime,omitempty"`
  474. //
  475. // If the door is physically opened after access is granted,
  476. // then DelayTimeBeforeRelock is the time from when the door is physically
  477. // opened until the latch goes back to locked state.
  478. //
  479. DelayTimeBeforeRelock Duration `xml:"http://www.onvif.org/ver10/schema DelayTimeBeforeRelock,omitempty"`
  480. //
  481. // Some individuals need extra time to pass through the door. If supported,
  482. // ExtendedOpenTime shall be added to OpenTime if UseExtendedTime is set to true
  483. // in the AccessDoor command.
  484. //
  485. ExtendedOpenTime Duration `xml:"http://www.onvif.org/ver10/schema ExtendedOpenTime,omitempty"`
  486. //
  487. // Before a DoorOpenTooLong alarm state is generated, a signal will sound to indicate
  488. // that the door must be closed. PreAlarmTime defines how long before DoorOpenTooLong
  489. // the warning signal shall sound.
  490. //
  491. PreAlarmTime Duration `xml:"http://www.onvif.org/ver10/schema PreAlarmTime,omitempty"`
  492. Extension TimingsExtension `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Extension,omitempty"`
  493. }
  494. // TimingsExtension type
  495. type TimingsExtension struct {
  496. }
  497. // DoorCapabilities type
  498. type DoorCapabilities struct {
  499. // Indicates whether or not this Door instance supports AccessDoor command to
  500. // perform momentary access.
  501. //
  502. Access bool `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Access,attr,omitempty"`
  503. // Indicates that this Door instance supports overriding configured timing in the
  504. // AccessDoor command.
  505. //
  506. AccessTimingOverride bool `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl AccessTimingOverride,attr,omitempty"`
  507. // Indicates that this Door instance supports LockDoor command to lock the
  508. // door.
  509. //
  510. Lock bool `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Lock,attr,omitempty"`
  511. // Indicates that this Door instance supports UnlockDoor command to unlock the
  512. // door.
  513. //
  514. Unlock bool `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Unlock,attr,omitempty"`
  515. // Indicates that this Door instance supports BlockDoor command to block the
  516. // door.
  517. //
  518. Block bool `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Block,attr,omitempty"`
  519. // Indicates that this Door instance supports DoubleLockDoor command to lock
  520. // multiple locks on the door.
  521. //
  522. DoubleLock bool `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl DoubleLock,attr,omitempty"`
  523. // Indicates that this Door instance supports LockDown (and LockDownRelease)
  524. // commands to lock the door and put it in LockedDown mode.
  525. //
  526. LockDown bool `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl LockDown,attr,omitempty"`
  527. // Indicates that this Door instance supports LockOpen (and LockOpenRelease)
  528. // commands to unlock the door and put it in LockedOpen mode.
  529. //
  530. LockOpen bool `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl LockOpen,attr,omitempty"`
  531. // Indicates that this Door instance has a DoorMonitor and supports the
  532. // DoorPhysicalState event.
  533. //
  534. DoorMonitor bool `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl DoorMonitor,attr,omitempty"`
  535. // Indicates that this Door instance has a LockMonitor and supports the
  536. // LockPhysicalState event.
  537. //
  538. LockMonitor bool `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl LockMonitor,attr,omitempty"`
  539. // Indicates that this Door instance has a DoubleLockMonitor and supports the
  540. // DoubleLockPhysicalState event.
  541. //
  542. DoubleLockMonitor bool `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl DoubleLockMonitor,attr,omitempty"`
  543. // Indicates that this Door instance supports door alarm and the DoorAlarm
  544. // event.
  545. //
  546. Alarm bool `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Alarm,attr,omitempty"`
  547. // Indicates that this Door instance has a Tamper detector and supports the
  548. // DoorTamper event.
  549. //
  550. Tamper bool `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Tamper,attr,omitempty"`
  551. // Indicates that this Door instance supports door fault and the DoorFault
  552. // event.
  553. //
  554. Fault bool `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Fault,attr,omitempty"`
  555. }
  556. // DoorState type
  557. type DoorState struct {
  558. //
  559. // Physical state of the Door; it is of type DoorPhysicalState. A device that
  560. // signals support for DoorMonitor capability for a particular door instance shall provide
  561. // this field.
  562. //
  563. DoorPhysicalState DoorPhysicalState `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl DoorPhysicalState,omitempty"`
  564. //
  565. // Physical state of the Lock; it is of type LockPhysicalState. A device that
  566. // signals support for LockMonitor capability for a particular door instance shall provide
  567. // this field.
  568. //
  569. LockPhysicalState LockPhysicalState `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl LockPhysicalState,omitempty"`
  570. //
  571. // Physical state of the DoubleLock; it is of type LockPhysicalState. A
  572. // device that signals support for DoubleLockMonitor capability for a particular door
  573. // instance shall provide this field.
  574. //
  575. DoubleLockPhysicalState LockPhysicalState `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl DoubleLockPhysicalState,omitempty"`
  576. //
  577. // Alarm state of the door; it is of type DoorAlarmState. A device that
  578. // signals support for Alarm capability for a particular door instance shall provide this
  579. // field.
  580. //
  581. Alarm DoorAlarmState `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Alarm,omitempty"`
  582. //
  583. // Tampering state of the door; it is of type DoorTamper. A device that
  584. // signals support for Tamper capability for a particular door instance shall provide this
  585. // field.
  586. //
  587. Tamper DoorTamper `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Tamper,omitempty"`
  588. //
  589. // Fault information for door; it is of type DoorFault. A device that signals
  590. // support for Fault capability for a particular door instance shall provide this field.
  591. //
  592. Fault DoorFault `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Fault,omitempty"`
  593. //
  594. // The logical operating mode of the door; it is of type DoorMode. An ONVIF
  595. // compatible device shall report current operating mode in this field.
  596. //
  597. DoorMode DoorMode `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl DoorMode,omitempty"`
  598. }
  599. // DoorTamper type
  600. type DoorTamper struct {
  601. // Optional field; Details describing tampering state change (e.g., reason,
  602. // place and time).
  603. // NOTE: All fields (including this one) which are designed to give
  604. // end-user prompts can be localized to the customer's native language.
  605. //
  606. Reason string `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Reason,omitempty"`
  607. // State of the tamper detector; it is of type DoorTamperState.
  608. //
  609. State DoorTamperState `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl State,omitempty"`
  610. }
  611. // DoorFault type
  612. type DoorFault struct {
  613. // Optional reason for fault.
  614. Reason string `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl Reason,omitempty"`
  615. // Overall fault state for the door; it is of type DoorFaultState. If there
  616. // are any faults, the value shall be: FaultDetected. Details of the detected fault shall
  617. // be found in the Reason field, and/or the various DoorState fields and/or in extensions
  618. // to this structure.
  619. //
  620. State DoorFaultState `xml:"http://www.onvif.org/ver10/doorcontrol/wsdl State,omitempty"`
  621. }
  622. // AccessDoorExtension type
  623. type AccessDoorExtension struct {
  624. }
  625. // Type used to reference logical and physical entities.
  626. // ReferenceToken type
  627. type ReferenceToken string
  628. // Type used for names of logical and physical entities.
  629. // Name type
  630. type Name string
  631. // Description is optional and the maximum length is device specific.
  632. // If the length is more than maximum length, it is silently chopped to the maximum length
  633. // supported by the device/service (which may be 0).
  634. //
  635. // Description type
  636. type Description string
  637. // Type used to represent the numbers from 1 ,2 , 3,...
  638. // DataEntity type
  639. type DataEntity struct {
  640. // A service-unique identifier of the item.
  641. Token ReferenceToken `xml:"token,attr,omitempty"`
  642. }
  643. // DoorControlPort type
  644. type DoorControlPort interface {
  645. /*
  646. This operation returns the capabilities of the service.
  647. An ONVIF compliant device which provides the Door Control service shall implement this method.
  648. */
  649. GetServiceCapabilities(request *GetServiceCapabilities) (*GetServiceCapabilitiesResponse, error)
  650. GetServiceCapabilitiesContext(ctx context.Context, request *GetServiceCapabilities) (*GetServiceCapabilitiesResponse, error)
  651. /*
  652. This operation requests a list of all DoorInfo items provided by the device.
  653. An ONVIF compliant device that provides Door Control service shall implement
  654. this method.
  655. A call to this method shall return a StartReference when not all data is returned and more data is
  656. available.
  657. The reference shall be valid for retrieving the next set of data.
  658. The number of items returned shall not be greater than Limit parameter.
  659. */
  660. GetDoorInfoList(request *GetDoorInfoList) (*GetDoorInfoListResponse, error)
  661. GetDoorInfoListContext(ctx context.Context, request *GetDoorInfoList) (*GetDoorInfoListResponse, error)
  662. /*
  663. This operation requests a list of DoorInfo items matching the given tokens.
  664. An ONVIF-compliant device that provides Door Control service shall implement this method.
  665. The device shall ignore tokens it cannot resolve and shall return an empty list
  666. if there are no items matching specified tokens.
  667. If the number of requested items is greater than MaxLimit, a TooManyItems fault shall be returned.
  668. */
  669. GetDoorInfo(request *GetDoorInfo) (*GetDoorInfoResponse, error)
  670. GetDoorInfoContext(ctx context.Context, request *GetDoorInfo) (*GetDoorInfoResponse, error)
  671. /*
  672. This operation requests a list of all Door items provided by the device.
  673. A call to this method shall return a StartReference when not all data is returned and more data is
  674. available. The reference shall be valid for retrieving the next set of data.
  675. Please refer to section 4.8.3 in [Access Control Service Specification] for more details.
  676. The number of items returned shall not be greater than the Limit parameter.
  677. */
  678. GetDoorList(request *GetDoorList) (*GetDoorListResponse, error)
  679. GetDoorListContext(ctx context.Context, request *GetDoorList) (*GetDoorListResponse, error)
  680. /*
  681. This operation requests a list of Door items matching the given tokens.
  682. The device shall ignore tokens it cannot resolve and shall return an empty list if there are no items
  683. matching specified tokens. The device shall not return a fault in this case.
  684. If the number of requested items is greater than MaxLimit, a TooManyItems fault shall be returned.
  685. */
  686. GetDoors(request *GetDoors) (*GetDoorsResponse, error)
  687. GetDoorsContext(ctx context.Context, request *GetDoors) (*GetDoorsResponse, error)
  688. /*
  689. This operation creates the specified door in the device.
  690. The token field of the Door structure shall be empty and the device shall allocate a token for
  691. the door. The allocated token shall be returned in the response.
  692. If the client sends any value in the token field, the device shall return
  693. InvalidArgVal as a generic fault code.
  694. */
  695. CreateDoor(request *CreateDoor) (*CreateDoorResponse, error)
  696. CreateDoorContext(ctx context.Context, request *CreateDoor) (*CreateDoorResponse, error)
  697. /*
  698. This method is used to synchronize a door in a client with the device.
  699. If a door with the specified token does not exist in the device, the door is created.
  700. If a door with the specified token exists, then the door is modified.
  701. A call to this method takes a door structure as input parameter. The token field of the Door
  702. structure shall not be empty.
  703. A device that signals support for the ClientSuppliedTokenSupported capability shall
  704. implement this command.
  705. If no token was specified in the request, the device shall return InvalidArgs as a generic fault code.
  706. */
  707. SetDoor(request *SetDoor) (*SetDoorResponse, error)
  708. SetDoorContext(ctx context.Context, request *SetDoor) (*SetDoorResponse, error)
  709. /*
  710. This operation modifies the specified door.
  711. The token of the door to modify is specified in the token field of the Door structure and shall
  712. not be empty. All other fields in the structure shall overwrite the fields in the specified door.
  713. If no token was specified in the request, the device shall return InvalidArgs as a generic fault code.
  714. */
  715. ModifyDoor(request *ModifyDoor) (*ModifyDoorResponse, error)
  716. ModifyDoorContext(ctx context.Context, request *ModifyDoor) (*ModifyDoorResponse, error)
  717. /*
  718. This operation deletes the specified door.
  719. If it is associated with one or more entities some devices may not be able to delete the door,
  720. and consequently a ReferenceInUse fault shall be generated.
  721. If no token was specified in the request, the device shall return InvalidArgs as a generic fault code.
  722. */
  723. DeleteDoor(request *DeleteDoor) (*DeleteDoorResponse, error)
  724. DeleteDoorContext(ctx context.Context, request *DeleteDoor) (*DeleteDoorResponse, error)
  725. /*
  726. This operation requests the state of a Door specified by the Token.
  727. A device implementing the Door Control service shall be capable of reporting
  728. the status of a door using a DoorState structure available from the
  729. GetDoorState command.
  730. */
  731. GetDoorState(request *GetDoorState) (*GetDoorStateResponse, error)
  732. GetDoorStateContext(ctx context.Context, request *GetDoorState) (*GetDoorStateResponse, error)
  733. /*
  734. This operation allows momentarily accessing a Door.
  735. It invokes the functionality typically used when a card holder presents a
  736. card to a card reader at the door and is granted access.
  737. The DoorMode shall change to Accessed state. Please refer to Accessed mode in section [DoorMode] for
  738. more details.
  739. The Door shall remain accessible for the defined time. When the time span
  740. elapses, the DoorMode shall change back to its previous state.
  741. If the request cannot be fulfilled, a Failure fault shall be returned.
  742. Please refer to section [DoorMode] for details about Door Modes restrictions.
  743. A device that signals support for Access capability for a particular Door
  744. instance shall implement this method. A device that signals support for
  745. AccessTimingOverride capability for a particular Door instance shall also
  746. provide optional timing parameters (AccessTime, OpenTooLongTime and
  747. PreAlarmTime) when performing AccessDoor command.
  748. The device shall take the best effort approach for parameters not supported,
  749. it must fallback to preconfigured time or limit the time to the closest
  750. supported time if the specified time is out of range.
  751. */
  752. AccessDoor(request *AccessDoor) (*AccessDoorResponse, error)
  753. AccessDoorContext(ctx context.Context, request *AccessDoor) (*AccessDoorResponse, error)
  754. /*
  755. This operation allows locking a Door.
  756. The DoorMode shall change to Locked state.
  757. Please refer to Locked mode in section [DoorMode] for more details.
  758. A device that signals support for Lock capability for a particular Door
  759. instance shall implement this method.
  760. If the request cannot be fulfilled, a Failure fault shall be returned.
  761. Please refer to section [DoorMode] for more details about Door Modes restrictions.
  762. */
  763. LockDoor(request *LockDoor) (*LockDoorResponse, error)
  764. LockDoorContext(ctx context.Context, request *LockDoor) (*LockDoorResponse, error)
  765. /*
  766. This operation allows unlocking a Door.
  767. The DoorMode shall change to Unlocked state.
  768. Please refer to Unlocked mode in section [DoorMode] for more details.
  769. A device that signals support for Unlock capability for a particular Door
  770. instance shall implement this method.
  771. If the request cannot be fulfilled, a Failure fault shall be returned.
  772. Please refer to section [DoorMode] for more details about Door Modes restrictions.
  773. */
  774. UnlockDoor(request *UnlockDoor) (*UnlockDoorResponse, error)
  775. UnlockDoorContext(ctx context.Context, request *UnlockDoor) (*UnlockDoorResponse, error)
  776. /*
  777. This operation allows blocking a Door and preventing momentary access (AccessDoor command).
  778. The DoorMode shall change to Blocked state.
  779. Please refer to Blocked mode in section [DoorMode] for more details.
  780. A device that signals support for Block capability for a particular Door
  781. instance shall implement this method.
  782. If the request cannot be fulfilled, a Failure fault shall be returned.
  783. Please refer to section [DoorMode] for more details about Door Modes restrictions.
  784. */
  785. BlockDoor(request *BlockDoor) (*BlockDoorResponse, error)
  786. BlockDoorContext(ctx context.Context, request *BlockDoor) (*BlockDoorResponse, error)
  787. /*
  788. This operation allows locking and preventing other actions until a LockDownRelease command is invoked.
  789. The DoorMode shall change to LockedDown state.
  790. Please refer to LockedDown mode in section [DoorMode] for more details.
  791. The device shall ignore other door control commands until a LockDownRelease command is performed.
  792. A device that signals support for LockDown capability for a particular Door
  793. instance shall implement this method.
  794. If a device supports DoubleLock capability for a particular Door instance,
  795. that operation may be engaged as well.
  796. If the request cannot be fulfilled, a Failure fault shall be returned.
  797. Please refer to section [DoorMode] for more details about Door Modes restrictions.
  798. */
  799. LockDownDoor(request *LockDownDoor) (*LockDownDoorResponse, error)
  800. LockDownDoorContext(ctx context.Context, request *LockDownDoor) (*LockDownDoorResponse, error)
  801. /*
  802. This operation allows releasing the LockedDown state of a Door.
  803. The DoorMode shall change back to its previous/next state.
  804. It is not defined what the previous/next state shall be, but typically - Locked.
  805. This method shall only succeed if the current DoorMode is LockedDown.
  806. */
  807. LockDownReleaseDoor(request *LockDownReleaseDoor) (*LockDownReleaseDoorResponse, error)
  808. LockDownReleaseDoorContext(ctx context.Context, request *LockDownReleaseDoor) (*LockDownReleaseDoorResponse, error)
  809. /*
  810. This operation allows unlocking a Door and preventing other actions until LockOpenRelease method is
  811. invoked.
  812. The DoorMode shall change to LockedOpen state.
  813. Please refer to LockedOpen mode in section [DoorMode] for more details.
  814. The device shall ignore other door control commands until a LockOpenRelease command is performed.
  815. A device that signals support for LockOpen capability for a particular Door instance shall implement
  816. this method.
  817. If the request cannot be fulfilled, a Failure fault shall be returned.
  818. Please refer to section [DoorMode] for more details about Door Modes restrictions.
  819. */
  820. LockOpenDoor(request *LockOpenDoor) (*LockOpenDoorResponse, error)
  821. LockOpenDoorContext(ctx context.Context, request *LockOpenDoor) (*LockOpenDoorResponse, error)
  822. /*
  823. This operation allows releasing the LockedOpen state of a Door.
  824. The DoorMode shall change state from the LockedOpen state back to its previous/next state.
  825. It is not defined what the previous/next state shall be, but typically - Unlocked.
  826. A device that signals support for LockOpen capability for a particular Door instance shall support
  827. this command.
  828. This method shall only succeed if the current DoorMode is LockedOpen.
  829. */
  830. LockOpenReleaseDoor(request *LockOpenReleaseDoor) (*LockOpenReleaseDoorResponse, error)
  831. LockOpenReleaseDoorContext(ctx context.Context, request *LockOpenReleaseDoor) (*LockOpenReleaseDoorResponse, error)
  832. /*
  833. This operation is used for securely locking a Door.
  834. A call to this method shall change DoorMode state to DoubleLocked.
  835. Please refer to DoubleLocked mode in section [DoorMode] for more details.
  836. A device that signals support for DoubleLock capability for a particular
  837. Door instance shall implement this method. Otherwise this method can be
  838. performed as a standard Lock operation (see [LockDoor command]).
  839. If the door has an extra lock that shall be locked as well.
  840. If the request cannot be fulfilled, a Failure fault shall be returned.
  841. */
  842. DoubleLockDoor(request *DoubleLockDoor) (*DoubleLockDoorResponse, error)
  843. DoubleLockDoorContext(ctx context.Context, request *DoubleLockDoor) (*DoubleLockDoorResponse, error)
  844. }
  845. // doorControlPort type
  846. type doorControlPort struct {
  847. client *soap.Client
  848. xaddr string
  849. }
  850. func NewDoorControlPort(client *soap.Client, xaddr string) DoorControlPort {
  851. return &doorControlPort{
  852. client: client,
  853. xaddr: xaddr,
  854. }
  855. }
  856. func (service *doorControlPort) GetServiceCapabilitiesContext(ctx context.Context, request *GetServiceCapabilities) (*GetServiceCapabilitiesResponse, error) {
  857. response := new(GetServiceCapabilitiesResponse)
  858. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/doorcontrol/wsdl/GetServiceCapabilities", request, response)
  859. if err != nil {
  860. return nil, err
  861. }
  862. return response, nil
  863. }
  864. func (service *doorControlPort) GetServiceCapabilities(request *GetServiceCapabilities) (*GetServiceCapabilitiesResponse, error) {
  865. return service.GetServiceCapabilitiesContext(
  866. context.Background(),
  867. request,
  868. )
  869. }
  870. func (service *doorControlPort) GetDoorInfoListContext(ctx context.Context, request *GetDoorInfoList) (*GetDoorInfoListResponse, error) {
  871. response := new(GetDoorInfoListResponse)
  872. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/doorcontrol/wsdl/GetDoorInfoList", request, response)
  873. if err != nil {
  874. return nil, err
  875. }
  876. return response, nil
  877. }
  878. func (service *doorControlPort) GetDoorInfoList(request *GetDoorInfoList) (*GetDoorInfoListResponse, error) {
  879. return service.GetDoorInfoListContext(
  880. context.Background(),
  881. request,
  882. )
  883. }
  884. func (service *doorControlPort) GetDoorInfoContext(ctx context.Context, request *GetDoorInfo) (*GetDoorInfoResponse, error) {
  885. response := new(GetDoorInfoResponse)
  886. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/doorcontrol/wsdl/GetDoorInfo", request, response)
  887. if err != nil {
  888. return nil, err
  889. }
  890. return response, nil
  891. }
  892. func (service *doorControlPort) GetDoorInfo(request *GetDoorInfo) (*GetDoorInfoResponse, error) {
  893. return service.GetDoorInfoContext(
  894. context.Background(),
  895. request,
  896. )
  897. }
  898. func (service *doorControlPort) GetDoorListContext(ctx context.Context, request *GetDoorList) (*GetDoorListResponse, error) {
  899. response := new(GetDoorListResponse)
  900. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/doorcontrol/wsdl/GetDoorList", request, response)
  901. if err != nil {
  902. return nil, err
  903. }
  904. return response, nil
  905. }
  906. func (service *doorControlPort) GetDoorList(request *GetDoorList) (*GetDoorListResponse, error) {
  907. return service.GetDoorListContext(
  908. context.Background(),
  909. request,
  910. )
  911. }
  912. func (service *doorControlPort) GetDoorsContext(ctx context.Context, request *GetDoors) (*GetDoorsResponse, error) {
  913. response := new(GetDoorsResponse)
  914. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/doorcontrol/wsdl/GetDoors", request, response)
  915. if err != nil {
  916. return nil, err
  917. }
  918. return response, nil
  919. }
  920. func (service *doorControlPort) GetDoors(request *GetDoors) (*GetDoorsResponse, error) {
  921. return service.GetDoorsContext(
  922. context.Background(),
  923. request,
  924. )
  925. }
  926. func (service *doorControlPort) CreateDoorContext(ctx context.Context, request *CreateDoor) (*CreateDoorResponse, error) {
  927. response := new(CreateDoorResponse)
  928. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/doorcontrol/wsdl/CreateDoor", request, response)
  929. if err != nil {
  930. return nil, err
  931. }
  932. return response, nil
  933. }
  934. func (service *doorControlPort) CreateDoor(request *CreateDoor) (*CreateDoorResponse, error) {
  935. return service.CreateDoorContext(
  936. context.Background(),
  937. request,
  938. )
  939. }
  940. func (service *doorControlPort) SetDoorContext(ctx context.Context, request *SetDoor) (*SetDoorResponse, error) {
  941. response := new(SetDoorResponse)
  942. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/doorcontrol/wsdl/SetDoor", request, response)
  943. if err != nil {
  944. return nil, err
  945. }
  946. return response, nil
  947. }
  948. func (service *doorControlPort) SetDoor(request *SetDoor) (*SetDoorResponse, error) {
  949. return service.SetDoorContext(
  950. context.Background(),
  951. request,
  952. )
  953. }
  954. func (service *doorControlPort) ModifyDoorContext(ctx context.Context, request *ModifyDoor) (*ModifyDoorResponse, error) {
  955. response := new(ModifyDoorResponse)
  956. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/doorcontrol/wsdl/ModifyDoor", request, response)
  957. if err != nil {
  958. return nil, err
  959. }
  960. return response, nil
  961. }
  962. func (service *doorControlPort) ModifyDoor(request *ModifyDoor) (*ModifyDoorResponse, error) {
  963. return service.ModifyDoorContext(
  964. context.Background(),
  965. request,
  966. )
  967. }
  968. func (service *doorControlPort) DeleteDoorContext(ctx context.Context, request *DeleteDoor) (*DeleteDoorResponse, error) {
  969. response := new(DeleteDoorResponse)
  970. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/doorcontrol/wsdl/DeleteDoor", request, response)
  971. if err != nil {
  972. return nil, err
  973. }
  974. return response, nil
  975. }
  976. func (service *doorControlPort) DeleteDoor(request *DeleteDoor) (*DeleteDoorResponse, error) {
  977. return service.DeleteDoorContext(
  978. context.Background(),
  979. request,
  980. )
  981. }
  982. func (service *doorControlPort) GetDoorStateContext(ctx context.Context, request *GetDoorState) (*GetDoorStateResponse, error) {
  983. response := new(GetDoorStateResponse)
  984. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/doorcontrol/wsdl/GetDoorState", request, response)
  985. if err != nil {
  986. return nil, err
  987. }
  988. return response, nil
  989. }
  990. func (service *doorControlPort) GetDoorState(request *GetDoorState) (*GetDoorStateResponse, error) {
  991. return service.GetDoorStateContext(
  992. context.Background(),
  993. request,
  994. )
  995. }
  996. func (service *doorControlPort) AccessDoorContext(ctx context.Context, request *AccessDoor) (*AccessDoorResponse, error) {
  997. response := new(AccessDoorResponse)
  998. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/doorcontrol/wsdl/AccessDoor", request, response)
  999. if err != nil {
  1000. return nil, err
  1001. }
  1002. return response, nil
  1003. }
  1004. func (service *doorControlPort) AccessDoor(request *AccessDoor) (*AccessDoorResponse, error) {
  1005. return service.AccessDoorContext(
  1006. context.Background(),
  1007. request,
  1008. )
  1009. }
  1010. func (service *doorControlPort) LockDoorContext(ctx context.Context, request *LockDoor) (*LockDoorResponse, error) {
  1011. response := new(LockDoorResponse)
  1012. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/doorcontrol/wsdl/LockDoor", request, response)
  1013. if err != nil {
  1014. return nil, err
  1015. }
  1016. return response, nil
  1017. }
  1018. func (service *doorControlPort) LockDoor(request *LockDoor) (*LockDoorResponse, error) {
  1019. return service.LockDoorContext(
  1020. context.Background(),
  1021. request,
  1022. )
  1023. }
  1024. func (service *doorControlPort) UnlockDoorContext(ctx context.Context, request *UnlockDoor) (*UnlockDoorResponse, error) {
  1025. response := new(UnlockDoorResponse)
  1026. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/doorcontrol/wsdl/UnlockDoor", request, response)
  1027. if err != nil {
  1028. return nil, err
  1029. }
  1030. return response, nil
  1031. }
  1032. func (service *doorControlPort) UnlockDoor(request *UnlockDoor) (*UnlockDoorResponse, error) {
  1033. return service.UnlockDoorContext(
  1034. context.Background(),
  1035. request,
  1036. )
  1037. }
  1038. func (service *doorControlPort) BlockDoorContext(ctx context.Context, request *BlockDoor) (*BlockDoorResponse, error) {
  1039. response := new(BlockDoorResponse)
  1040. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/doorcontrol/wsdl/BlockDoor", request, response)
  1041. if err != nil {
  1042. return nil, err
  1043. }
  1044. return response, nil
  1045. }
  1046. func (service *doorControlPort) BlockDoor(request *BlockDoor) (*BlockDoorResponse, error) {
  1047. return service.BlockDoorContext(
  1048. context.Background(),
  1049. request,
  1050. )
  1051. }
  1052. func (service *doorControlPort) LockDownDoorContext(ctx context.Context, request *LockDownDoor) (*LockDownDoorResponse, error) {
  1053. response := new(LockDownDoorResponse)
  1054. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/doorcontrol/wsdl/LockDownDoor", request, response)
  1055. if err != nil {
  1056. return nil, err
  1057. }
  1058. return response, nil
  1059. }
  1060. func (service *doorControlPort) LockDownDoor(request *LockDownDoor) (*LockDownDoorResponse, error) {
  1061. return service.LockDownDoorContext(
  1062. context.Background(),
  1063. request,
  1064. )
  1065. }
  1066. func (service *doorControlPort) LockDownReleaseDoorContext(ctx context.Context, request *LockDownReleaseDoor) (*LockDownReleaseDoorResponse, error) {
  1067. response := new(LockDownReleaseDoorResponse)
  1068. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/doorcontrol/wsdl/LockDownReleaseDoor", request, response)
  1069. if err != nil {
  1070. return nil, err
  1071. }
  1072. return response, nil
  1073. }
  1074. func (service *doorControlPort) LockDownReleaseDoor(request *LockDownReleaseDoor) (*LockDownReleaseDoorResponse, error) {
  1075. return service.LockDownReleaseDoorContext(
  1076. context.Background(),
  1077. request,
  1078. )
  1079. }
  1080. func (service *doorControlPort) LockOpenDoorContext(ctx context.Context, request *LockOpenDoor) (*LockOpenDoorResponse, error) {
  1081. response := new(LockOpenDoorResponse)
  1082. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/doorcontrol/wsdl/LockOpenDoor", request, response)
  1083. if err != nil {
  1084. return nil, err
  1085. }
  1086. return response, nil
  1087. }
  1088. func (service *doorControlPort) LockOpenDoor(request *LockOpenDoor) (*LockOpenDoorResponse, error) {
  1089. return service.LockOpenDoorContext(
  1090. context.Background(),
  1091. request,
  1092. )
  1093. }
  1094. func (service *doorControlPort) LockOpenReleaseDoorContext(ctx context.Context, request *LockOpenReleaseDoor) (*LockOpenReleaseDoorResponse, error) {
  1095. response := new(LockOpenReleaseDoorResponse)
  1096. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/doorcontrol/wsdl/LockOpenReleaseDoor", request, response)
  1097. if err != nil {
  1098. return nil, err
  1099. }
  1100. return response, nil
  1101. }
  1102. func (service *doorControlPort) LockOpenReleaseDoor(request *LockOpenReleaseDoor) (*LockOpenReleaseDoorResponse, error) {
  1103. return service.LockOpenReleaseDoorContext(
  1104. context.Background(),
  1105. request,
  1106. )
  1107. }
  1108. func (service *doorControlPort) DoubleLockDoorContext(ctx context.Context, request *DoubleLockDoor) (*DoubleLockDoorResponse, error) {
  1109. response := new(DoubleLockDoorResponse)
  1110. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/doorcontrol/wsdl/DoubleLockDoor", request, response)
  1111. if err != nil {
  1112. return nil, err
  1113. }
  1114. return response, nil
  1115. }
  1116. func (service *doorControlPort) DoubleLockDoor(request *DoubleLockDoor) (*DoubleLockDoorResponse, error) {
  1117. return service.DoubleLockDoorContext(
  1118. context.Background(),
  1119. request,
  1120. )
  1121. }
  1122. // Duration type
  1123. type Duration string