aes70 1.6.2 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (656) hide show
  1. package/COPYING +7 -7
  2. package/Changelog +9 -0
  3. package/README.md +74 -42
  4. package/dist/AES70.es5.js +23901 -5159
  5. package/package.json +3 -3
  6. package/src/OCP1/Arguments.js +3 -0
  7. package/src/OCP1/Enum.js +8 -0
  8. package/src/OCP1/OcaActionObjectSearchResult.js +20 -0
  9. package/src/OCP1/OcaActionObjectSearchResultFlags.js +3 -0
  10. package/src/OCP1/OcaArray1D.js +108 -0
  11. package/src/OCP1/OcaBitstring.js +3 -0
  12. package/src/OCP1/OcaBlob.js +2 -43
  13. package/src/OCP1/OcaBlobFixedLen.js +8 -0
  14. package/src/OCP1/OcaBlockConfigurability.js +3 -0
  15. package/src/OCP1/OcaBoolean.js +3 -0
  16. package/src/OCP1/OcaCommand.js +17 -0
  17. package/src/OCP1/OcaCommandResult.js +17 -0
  18. package/src/OCP1/OcaCommandSetResult.js +17 -0
  19. package/src/OCP1/OcaConstructionParameter.js +16 -0
  20. package/src/OCP1/OcaCounter.js +22 -0
  21. package/src/OCP1/OcaCounterNotifierFilterParameters.js +19 -0
  22. package/src/OCP1/OcaCounterSet.js +17 -0
  23. package/src/OCP1/OcaCounterUpdate.js +18 -0
  24. package/src/OCP1/OcaCounterUpdateEventData.js +15 -0
  25. package/src/OCP1/OcaDatasetSearchResult.js +17 -0
  26. package/src/OCP1/OcaDeviceGenericState.js +4 -0
  27. package/src/OCP1/OcaDeviceOperationalState.js +16 -0
  28. package/src/OCP1/OcaExecutableType.js +4 -0
  29. package/src/OCP1/OcaFloat32.js +3 -0
  30. package/src/OCP1/OcaFloat64.js +3 -0
  31. package/src/OCP1/OcaGenericEndState.js +4 -0
  32. package/src/OCP1/OcaGlobalTypeIdentifier.js +1 -1
  33. package/src/OCP1/OcaGroupException.js +18 -0
  34. package/src/OCP1/OcaIODirection.js +4 -0
  35. package/src/OCP1/OcaIP4AutoconfigMode.js +4 -0
  36. package/src/OCP1/OcaIP4Gateway.js +17 -0
  37. package/src/OCP1/OcaIP4NetworkSettings.js +23 -0
  38. package/src/OCP1/OcaIP6AutoconfigMode.js +4 -0
  39. package/src/OCP1/OcaIP6Gateway.js +17 -0
  40. package/src/OCP1/OcaIP6NetworkSettings.js +24 -0
  41. package/src/OCP1/OcaInt16.js +3 -0
  42. package/src/OCP1/OcaInt32.js +3 -0
  43. package/src/OCP1/OcaInt64.js +3 -0
  44. package/src/OCP1/OcaInt8.js +3 -0
  45. package/src/OCP1/OcaInterval.js +18 -0
  46. package/src/OCP1/OcaIntervalBounds.js +3 -0
  47. package/src/OCP1/OcaJobDisposedEventData.js +18 -0
  48. package/src/OCP1/OcaJobDisposition.js +4 -0
  49. package/src/OCP1/OcaJobQueueItem.js +24 -0
  50. package/src/OCP1/OcaList.js +2 -127
  51. package/src/OCP1/OcaList2D.js +6 -0
  52. package/src/OCP1/OcaList32.js +3 -0
  53. package/src/OCP1/OcaLockState.js +4 -0
  54. package/src/OCP1/OcaLogFilter.js +20 -0
  55. package/src/OCP1/OcaLogRecord.js +21 -0
  56. package/src/OCP1/OcaLongBlob.js +3 -0
  57. package/src/OCP1/OcaManufacturer.js +19 -0
  58. package/src/OCP1/OcaMap.js +3 -0
  59. package/src/OCP1/OcaMatrixCommand.js +19 -0
  60. package/src/OCP1/OcaMatrixCoordinates.js +15 -0
  61. package/src/OCP1/OcaMediaAccessMode.js +4 -0
  62. package/src/OCP1/OcaMediaFrameFormat.js +4 -0
  63. package/src/OCP1/OcaMediaPlayOption.js +4 -0
  64. package/src/OCP1/OcaMediaRecorderPlayerState.js +4 -0
  65. package/src/OCP1/OcaMediaStreamEndpoint.js +40 -0
  66. package/src/OCP1/OcaMediaStreamEndpointCommand.js +4 -0
  67. package/src/OCP1/OcaMediaStreamEndpointState.js +4 -0
  68. package/src/OCP1/OcaMediaStreamEndpointStatus.js +16 -0
  69. package/src/OCP1/OcaMediaStreamMode.js +21 -0
  70. package/src/OCP1/OcaMediaStreamModeCapability.js +29 -0
  71. package/src/OCP1/OcaMediaStreamModeCapabilityDirection.js +3 -0
  72. package/src/OCP1/OcaMediaTrackFunction.js +3 -0
  73. package/src/OCP1/OcaMediaTransportSession.js +30 -0
  74. package/src/OCP1/OcaMediaTransportSessionConnection.js +17 -0
  75. package/src/OCP1/OcaMediaTransportSessionConnectionState.js +15 -0
  76. package/src/OCP1/OcaMediaTransportSessionState.js +4 -0
  77. package/src/OCP1/OcaMediaTransportSessionStatus.js +16 -0
  78. package/src/OCP1/OcaMediaTransportTimingParameters.js +16 -0
  79. package/src/OCP1/OcaMediaVolumePosition.js +16 -0
  80. package/src/OCP1/OcaMediaVolumePositionType.js +4 -0
  81. package/src/OCP1/OcaMultiMap.js +3 -0
  82. package/src/OCP1/OcaNetworkAdvertisingMechanism.js +16 -0
  83. package/src/OCP1/OcaNetworkAdvertisingService.js +4 -0
  84. package/src/OCP1/OcaNetworkInterfaceAssignment.js +23 -0
  85. package/src/OCP1/OcaNetworkInterfaceCommand.js +4 -0
  86. package/src/OCP1/OcaNetworkInterfaceState.js +4 -0
  87. package/src/OCP1/OcaNetworkInterfaceStatus.js +16 -0
  88. package/src/OCP1/OcaObjectSearchResult.js +2 -18
  89. package/src/OCP1/OcaObjectSearchResultFlags.js +5 -3
  90. package/src/OCP1/OcaPort.js +1 -1
  91. package/src/OCP1/OcaPortClockMapEntry.js +16 -0
  92. package/src/OCP1/OcaPortID.js +2 -2
  93. package/src/OCP1/OcaPortIdentification.js +16 -0
  94. package/src/OCP1/OcaPortMode.js +5 -4
  95. package/src/OCP1/OcaPositionDescriptor.js +2 -2
  96. package/src/OCP1/OcaProduct.js +19 -0
  97. package/src/OCP1/OcaProgramResult.js +17 -0
  98. package/src/OCP1/OcaProgramRunMode.js +3 -0
  99. package/src/OCP1/OcaProtoPort.js +2 -2
  100. package/src/OCP1/OcaProtoPortClockMapEntry.js +17 -0
  101. package/src/OCP1/OcaProtoSignalPath.js +2 -2
  102. package/src/OCP1/OcaSamplingRateConverterType.js +4 -0
  103. package/src/OCP1/OcaSecurityType.js +4 -0
  104. package/src/OCP1/OcaSignalPath.js +2 -2
  105. package/src/OCP1/OcaString.js +3 -0
  106. package/src/OCP1/OcaTask.js +4 -3
  107. package/src/OCP1/OcaTaskExecutionTerminatedEventData.js +20 -0
  108. package/src/OCP1/OcaTaskGenericState.js +4 -0
  109. package/src/OCP1/OcaTaskOperationalState.js +17 -0
  110. package/src/OCP1/OcaTaskSchedulerState.js +4 -0
  111. package/src/OCP1/OcaTaskStatusChangedEventData.js +18 -0
  112. package/src/OCP1/OcaTime.js +18 -0
  113. package/src/OCP1/OcaTimeDeliveryMechanism.js +4 -0
  114. package/src/OCP1/OcaTimeDeliveryParameters_StreamEndpoint.js +15 -0
  115. package/src/OCP1/OcaTimePTP.js +2 -15
  116. package/src/OCP1/OcaTypedBlob.js +16 -0
  117. package/src/OCP1/OcaUint16.js +3 -0
  118. package/src/OCP1/OcaUint32.js +3 -0
  119. package/src/OCP1/OcaUint64.js +3 -0
  120. package/src/OCP1/OcaUint8.js +3 -0
  121. package/src/OCP1/OcaVariant.js +92 -0
  122. package/src/OCP1/OcaWhenPhysicalAbsolute.js +16 -0
  123. package/src/OCP1/OcaWhenPhysicalRelative.js +16 -0
  124. package/src/OCP1/RestWithOffset.js +3 -0
  125. package/src/OCP1/String16.js +3 -0
  126. package/src/OCP1/Struct.js +12 -0
  127. package/src/OCP1/Tuple.js +3 -0
  128. package/src/OCP1/createBlobType.js +58 -0
  129. package/src/OCP1/createListType.js +137 -0
  130. package/src/OCP1/createType.js +8 -4
  131. package/src/OCP1/decode_message.js +10 -2
  132. package/src/OCP1/encode_message.js +5 -1
  133. package/src/OCP1/getLengthEncoder.js +23 -0
  134. package/src/OCP1/notification2.js +70 -0
  135. package/src/OCP1/protocol_version.js +4 -0
  136. package/src/close_error.d.ts +4 -0
  137. package/src/close_error.js +13 -0
  138. package/src/connection.js +16 -8
  139. package/src/controller/ControlClasses/OcaActuator.d.ts +3 -3
  140. package/src/controller/ControlClasses/OcaActuator.js +4 -4
  141. package/src/controller/ControlClasses/OcaAgent.d.ts +6 -14
  142. package/src/controller/ControlClasses/OcaAgent.js +8 -18
  143. package/src/controller/ControlClasses/OcaApplicationNetwork.d.ts +9 -17
  144. package/src/controller/ControlClasses/OcaApplicationNetwork.js +11 -32
  145. package/src/controller/ControlClasses/OcaAudioLevelSensor.d.ts +4 -7
  146. package/src/controller/ControlClasses/OcaAudioLevelSensor.js +5 -8
  147. package/src/controller/ControlClasses/OcaAudioProcessingManager.d.ts +1 -1
  148. package/src/controller/ControlClasses/OcaAudioProcessingManager.js +2 -2
  149. package/src/controller/ControlClasses/OcaBasicActuator.d.ts +1 -1
  150. package/src/controller/ControlClasses/OcaBasicActuator.js +2 -2
  151. package/src/controller/ControlClasses/OcaBasicSensor.d.ts +1 -1
  152. package/src/controller/ControlClasses/OcaBasicSensor.js +2 -2
  153. package/src/controller/ControlClasses/OcaBitstringActuator.d.ts +34 -13
  154. package/src/controller/ControlClasses/OcaBitstringActuator.js +35 -18
  155. package/src/controller/ControlClasses/OcaBitstringSensor.d.ts +19 -7
  156. package/src/controller/ControlClasses/OcaBitstringSensor.js +22 -12
  157. package/src/controller/ControlClasses/OcaBlock.d.ts +455 -89
  158. package/src/controller/ControlClasses/OcaBlock.js +477 -103
  159. package/src/controller/ControlClasses/OcaBlockFactoryAgent.d.ts +299 -0
  160. package/src/controller/ControlClasses/OcaBlockFactoryAgent.js +360 -0
  161. package/src/controller/ControlClasses/OcaBooleanActuator.d.ts +2 -4
  162. package/src/controller/ControlClasses/OcaBooleanActuator.js +3 -5
  163. package/src/controller/ControlClasses/OcaBooleanSensor.d.ts +2 -3
  164. package/src/controller/ControlClasses/OcaBooleanSensor.js +3 -4
  165. package/src/controller/ControlClasses/OcaCodingManager.js +1 -1
  166. package/src/controller/ControlClasses/OcaCommandSet.d.ts +89 -0
  167. package/src/controller/ControlClasses/OcaCommandSet.js +94 -0
  168. package/src/controller/ControlClasses/OcaCommandSetAgent.d.ts +31 -0
  169. package/src/controller/ControlClasses/OcaCommandSetAgent.js +38 -0
  170. package/src/controller/ControlClasses/OcaCounterNotifier.d.ts +89 -0
  171. package/src/controller/ControlClasses/OcaCounterNotifier.js +101 -0
  172. package/src/controller/ControlClasses/OcaCurrentSensor.d.ts +2 -3
  173. package/src/controller/ControlClasses/OcaCurrentSensor.js +3 -4
  174. package/src/controller/ControlClasses/OcaDataset.d.ts +223 -0
  175. package/src/controller/ControlClasses/OcaDataset.js +234 -0
  176. package/src/controller/ControlClasses/OcaDatasetWorker.d.ts +31 -0
  177. package/src/controller/ControlClasses/OcaDatasetWorker.js +40 -0
  178. package/src/controller/ControlClasses/OcaDelay.d.ts +2 -4
  179. package/src/controller/ControlClasses/OcaDelay.js +3 -5
  180. package/src/controller/ControlClasses/OcaDelayExtended.d.ts +5 -7
  181. package/src/controller/ControlClasses/OcaDelayExtended.js +6 -8
  182. package/src/controller/ControlClasses/OcaDeviceManager.d.ts +123 -62
  183. package/src/controller/ControlClasses/OcaDeviceManager.js +161 -83
  184. package/src/controller/ControlClasses/OcaDeviceTimeManager.d.ts +43 -25
  185. package/src/controller/ControlClasses/OcaDeviceTimeManager.js +43 -28
  186. package/src/controller/ControlClasses/OcaDiagnosticManager.d.ts +1 -13
  187. package/src/controller/ControlClasses/OcaDiagnosticManager.js +3 -16
  188. package/src/controller/ControlClasses/OcaDynamics.d.ts +38 -63
  189. package/src/controller/ControlClasses/OcaDynamics.js +48 -71
  190. package/src/controller/ControlClasses/OcaDynamicsCurve.d.ts +169 -82
  191. package/src/controller/ControlClasses/OcaDynamicsCurve.js +189 -93
  192. package/src/controller/ControlClasses/OcaDynamicsDetector.d.ts +8 -16
  193. package/src/controller/ControlClasses/OcaDynamicsDetector.js +9 -17
  194. package/src/controller/ControlClasses/OcaFilterArbitraryCurve.d.ts +5 -7
  195. package/src/controller/ControlClasses/OcaFilterArbitraryCurve.js +10 -12
  196. package/src/controller/ControlClasses/OcaFilterClassical.d.ts +15 -26
  197. package/src/controller/ControlClasses/OcaFilterClassical.js +15 -27
  198. package/src/controller/ControlClasses/OcaFilterFIR.d.ts +6 -11
  199. package/src/controller/ControlClasses/OcaFilterFIR.js +12 -18
  200. package/src/controller/ControlClasses/OcaFilterParametric.d.ts +55 -26
  201. package/src/controller/ControlClasses/OcaFilterParametric.js +63 -32
  202. package/src/controller/ControlClasses/OcaFilterPolynomial.d.ts +5 -4
  203. package/src/controller/ControlClasses/OcaFilterPolynomial.js +8 -7
  204. package/src/controller/ControlClasses/OcaFirmwareManager.d.ts +6 -11
  205. package/src/controller/ControlClasses/OcaFirmwareManager.js +5 -11
  206. package/src/controller/ControlClasses/OcaFloat32Actuator.d.ts +3 -5
  207. package/src/controller/ControlClasses/OcaFloat32Actuator.js +4 -6
  208. package/src/controller/ControlClasses/OcaFloat32Sensor.d.ts +2 -3
  209. package/src/controller/ControlClasses/OcaFloat32Sensor.js +3 -4
  210. package/src/controller/ControlClasses/OcaFloat64Actuator.d.ts +3 -5
  211. package/src/controller/ControlClasses/OcaFloat64Actuator.js +4 -6
  212. package/src/controller/ControlClasses/OcaFloat64Sensor.d.ts +2 -3
  213. package/src/controller/ControlClasses/OcaFloat64Sensor.js +3 -4
  214. package/src/controller/ControlClasses/OcaFrequencyActuator.d.ts +2 -4
  215. package/src/controller/ControlClasses/OcaFrequencyActuator.js +3 -5
  216. package/src/controller/ControlClasses/OcaFrequencySensor.d.ts +1 -2
  217. package/src/controller/ControlClasses/OcaFrequencySensor.js +2 -3
  218. package/src/controller/ControlClasses/OcaGain.d.ts +2 -4
  219. package/src/controller/ControlClasses/OcaGain.js +3 -5
  220. package/src/controller/ControlClasses/OcaGainSensor.d.ts +2 -3
  221. package/src/controller/ControlClasses/OcaGainSensor.js +3 -4
  222. package/src/controller/ControlClasses/OcaGroup.d.ts +140 -0
  223. package/src/controller/ControlClasses/OcaGroup.js +156 -0
  224. package/src/controller/ControlClasses/OcaGrouper.d.ts +20 -140
  225. package/src/controller/ControlClasses/OcaGrouper.js +34 -171
  226. package/src/controller/ControlClasses/OcaIdentificationActuator.d.ts +5 -7
  227. package/src/controller/ControlClasses/OcaIdentificationActuator.js +7 -9
  228. package/src/controller/ControlClasses/OcaIdentificationSensor.d.ts +5 -6
  229. package/src/controller/ControlClasses/OcaIdentificationSensor.js +6 -7
  230. package/src/controller/ControlClasses/OcaImpedanceSensor.d.ts +2 -3
  231. package/src/controller/ControlClasses/OcaImpedanceSensor.js +3 -4
  232. package/src/controller/ControlClasses/OcaInt16Actuator.d.ts +3 -5
  233. package/src/controller/ControlClasses/OcaInt16Actuator.js +4 -6
  234. package/src/controller/ControlClasses/OcaInt16Sensor.d.ts +2 -3
  235. package/src/controller/ControlClasses/OcaInt16Sensor.js +3 -4
  236. package/src/controller/ControlClasses/OcaInt32Actuator.d.ts +3 -5
  237. package/src/controller/ControlClasses/OcaInt32Actuator.js +4 -6
  238. package/src/controller/ControlClasses/OcaInt32Sensor.d.ts +2 -3
  239. package/src/controller/ControlClasses/OcaInt32Sensor.js +3 -4
  240. package/src/controller/ControlClasses/OcaInt64Actuator.d.ts +3 -5
  241. package/src/controller/ControlClasses/OcaInt64Actuator.js +4 -6
  242. package/src/controller/ControlClasses/OcaInt64Sensor.d.ts +2 -3
  243. package/src/controller/ControlClasses/OcaInt64Sensor.js +3 -4
  244. package/src/controller/ControlClasses/OcaInt8Actuator.d.ts +3 -5
  245. package/src/controller/ControlClasses/OcaInt8Actuator.js +4 -6
  246. package/src/controller/ControlClasses/OcaInt8Sensor.d.ts +2 -3
  247. package/src/controller/ControlClasses/OcaInt8Sensor.js +3 -4
  248. package/src/controller/ControlClasses/OcaJsonActuator.d.ts +46 -0
  249. package/src/controller/ControlClasses/OcaJsonActuator.js +58 -0
  250. package/src/controller/ControlClasses/OcaJsonSensor.d.ts +51 -0
  251. package/src/controller/ControlClasses/OcaJsonSensor.js +65 -0
  252. package/src/controller/ControlClasses/OcaLevelSensor.d.ts +1 -2
  253. package/src/controller/ControlClasses/OcaLevelSensor.js +2 -3
  254. package/src/controller/ControlClasses/OcaLibraryManager.d.ts +1 -1
  255. package/src/controller/ControlClasses/OcaLibraryManager.js +3 -3
  256. package/src/controller/ControlClasses/OcaLockManager.d.ts +44 -0
  257. package/src/controller/ControlClasses/OcaLockManager.js +53 -0
  258. package/src/controller/ControlClasses/OcaLog.d.ts +128 -0
  259. package/src/controller/ControlClasses/OcaLog.js +142 -0
  260. package/src/controller/ControlClasses/OcaManager.js +1 -1
  261. package/src/controller/ControlClasses/OcaMatrix.d.ts +104 -82
  262. package/src/controller/ControlClasses/OcaMatrix.js +121 -93
  263. package/src/controller/ControlClasses/OcaMediaClock.d.ts +27 -0
  264. package/src/controller/ControlClasses/OcaMediaClock.js +28 -4
  265. package/src/controller/ControlClasses/OcaMediaClock3.d.ts +16 -22
  266. package/src/controller/ControlClasses/OcaMediaClock3.js +22 -29
  267. package/src/controller/ControlClasses/OcaMediaClockManager.d.ts +7 -10
  268. package/src/controller/ControlClasses/OcaMediaClockManager.js +9 -13
  269. package/src/controller/ControlClasses/OcaMediaRecorderPlayer.d.ts +235 -0
  270. package/src/controller/ControlClasses/OcaMediaRecorderPlayer.js +261 -0
  271. package/src/controller/ControlClasses/OcaMediaTransportApplication.d.ts +612 -0
  272. package/src/controller/ControlClasses/OcaMediaTransportApplication.js +704 -0
  273. package/src/controller/ControlClasses/OcaMediaTransportNetwork.d.ts +12 -25
  274. package/src/controller/ControlClasses/OcaMediaTransportNetwork.js +12 -35
  275. package/src/controller/ControlClasses/OcaMediaTransportSessionAgent.d.ts +235 -0
  276. package/src/controller/ControlClasses/OcaMediaTransportSessionAgent.js +249 -0
  277. package/src/controller/ControlClasses/OcaMute.d.ts +2 -4
  278. package/src/controller/ControlClasses/OcaMute.js +3 -5
  279. package/src/controller/ControlClasses/OcaNetwork.js +1 -1
  280. package/src/controller/ControlClasses/OcaNetworkApplication.d.ts +179 -0
  281. package/src/controller/ControlClasses/OcaNetworkApplication.js +202 -0
  282. package/src/controller/ControlClasses/OcaNetworkInterface.d.ts +318 -0
  283. package/src/controller/ControlClasses/OcaNetworkInterface.js +353 -0
  284. package/src/controller/ControlClasses/OcaNetworkManager.d.ts +45 -17
  285. package/src/controller/ControlClasses/OcaNetworkManager.js +59 -22
  286. package/src/controller/ControlClasses/OcaNetworkSignalChannel.js +1 -1
  287. package/src/controller/ControlClasses/OcaNumericObserver.d.ts +24 -40
  288. package/src/controller/ControlClasses/OcaNumericObserver.js +25 -40
  289. package/src/controller/ControlClasses/OcaNumericObserverList.d.ts +20 -33
  290. package/src/controller/ControlClasses/OcaNumericObserverList.js +26 -39
  291. package/src/controller/ControlClasses/OcaPanBalance.d.ts +4 -8
  292. package/src/controller/ControlClasses/OcaPanBalance.js +5 -9
  293. package/src/controller/ControlClasses/OcaPhysicalPosition.d.ts +3 -6
  294. package/src/controller/ControlClasses/OcaPhysicalPosition.js +4 -7
  295. package/src/controller/ControlClasses/OcaPolarity.d.ts +2 -4
  296. package/src/controller/ControlClasses/OcaPolarity.js +3 -5
  297. package/src/controller/ControlClasses/OcaPowerManager.d.ts +30 -14
  298. package/src/controller/ControlClasses/OcaPowerManager.js +32 -17
  299. package/src/controller/ControlClasses/OcaPowerSensor.d.ts +38 -0
  300. package/src/controller/ControlClasses/OcaPowerSensor.js +51 -0
  301. package/src/controller/ControlClasses/OcaPowerSupply.d.ts +8 -16
  302. package/src/controller/ControlClasses/OcaPowerSupply.js +13 -21
  303. package/src/controller/ControlClasses/OcaProgram.d.ts +63 -0
  304. package/src/controller/ControlClasses/OcaProgram.js +82 -0
  305. package/src/controller/ControlClasses/OcaRamper.d.ts +46 -10
  306. package/src/controller/ControlClasses/OcaRamper.js +65 -12
  307. package/src/controller/ControlClasses/OcaRoot.d.ts +69 -24
  308. package/src/controller/ControlClasses/OcaRoot.js +67 -26
  309. package/src/controller/ControlClasses/OcaSamplingRateConverter.d.ts +22 -0
  310. package/src/controller/ControlClasses/OcaSamplingRateConverter.js +28 -0
  311. package/src/controller/ControlClasses/OcaSecurityManager.d.ts +12 -13
  312. package/src/controller/ControlClasses/OcaSecurityManager.js +10 -12
  313. package/src/controller/ControlClasses/OcaSensor.d.ts +1 -2
  314. package/src/controller/ControlClasses/OcaSensor.js +2 -3
  315. package/src/controller/ControlClasses/OcaSignalGenerator.d.ts +21 -39
  316. package/src/controller/ControlClasses/OcaSignalGenerator.js +22 -40
  317. package/src/controller/ControlClasses/OcaSignalInput.d.ts +4 -4
  318. package/src/controller/ControlClasses/OcaSignalInput.js +5 -5
  319. package/src/controller/ControlClasses/OcaSignalOutput.d.ts +4 -4
  320. package/src/controller/ControlClasses/OcaSignalOutput.js +5 -5
  321. package/src/controller/ControlClasses/OcaStateSensor.d.ts +58 -0
  322. package/src/controller/ControlClasses/OcaStateSensor.js +75 -0
  323. package/src/controller/ControlClasses/OcaStreamConnector.js +1 -1
  324. package/src/controller/ControlClasses/OcaStreamNetwork.js +1 -1
  325. package/src/controller/ControlClasses/OcaStringActuator.d.ts +7 -8
  326. package/src/controller/ControlClasses/OcaStringActuator.js +7 -8
  327. package/src/controller/ControlClasses/OcaStringSensor.d.ts +20 -9
  328. package/src/controller/ControlClasses/OcaStringSensor.js +23 -13
  329. package/src/controller/ControlClasses/OcaSubscriptionManager.d.ts +211 -41
  330. package/src/controller/ControlClasses/OcaSubscriptionManager.js +224 -39
  331. package/src/controller/ControlClasses/OcaSummingPoint.d.ts +3 -2
  332. package/src/controller/ControlClasses/OcaSummingPoint.js +4 -3
  333. package/src/controller/ControlClasses/OcaSwitch.d.ts +70 -25
  334. package/src/controller/ControlClasses/OcaSwitch.js +113 -35
  335. package/src/controller/ControlClasses/OcaTaskAgent.d.ts +192 -0
  336. package/src/controller/ControlClasses/OcaTaskAgent.js +212 -0
  337. package/src/controller/ControlClasses/OcaTaskManager.d.ts +4 -6
  338. package/src/controller/ControlClasses/OcaTaskManager.js +7 -9
  339. package/src/controller/ControlClasses/OcaTaskScheduler.d.ts +150 -0
  340. package/src/controller/ControlClasses/OcaTaskScheduler.js +159 -0
  341. package/src/controller/ControlClasses/OcaTemperatureActuator.d.ts +3 -5
  342. package/src/controller/ControlClasses/OcaTemperatureActuator.js +4 -6
  343. package/src/controller/ControlClasses/OcaTemperatureSensor.d.ts +2 -3
  344. package/src/controller/ControlClasses/OcaTemperatureSensor.js +3 -4
  345. package/src/controller/ControlClasses/OcaTimeIntervalSensor.d.ts +1 -2
  346. package/src/controller/ControlClasses/OcaTimeIntervalSensor.js +2 -3
  347. package/src/controller/ControlClasses/OcaTimeSource.d.ts +108 -37
  348. package/src/controller/ControlClasses/OcaTimeSource.js +148 -48
  349. package/src/controller/ControlClasses/OcaUint16Actuator.d.ts +3 -5
  350. package/src/controller/ControlClasses/OcaUint16Actuator.js +4 -6
  351. package/src/controller/ControlClasses/OcaUint16Sensor.d.ts +2 -3
  352. package/src/controller/ControlClasses/OcaUint16Sensor.js +3 -4
  353. package/src/controller/ControlClasses/OcaUint32Actuator.d.ts +3 -5
  354. package/src/controller/ControlClasses/OcaUint32Actuator.js +4 -6
  355. package/src/controller/ControlClasses/OcaUint32Sensor.d.ts +2 -3
  356. package/src/controller/ControlClasses/OcaUint32Sensor.js +3 -4
  357. package/src/controller/ControlClasses/OcaUint64Actuator.d.ts +3 -5
  358. package/src/controller/ControlClasses/OcaUint64Actuator.js +4 -6
  359. package/src/controller/ControlClasses/OcaUint64Sensor.d.ts +2 -3
  360. package/src/controller/ControlClasses/OcaUint64Sensor.js +3 -4
  361. package/src/controller/ControlClasses/OcaUint8Actuator.d.ts +3 -5
  362. package/src/controller/ControlClasses/OcaUint8Actuator.js +4 -6
  363. package/src/controller/ControlClasses/OcaUint8Sensor.d.ts +2 -3
  364. package/src/controller/ControlClasses/OcaUint8Sensor.js +3 -4
  365. package/src/controller/ControlClasses/OcaVoltageSensor.d.ts +2 -3
  366. package/src/controller/ControlClasses/OcaVoltageSensor.js +3 -4
  367. package/src/controller/ControlClasses/OcaWorker.d.ts +84 -37
  368. package/src/controller/ControlClasses/OcaWorker.js +93 -43
  369. package/src/controller/base_event.js +73 -23
  370. package/src/controller/client_connection.d.ts +26 -0
  371. package/src/controller/client_connection.js +43 -10
  372. package/src/controller/event.js +17 -20
  373. package/src/controller/make_control_class.js +3 -1
  374. package/src/controller/notification_error.d.ts +40 -0
  375. package/src/controller/notification_error.js +62 -0
  376. package/src/controller/observeProperty.js +9 -9
  377. package/src/controller/property_event.js +18 -10
  378. package/src/controller/property_sync.js +18 -26
  379. package/src/controller/remote_device.js +137 -49
  380. package/src/index.default.d.ts +3 -0
  381. package/src/index.default.js +3 -0
  382. package/src/timeout_error.d.ts +3 -0
  383. package/src/timeout_error.js +9 -0
  384. package/src/types/Enum.js +8 -0
  385. package/src/types/OcaActionObjectSearchResult.d.ts +73 -0
  386. package/src/types/OcaActionObjectSearchResult.js +34 -0
  387. package/src/types/OcaActionObjectSearchResultFlags.d.ts +37 -0
  388. package/src/types/OcaActionObjectSearchResultFlags.js +52 -0
  389. package/src/types/OcaApplicationNetworkCommand.d.ts +1 -19
  390. package/src/types/OcaApplicationNetworkCommand.js +0 -24
  391. package/src/types/OcaApplicationNetworkState.d.ts +1 -37
  392. package/src/types/OcaApplicationNetworkState.js +0 -48
  393. package/src/types/OcaBlockConfigurability.d.ts +26 -0
  394. package/src/types/OcaBlockConfigurability.js +35 -0
  395. package/src/types/OcaClassicalFilterShape.d.ts +1 -1
  396. package/src/types/OcaClassicalFilterShape.js +1 -1
  397. package/src/types/OcaCommand.d.ts +44 -0
  398. package/src/types/OcaCommand.js +25 -0
  399. package/src/types/OcaCommandResult.d.ts +42 -0
  400. package/src/types/OcaCommandResult.js +24 -0
  401. package/src/types/OcaCommandSetResult.d.ts +41 -0
  402. package/src/types/OcaCommandSetResult.js +23 -0
  403. package/src/types/OcaConstructionParameter.d.ts +40 -0
  404. package/src/types/OcaConstructionParameter.js +23 -0
  405. package/src/types/OcaCounter.d.ts +81 -0
  406. package/src/types/OcaCounter.js +38 -0
  407. package/src/types/OcaCounterNotifierFilterParameters.d.ts +81 -0
  408. package/src/types/OcaCounterNotifierFilterParameters.js +37 -0
  409. package/src/types/OcaCounterSet.d.ts +38 -0
  410. package/src/types/OcaCounterSet.js +22 -0
  411. package/src/types/OcaCounterUpdate.d.ts +54 -0
  412. package/src/types/OcaCounterUpdate.js +28 -0
  413. package/src/types/OcaCounterUpdateEventData.d.ts +27 -0
  414. package/src/types/OcaCounterUpdateEventData.js +17 -0
  415. package/src/types/OcaDatasetSearchResult.d.ts +51 -0
  416. package/src/types/OcaDatasetSearchResult.js +28 -0
  417. package/src/types/OcaDelayUnit.d.ts +2 -1
  418. package/src/types/OcaDelayUnit.js +2 -1
  419. package/src/types/OcaDelayValue.d.ts +2 -1
  420. package/src/types/OcaDelayValue.js +2 -1
  421. package/src/types/OcaDeviceGenericState.d.ts +62 -0
  422. package/src/types/OcaDeviceGenericState.js +52 -0
  423. package/src/types/OcaDeviceOperationalState.d.ts +42 -0
  424. package/src/types/OcaDeviceOperationalState.js +22 -0
  425. package/src/types/OcaDeviceState.d.ts +2 -2
  426. package/src/types/OcaDeviceState.js +2 -2
  427. package/src/types/OcaExecutableType.d.ts +50 -0
  428. package/src/types/OcaExecutableType.js +36 -0
  429. package/src/types/OcaGenericEndState.d.ts +56 -0
  430. package/src/types/OcaGenericEndState.js +44 -0
  431. package/src/types/OcaGlobalTypeIdentifier.d.ts +12 -12
  432. package/src/types/OcaGlobalTypeIdentifier.js +8 -7
  433. package/src/types/OcaGroupException.d.ts +53 -0
  434. package/src/types/OcaGroupException.js +28 -0
  435. package/src/types/OcaGrouperCitizen.d.ts +10 -10
  436. package/src/types/OcaGrouperCitizen.js +6 -6
  437. package/src/types/OcaGrouperEnrollment.d.ts +4 -9
  438. package/src/types/OcaGrouperEnrollment.js +3 -5
  439. package/src/types/OcaGrouperGroup.d.ts +9 -9
  440. package/src/types/OcaGrouperGroup.js +5 -5
  441. package/src/types/OcaGrouperMode.d.ts +4 -3
  442. package/src/types/OcaGrouperMode.js +4 -3
  443. package/src/types/OcaGrouperStatusChangeEventData.d.ts +2 -2
  444. package/src/types/OcaGrouperStatusChangeEventData.js +2 -2
  445. package/src/types/OcaGrouperStatusChangeType.d.ts +1 -1
  446. package/src/types/OcaGrouperStatusChangeType.js +1 -1
  447. package/src/types/OcaIODirection.d.ts +39 -0
  448. package/src/types/OcaIODirection.js +28 -0
  449. package/src/types/OcaIP4AutoconfigMode.d.ts +56 -0
  450. package/src/types/OcaIP4AutoconfigMode.js +44 -0
  451. package/src/types/OcaIP4Gateway.d.ts +53 -0
  452. package/src/types/OcaIP4Gateway.js +27 -0
  453. package/src/types/OcaIP4NetworkSettings.d.ts +111 -0
  454. package/src/types/OcaIP4NetworkSettings.js +56 -0
  455. package/src/types/OcaIP6AutoconfigMode.d.ts +56 -0
  456. package/src/types/OcaIP6AutoconfigMode.js +44 -0
  457. package/src/types/OcaIP6Gateway.d.ts +53 -0
  458. package/src/types/OcaIP6Gateway.js +27 -0
  459. package/src/types/OcaIP6NetworkSettings.d.ts +123 -0
  460. package/src/types/OcaIP6NetworkSettings.js +61 -0
  461. package/src/types/OcaInterval.d.ts +8 -0
  462. package/src/types/OcaInterval.js +84 -0
  463. package/src/types/OcaIntervalBounds.d.ts +41 -0
  464. package/src/types/OcaIntervalBounds.js +53 -0
  465. package/src/types/OcaJobDisposedEventData.d.ts +57 -0
  466. package/src/types/OcaJobDisposedEventData.js +28 -0
  467. package/src/types/OcaJobDisposition.d.ts +68 -0
  468. package/src/types/OcaJobDisposition.js +60 -0
  469. package/src/types/OcaJobQueueItem.d.ts +105 -0
  470. package/src/types/OcaJobQueueItem.js +44 -0
  471. package/src/types/OcaLibVolType.d.ts +2 -4
  472. package/src/types/OcaLibVolType.js +1 -2
  473. package/src/types/OcaLockState.d.ts +50 -0
  474. package/src/types/OcaLockState.js +36 -0
  475. package/src/types/OcaLogFilter.d.ts +70 -0
  476. package/src/types/OcaLogFilter.js +33 -0
  477. package/src/types/OcaLogRecord.d.ts +85 -0
  478. package/src/types/OcaLogRecord.js +40 -0
  479. package/src/types/OcaManagerDefaultObjectNumbers.d.ts +7 -0
  480. package/src/types/OcaManagerDefaultObjectNumbers.js +7 -0
  481. package/src/types/OcaManagerDescriptor.d.ts +11 -9
  482. package/src/types/OcaManagerDescriptor.js +6 -5
  483. package/src/types/OcaManufacturer.d.ts +87 -0
  484. package/src/types/OcaManufacturer.js +47 -0
  485. package/src/types/OcaMatrixCommand.d.ts +61 -0
  486. package/src/types/OcaMatrixCommand.js +29 -0
  487. package/src/types/OcaMatrixCoordinates.d.ts +38 -0
  488. package/src/types/OcaMatrixCoordinates.js +23 -0
  489. package/src/types/OcaMediaAccessMode.d.ts +50 -0
  490. package/src/types/OcaMediaAccessMode.js +36 -0
  491. package/src/types/OcaMediaClockAvailability.d.ts +1 -1
  492. package/src/types/OcaMediaClockAvailability.js +1 -1
  493. package/src/types/OcaMediaClockRate.d.ts +7 -7
  494. package/src/types/OcaMediaClockRate.js +4 -4
  495. package/src/types/OcaMediaConnection.d.ts +2 -2
  496. package/src/types/OcaMediaConnection.js +1 -1
  497. package/src/types/OcaMediaFrameFormat.d.ts +74 -0
  498. package/src/types/OcaMediaFrameFormat.js +68 -0
  499. package/src/types/OcaMediaPlayOption.d.ts +50 -0
  500. package/src/types/OcaMediaPlayOption.js +36 -0
  501. package/src/types/OcaMediaRecorderPlayerState.d.ts +62 -0
  502. package/src/types/OcaMediaRecorderPlayerState.js +52 -0
  503. package/src/types/OcaMediaStreamCastMode.d.ts +3 -3
  504. package/src/types/OcaMediaStreamCastMode.js +3 -3
  505. package/src/types/OcaMediaStreamEndpoint.d.ts +238 -0
  506. package/src/types/OcaMediaStreamEndpoint.js +114 -0
  507. package/src/types/OcaMediaStreamEndpointCommand.d.ts +80 -0
  508. package/src/types/OcaMediaStreamEndpointCommand.js +76 -0
  509. package/src/types/OcaMediaStreamEndpointState.d.ts +68 -0
  510. package/src/types/OcaMediaStreamEndpointState.js +60 -0
  511. package/src/types/OcaMediaStreamEndpointStatus.d.ts +44 -0
  512. package/src/types/OcaMediaStreamEndpointStatus.js +23 -0
  513. package/src/types/OcaMediaStreamMode.d.ts +83 -0
  514. package/src/types/OcaMediaStreamMode.js +43 -0
  515. package/src/types/OcaMediaStreamModeCapability.d.ts +167 -0
  516. package/src/types/OcaMediaStreamModeCapability.js +81 -0
  517. package/src/types/OcaMediaStreamModeCapabilityDirection.d.ts +21 -0
  518. package/src/types/OcaMediaStreamModeCapabilityDirection.js +27 -0
  519. package/src/types/OcaMediaTrackFunction.d.ts +27 -0
  520. package/src/types/OcaMediaTrackFunction.js +36 -0
  521. package/src/types/OcaMediaTransportSession.d.ts +119 -0
  522. package/src/types/OcaMediaTransportSession.js +58 -0
  523. package/src/types/OcaMediaTransportSessionConnection.d.ts +63 -0
  524. package/src/types/OcaMediaTransportSessionConnection.js +32 -0
  525. package/src/types/OcaMediaTransportSessionConnectionState.d.ts +47 -0
  526. package/src/types/OcaMediaTransportSessionConnectionState.js +24 -0
  527. package/src/types/OcaMediaTransportSessionState.d.ts +62 -0
  528. package/src/types/OcaMediaTransportSessionState.js +52 -0
  529. package/src/types/OcaMediaTransportSessionStatus.d.ts +43 -0
  530. package/src/types/OcaMediaTransportSessionStatus.js +23 -0
  531. package/src/types/OcaMediaTransportTimingParameters.d.ts +54 -0
  532. package/src/types/OcaMediaTransportTimingParameters.js +31 -0
  533. package/src/types/OcaMediaVolumePosition.d.ts +46 -0
  534. package/src/types/OcaMediaVolumePosition.js +23 -0
  535. package/src/types/OcaMediaVolumePositionType.d.ts +44 -0
  536. package/src/types/OcaMediaVolumePositionType.js +28 -0
  537. package/src/types/OcaModelGUID.d.ts +0 -1
  538. package/src/types/OcaModelGUID.js +0 -1
  539. package/src/types/OcaNetworkAdvertisingMechanism.d.ts +43 -0
  540. package/src/types/OcaNetworkAdvertisingMechanism.js +23 -0
  541. package/src/types/OcaNetworkAdvertisingService.d.ts +56 -0
  542. package/src/types/OcaNetworkAdvertisingService.js +44 -0
  543. package/src/types/OcaNetworkInterfaceAssignment.d.ts +99 -0
  544. package/src/types/OcaNetworkInterfaceAssignment.js +51 -0
  545. package/src/types/OcaNetworkInterfaceCommand.d.ts +50 -0
  546. package/src/types/OcaNetworkInterfaceCommand.js +36 -0
  547. package/src/types/OcaNetworkInterfaceState.d.ts +50 -0
  548. package/src/types/OcaNetworkInterfaceState.js +36 -0
  549. package/src/types/OcaNetworkInterfaceStatus.d.ts +42 -0
  550. package/src/types/OcaNetworkInterfaceStatus.js +22 -0
  551. package/src/types/OcaNotificationDeliveryMode.d.ts +13 -1
  552. package/src/types/OcaNotificationDeliveryMode.js +17 -1
  553. package/src/types/OcaOPath.d.ts +16 -2
  554. package/src/types/OcaOPath.js +8 -1
  555. package/src/types/OcaObjectListEventData.d.ts +2 -2
  556. package/src/types/OcaObjectListEventData.js +2 -2
  557. package/src/types/OcaObjectSearchResult.d.ts +4 -83
  558. package/src/types/OcaObjectSearchResult.js +2 -37
  559. package/src/types/OcaObjectSearchResultFlags.d.ts +4 -33
  560. package/src/types/OcaObjectSearchResultFlags.js +2 -48
  561. package/src/types/OcaObservationEventData.d.ts +2 -2
  562. package/src/types/OcaObservationEventData.js +2 -2
  563. package/src/types/OcaObservationListEventData.d.ts +2 -2
  564. package/src/types/OcaObservationListEventData.js +2 -2
  565. package/src/types/OcaObserverState.d.ts +1 -1
  566. package/src/types/OcaObserverState.js +1 -1
  567. package/src/types/OcaParameterMask.d.ts +81 -1
  568. package/src/types/OcaParameterMask.js +131 -1
  569. package/src/types/OcaPort.d.ts +7 -5
  570. package/src/types/OcaPort.js +4 -3
  571. package/src/types/OcaPortClockMapEntry.d.ts +42 -0
  572. package/src/types/OcaPortClockMapEntry.js +23 -0
  573. package/src/types/OcaPortID.d.ts +12 -10
  574. package/src/types/OcaPortID.js +7 -6
  575. package/src/types/OcaPortIdentification.d.ts +39 -0
  576. package/src/types/OcaPortIdentification.js +23 -0
  577. package/src/types/OcaPortMode.d.ts +4 -36
  578. package/src/types/OcaPortMode.js +2 -25
  579. package/src/types/OcaPositionDescriptor.d.ts +6 -6
  580. package/src/types/OcaPositionDescriptor.js +2 -2
  581. package/src/types/OcaPositionDescriptorFieldFlags.d.ts +33 -3
  582. package/src/types/OcaPositionDescriptorFieldFlags.js +53 -3
  583. package/src/types/OcaPowerSupplyState.d.ts +1 -1
  584. package/src/types/OcaPowerSupplyState.js +1 -1
  585. package/src/types/OcaProduct.d.ts +92 -0
  586. package/src/types/OcaProduct.js +42 -0
  587. package/src/types/OcaProgramResult.d.ts +39 -0
  588. package/src/types/OcaProgramResult.js +22 -0
  589. package/src/types/OcaProgramRunMode.d.ts +24 -0
  590. package/src/types/OcaProgramRunMode.js +30 -0
  591. package/src/types/OcaProperty.d.ts +2 -2
  592. package/src/types/OcaProperty.js +2 -2
  593. package/src/types/OcaProtoObjectIdentification.d.ts +1 -1
  594. package/src/types/OcaProtoObjectIdentification.js +1 -1
  595. package/src/types/OcaProtoPort.d.ts +16 -18
  596. package/src/types/OcaProtoPort.js +6 -8
  597. package/src/types/OcaProtoPortClockMapEntry.d.ts +46 -0
  598. package/src/types/OcaProtoPortClockMapEntry.js +25 -0
  599. package/src/types/OcaProtoSignalPath.d.ts +12 -10
  600. package/src/types/OcaProtoSignalPath.js +7 -6
  601. package/src/types/OcaRamperState.d.ts +19 -18
  602. package/src/types/OcaRamperState.js +19 -18
  603. package/src/types/OcaResetCause.d.ts +7 -1
  604. package/src/types/OcaResetCause.js +8 -0
  605. package/src/types/OcaSamplingRateConverterType.d.ts +50 -0
  606. package/src/types/OcaSamplingRateConverterType.js +36 -0
  607. package/src/types/OcaSecurityType.d.ts +39 -0
  608. package/src/types/OcaSecurityType.js +28 -0
  609. package/src/types/OcaSignalPath.d.ts +10 -10
  610. package/src/types/OcaSignalPath.js +6 -6
  611. package/src/types/OcaStatus.d.ts +19 -1
  612. package/src/types/OcaStatus.js +24 -0
  613. package/src/types/OcaStream.d.ts +2 -2
  614. package/src/types/OcaStream.js +1 -1
  615. package/src/types/OcaTask.d.ts +23 -24
  616. package/src/types/OcaTask.js +7 -7
  617. package/src/types/OcaTaskCommand.d.ts +2 -7
  618. package/src/types/OcaTaskCommand.js +2 -9
  619. package/src/types/OcaTaskExecutionTerminatedEventData.d.ts +64 -0
  620. package/src/types/OcaTaskExecutionTerminatedEventData.js +30 -0
  621. package/src/types/OcaTaskGenericState.d.ts +64 -0
  622. package/src/types/OcaTaskGenericState.js +54 -0
  623. package/src/types/OcaTaskManagerState.d.ts +1 -0
  624. package/src/types/OcaTaskManagerState.js +1 -0
  625. package/src/types/OcaTaskOperationalState.d.ts +43 -0
  626. package/src/types/OcaTaskOperationalState.js +22 -0
  627. package/src/types/OcaTaskSchedulerState.d.ts +63 -0
  628. package/src/types/OcaTaskSchedulerState.js +53 -0
  629. package/src/types/OcaTaskStatus.d.ts +2 -12
  630. package/src/types/OcaTaskStatus.js +2 -12
  631. package/src/types/OcaTaskStatusChangedEventData.d.ts +61 -0
  632. package/src/types/OcaTaskStatusChangedEventData.js +29 -0
  633. package/src/types/OcaTime.d.ts +56 -0
  634. package/src/types/OcaTime.js +32 -0
  635. package/src/types/OcaTimeDeliveryMechanism.d.ts +167 -0
  636. package/src/types/OcaTimeDeliveryMechanism.js +191 -0
  637. package/src/types/OcaTimeDeliveryParameters_StreamEndpoint.d.ts +40 -0
  638. package/src/types/OcaTimeDeliveryParameters_StreamEndpoint.js +24 -0
  639. package/src/types/OcaTimePTP.d.ts +4 -51
  640. package/src/types/OcaTimePTP.js +2 -28
  641. package/src/types/OcaTimeReferenceType.d.ts +7 -13
  642. package/src/types/OcaTimeReferenceType.js +6 -14
  643. package/src/types/OcaTimeSourceAvailability.d.ts +1 -1
  644. package/src/types/OcaTimeSourceAvailability.js +1 -1
  645. package/src/types/OcaTimeSourceSyncStatus.d.ts +1 -1
  646. package/src/types/OcaTimeSourceSyncStatus.js +1 -1
  647. package/src/types/OcaTransferFunction.d.ts +1 -1
  648. package/src/types/OcaTransferFunction.js +1 -1
  649. package/src/types/OcaTypedBlob.d.ts +40 -0
  650. package/src/types/OcaTypedBlob.js +24 -0
  651. package/src/types/OcaVariant.d.ts +19 -0
  652. package/src/types/OcaVariant.js +18 -0
  653. package/src/types/OcaWhenPhysicalAbsolute.d.ts +39 -0
  654. package/src/types/OcaWhenPhysicalAbsolute.js +22 -0
  655. package/src/types/OcaWhenPhysicalRelative.d.ts +39 -0
  656. package/src/types/OcaWhenPhysicalRelative.js +22 -0
@@ -1,9 +1,11 @@
1
1
  import { OcaBoolean } from '../../OCP1/OcaBoolean.js';
2
2
  import { OcaFloat32 } from '../../OCP1/OcaFloat32.js';
3
+ import { OcaIODirection } from '../../OCP1/OcaIODirection.js';
3
4
  import { OcaList } from '../../OCP1/OcaList.js';
5
+ import { OcaMap } from '../../OCP1/OcaMap.js';
4
6
  import { OcaPort } from '../../OCP1/OcaPort.js';
7
+ import { OcaPortClockMapEntry } from '../../OCP1/OcaPortClockMapEntry.js';
5
8
  import { OcaPortID } from '../../OCP1/OcaPortID.js';
6
- import { OcaPortMode } from '../../OCP1/OcaPortMode.js';
7
9
  import { OcaString } from '../../OCP1/OcaString.js';
8
10
  import { OcaUint32 } from '../../OCP1/OcaUint32.js';
9
11
  import { make_control_class } from '../make_control_class.js';
@@ -19,12 +21,12 @@ export const OcaWorker = make_control_class(
19
21
  'OcaWorker',
20
22
  2,
21
23
  '\u0001\u0001',
22
- 2,
24
+ 3,
23
25
  OcaRoot,
24
26
  [
25
27
  ['GetEnabled', 2, 1, [], [OcaBoolean]],
26
28
  ['SetEnabled', 2, 2, [OcaBoolean], []],
27
- ['AddPort', 2, 3, [OcaString, OcaPortMode], [OcaPortID]],
29
+ ['AddPort', 2, 3, [OcaString, OcaIODirection], [OcaPortID]],
28
30
  ['DeletePort', 2, 4, [OcaPortID], []],
29
31
  ['GetPorts', 2, 5, [], [OcaList(OcaPort)]],
30
32
  ['GetPortName', 2, 6, [OcaPortID], [OcaString]],
@@ -35,28 +37,40 @@ export const OcaWorker = make_control_class(
35
37
  ['GetLatency', 2, 11, [], [OcaFloat32]],
36
38
  ['SetLatency', 2, 12, [OcaFloat32], []],
37
39
  ['GetPath', 2, 13, [], [OcaList(OcaString), OcaList(OcaUint32)]],
40
+ ['GetPortClockMap', 2, 14, [], [OcaMap(OcaPortID, OcaPortClockMapEntry)]],
41
+ ['SetPortClockMap', 2, 15, [OcaMap(OcaPortID, OcaPortClockMapEntry)], []],
42
+ ['GetPortClockMapEntry', 2, 16, [OcaPortID], [OcaPortClockMapEntry]],
43
+ ['SetPortClockMapEntry', 2, 17, [OcaPortID, OcaPortClockMapEntry], []],
44
+ ['DeletePortClockMapEntry', 2, 18, [OcaPortID], []],
38
45
  ],
39
46
  [
40
47
  ['Enabled', [OcaBoolean], 2, 1, false, false, null],
41
48
  ['Ports', [OcaList(OcaPort)], 2, 2, false, false, null],
42
49
  ['Label', [OcaString], 2, 3, false, false, null],
43
- ['Owner', [OcaUint32], 2, 4, false, false, null],
50
+ ['Owner', [OcaUint32], 2, 4, true, false, null],
44
51
  ['Latency', [OcaFloat32], 2, 5, false, false, null],
52
+ [
53
+ 'PortClockMap',
54
+ [OcaMap(OcaPortID, OcaPortClockMapEntry)],
55
+ 2,
56
+ 6,
57
+ false,
58
+ false,
59
+ null,
60
+ ],
45
61
  ],
46
62
  []
47
63
  );
48
64
 
49
65
  /**
50
- * Gets the value of the Enabled property. The return value indicates whether
51
- * the property was successfully retrieved.
66
+ * Gets the value of the Enabled property.
52
67
  *
53
68
  * @method OcaWorker#GetEnabled
54
69
  * @returns {Promise<boolean>}
55
70
  * A promise which resolves to a single value of type ``boolean``.
56
71
  */
57
72
  /**
58
- * Sets the value of the Enabled property. The return value indicates whether
59
- * the property was successfully set.
73
+ * Sets the value of the Enabled property.
60
74
  *
61
75
  * @method OcaWorker#SetEnabled
62
76
  * @param {boolean} enabled
@@ -64,19 +78,17 @@ export const OcaWorker = make_control_class(
64
78
  * @returns {Promise<void>}
65
79
  */
66
80
  /**
67
- * Adds an input or output port.. The return value indicates whether the port
68
- * was successfully added.
81
+ * Adds an input or output port..
69
82
  *
70
83
  * @method OcaWorker#AddPort
71
- * @param {string} Label
72
- * @param {IOcaPortMode} Mode
84
+ * @param {string} Name
85
+ * @param {IOcaIODirection} Mode
73
86
  *
74
87
  * @returns {Promise<OcaPortID>}
75
88
  * A promise which resolves to a single value of type :class:`OcaPortID`.
76
89
  */
77
90
  /**
78
- * Deletes an input or output port.. The return value indicates whether the port
79
- * was successfully deleted.
91
+ * Deletes an input or output port..
80
92
  *
81
93
  * @method OcaWorker#DeletePort
82
94
  * @param {IOcaPortID} ID
@@ -84,16 +96,14 @@ export const OcaWorker = make_control_class(
84
96
  * @returns {Promise<void>}
85
97
  */
86
98
  /**
87
- * Gets the list of ports owned by the Worker object. The return value indicates
88
- * whether the list was successfully retrieved.
99
+ * Gets the list of ports owned by the Worker object.
89
100
  *
90
101
  * @method OcaWorker#GetPorts
91
102
  * @returns {Promise<OcaPort[]>}
92
103
  * A promise which resolves to a single value of type :class:`OcaPort[]`.
93
104
  */
94
105
  /**
95
- * Gets the name of the designated port. The return value indicates whether the
96
- * name was successfully retrieved.
106
+ * Gets the name of the designated port.
97
107
  *
98
108
  * @method OcaWorker#GetPortName
99
109
  * @param {IOcaPortID} PortID
@@ -102,26 +112,23 @@ export const OcaWorker = make_control_class(
102
112
  * A promise which resolves to a single value of type ``string``.
103
113
  */
104
114
  /**
105
- * Sets the name of the designated port. The return value indicates whether the
106
- * name was successfully set.
115
+ * Sets the name of the designated port.
107
116
  *
108
117
  * @method OcaWorker#SetPortName
109
- * @param {IOcaPortID} PortID
118
+ * @param {IOcaPortID} ID
110
119
  * @param {string} Name
111
120
  *
112
121
  * @returns {Promise<void>}
113
122
  */
114
123
  /**
115
- * Gets the value of the Label property. The return value indicates whether the
116
- * property was successfully retrieved.
124
+ * Gets the value of the Label property.
117
125
  *
118
126
  * @method OcaWorker#GetLabel
119
127
  * @returns {Promise<string>}
120
128
  * A promise which resolves to a single value of type ``string``.
121
129
  */
122
130
  /**
123
- * Sets the value of the Label property. The return value indicates whether the
124
- * property was successfully set.
131
+ * Sets the value of the Label property.
125
132
  *
126
133
  * @method OcaWorker#SetLabel
127
134
  * @param {string} label
@@ -129,24 +136,21 @@ export const OcaWorker = make_control_class(
129
136
  * @returns {Promise<void>}
130
137
  */
131
138
  /**
132
- * Gets the value of the Owner property. The return value indicates whether the
133
- * property was successfully retrieved.
139
+ * Gets the value of the Owner property.
134
140
  *
135
141
  * @method OcaWorker#GetOwner
136
142
  * @returns {Promise<number>}
137
143
  * A promise which resolves to a single value of type ``number``.
138
144
  */
139
145
  /**
140
- * Gets the value of the Latency property. The return value indicates whether
141
- * the property was successfully retrieved.
146
+ * Gets the value of the Latency property.
142
147
  *
143
148
  * @method OcaWorker#GetLatency
144
149
  * @returns {Promise<number>}
145
150
  * A promise which resolves to a single value of type ``number``.
146
151
  */
147
152
  /**
148
- * Sets the value of the Latency property. The return value indicates whether
149
- * the property was successfully set.
153
+ * Sets the value of the Latency property.
150
154
  *
151
155
  * @method OcaWorker#SetLatency
152
156
  * @param {number} latency
@@ -154,23 +158,65 @@ export const OcaWorker = make_control_class(
154
158
  * @returns {Promise<void>}
155
159
  */
156
160
  /**
157
- * Returns path from the given object down to root. The return value indicates
158
- * whether the operation succeeded. Added in version 2.
161
+ * Returns Role Path and ONo Path from the Root Block to this object. The return
162
+ * value indicates whether the operation succeeded.
159
163
  * The return values of this method are
160
164
  *
161
- * - NamePath of type ``string[]``
165
+ * - RolePath of type ``string[]``
162
166
  * - ONoPath of type ``number[]``
163
167
  *
164
168
  * @method OcaWorker#GetPath
165
169
  * @returns {Promise<Arguments<string[],number[]>>}
166
170
  */
171
+ /**
172
+ * Gets the value of the PortClockMap property.
173
+ *
174
+ * @method OcaWorker#GetPortClockMap
175
+ * @returns {Promise<Map<OcaPortID, OcaPortClockMapEntry>>}
176
+ * A promise which resolves to a single value of type ``Map<OcaPortID, OcaPortClockMapEntry>``.
177
+ */
178
+ /**
179
+ * Sets the value of the PortClockMap property.
180
+ *
181
+ * @method OcaWorker#SetPortClockMap
182
+ * @param {Map<IOcaPortID, IOcaPortClockMapEntry>} Map
183
+ *
184
+ * @returns {Promise<void>}
185
+ */
186
+ /**
187
+ * Gets the value of the PortClockMap entry identified by the given PortID.
188
+ *
189
+ * @method OcaWorker#GetPortClockMapEntry
190
+ * @param {IOcaPortID} ID
191
+ *
192
+ * @returns {Promise<OcaPortClockMapEntry>}
193
+ * A promise which resolves to a single value of type :class:`OcaPortClockMapEntry`.
194
+ */
195
+ /**
196
+ * Sets an entry in the PortClockMap property. Adds entry if none already exists
197
+ * for the given port; replaces entry if it does already exist.
198
+ *
199
+ * @method OcaWorker#SetPortClockMapEntry
200
+ * @param {IOcaPortID} PortID
201
+ * @param {IOcaPortClockMapEntry} Entry
202
+ *
203
+ * @returns {Promise<void>}
204
+ */
205
+ /**
206
+ * Deletes PortClockMap entry identified by the given ID.
207
+ *
208
+ * @method OcaWorker#DeletePortClockMapEntry
209
+ * @param {IOcaPortID} ID
210
+ *
211
+ * @returns {Promise<void>}
212
+ */
167
213
  /**
168
214
  * This event is emitted when the property ``Enabled`` changes in the remote object.
169
215
  * The property ``Enabled`` is described in the AES70 standard as follows.
170
216
  * Read/write property that indicates whether the worker object is enabled in
171
217
  * the device. If an object is disabled it cannot be used by the application.
172
218
  * Note that the behavior of a disabled object depends on the object itself
173
- * (e.g. a disabled chime generator is silent, a disabled equalizer is flat,
219
+ * (e.g. a disabled signal generator is silent, a disabled equalizer is flat,
174
220
  * etc.).
175
221
  *
176
222
  * @member {PropertyEvent<boolean>} OcaWorker#OnEnabledChanged
@@ -179,7 +225,7 @@ export const OcaWorker = make_control_class(
179
225
  * This event is emitted when the property ``Ports`` changes in the remote object.
180
226
  * The property ``Ports`` is described in the AES70 standard as follows.
181
227
  * The list of (input and output) OCA ports the worker object has. Note that a
182
- * worker object can have no ports (in which case the list is empty).
228
+ * worker object can have no ports, in which case the list is empty.
183
229
  *
184
230
  * @member {PropertyEvent<OcaPort[]>} OcaWorker#OnPortsChanged
185
231
  */
@@ -191,13 +237,6 @@ export const OcaWorker = make_control_class(
191
237
  *
192
238
  * @member {PropertyEvent<string>} OcaWorker#OnLabelChanged
193
239
  */
194
- /**
195
- * This event is emitted when the property ``Owner`` changes in the remote object.
196
- * The property ``Owner`` is described in the AES70 standard as follows.
197
- * Object number of block that contains this worker.
198
- *
199
- * @member {PropertyEvent<number>} OcaWorker#OnOwnerChanged
200
- */
201
240
  /**
202
241
  * This event is emitted when the property ``Latency`` changes in the remote object.
203
242
  * The property ``Latency`` is described in the AES70 standard as follows.
@@ -206,3 +245,14 @@ export const OcaWorker = make_control_class(
206
245
  *
207
246
  * @member {PropertyEvent<number>} OcaWorker#OnLatencyChanged
208
247
  */
248
+ /**
249
+ * This event is emitted when the property ``PortClockMap`` changes in the remote object.
250
+ * The property ``PortClockMap`` is described in the AES70 standard as follows.
251
+ * **Optional property.** Map that connects OcaMediaClock3 object numbers to
252
+ * input and output OcaPorts and specifies sampling rate converters, if any.
253
+ * OcaPortID = {mode,index}, where mode = Input or Output. Map entries with
254
+ * index=0 are default values, to be used when no entry is found for a given
255
+ * port.
256
+ *
257
+ * @member {PropertyEvent<Map<OcaPortID, OcaPortClockMapEntry>>} OcaWorker#OnPortClockMapChanged
258
+ */
@@ -1,5 +1,34 @@
1
+ import { CloseError } from '../close_error.js';
1
2
  import { OcaEvent } from '../types/OcaEvent.js';
2
3
 
4
+ class EventSubscriber {
5
+ constructor(callback, error_callback) {
6
+ this.callback = callback;
7
+ this.failure_callback = error_callback;
8
+ }
9
+
10
+ emit(ctx, results) {
11
+ try {
12
+ this.callback.apply(ctx, results);
13
+ } catch (error) {
14
+ console.error('Exception thrown by event handler: ', error);
15
+ }
16
+ }
17
+
18
+ emit_error(ctx, error) {
19
+ if (this.error_callback) {
20
+ try {
21
+ this.error_callback.call(ctx, error);
22
+ } catch (e) {
23
+ console.error('Exception thrown by error event handler: ', e);
24
+ }
25
+ } else {
26
+ if (error instanceof CloseError) return;
27
+ console.warn('No handler for error', error);
28
+ }
29
+ }
30
+ }
31
+
3
32
  /**
4
33
  * Base class for all events.
5
34
  */
@@ -7,11 +36,28 @@ export class BaseEvent {
7
36
  constructor(object, id, argumentTypes) {
8
37
  this.object = object;
9
38
  this.id = id;
10
- this.handlers = new Set();
39
+ this.subscribers = [];
11
40
  this.result = null;
12
41
  this.argumentTypes = argumentTypes;
13
42
  }
14
43
 
44
+ has_subscribers() {
45
+ return this.subscribers.length > 0;
46
+ }
47
+
48
+ emit(results) {
49
+ this.subscribers.forEach((subscriber) => {
50
+ subscriber.emit(this.object, results);
51
+ });
52
+ }
53
+
54
+ emit_error(error) {
55
+ this.subscribers.forEach((subscriber) => {
56
+ subscriber.emit_error(this.object, error);
57
+ });
58
+ this.subscribers.splice(0, this.subscribers.length);
59
+ }
60
+
15
61
  GetOcaEvent() {
16
62
  return new OcaEvent(this.object.ObjectNumber, this.id);
17
63
  }
@@ -19,42 +65,46 @@ export class BaseEvent {
19
65
  do_subscribe() {}
20
66
  do_unsubscribe() {}
21
67
 
68
+ _remove_subscriber(index) {
69
+ this.subscribers.splice(index, 1);
70
+
71
+ if (!this.subscribers.length) this.do_unsubscribe();
72
+ }
73
+
22
74
  /**
23
75
  * Subscribe to this event.
24
76
  * @param {function} callback
25
77
  */
26
- subscribe(callback) {
27
- this.handlers.add(callback);
28
-
29
- if (this.handlers.size === 1)
30
- return (this.result = this.do_subscribe().then(() => {
31
- this.result = null;
32
- return true;
33
- }));
78
+ subscribe(callback, failure_callback) {
79
+ const subscriber = new EventSubscriber(callback, failure_callback);
80
+ this.subscribers.push(subscriber);
34
81
 
35
- if (this.result !== null) return this.result;
82
+ if (this.subscribers.length === 1) {
83
+ this.do_subscribe();
84
+ }
36
85
 
37
- return Promise.resolve(true);
86
+ return () => {
87
+ const index = this.subscribers.indexOf(subscriber);
88
+ if (index === -1) return;
89
+ this._remove_subscriber(index);
90
+ };
38
91
  }
39
92
 
40
93
  /**
41
94
  * Unsubscribe from this event.
42
95
  * @param {function} callback
96
+ * @deprecated Use the cleanup handler returned from
97
+ * subscriber() instead.
43
98
  */
44
99
  unsubscribe(callback) {
45
- this.handlers.delete(callback);
100
+ const index = this.subscribers.findIndex(
101
+ (subscriber) => subscriber.callback == callback
102
+ );
46
103
 
47
- if (!this.handlers.size) this.do_unsubscribe().catch(function () {});
48
-
49
- return Promise.resolve(true);
50
- }
51
-
52
- /**
53
- * Unsubscribe all event handlers.
54
- */
55
- Dipose() {
56
- if (this.handlers.size) this.do_unsubscribe().catch(function () {});
104
+ if (index === -1) {
105
+ throw new Error('Subscriber does not exist.');
106
+ }
57
107
 
58
- this.handlers.clear();
108
+ this._remove_subscriber(index);
59
109
  }
60
110
  }
@@ -2,6 +2,32 @@ import { IConnectionOptions, Connection } from '../connection';
2
2
 
3
3
  export type IClientConnectionOptions = IConnectionOptions;
4
4
 
5
+ export interface PendingCommand {
6
+ /**
7
+ * Name of the method being called. The format is
8
+ * Class.Method.
9
+ */
10
+ name: string;
11
+
12
+ /**
13
+ * If stack debug was enabled on the corresponding
14
+ * RemoteDevice, this property contains the stack
15
+ * where the method was called from.
16
+ */
17
+ stack: Error['stack'] | null;
18
+
19
+ /**
20
+ * The command pdu.
21
+ */
22
+ command: unknown;
23
+
24
+ /**
25
+ * If available, returns the arguments of this
26
+ * remote method call.
27
+ */
28
+ get_arguments(): unknwon[] | undefined;
29
+ }
30
+
5
31
  /**
6
32
  * A generic base class for all client connections.
7
33
  */
@@ -1,26 +1,39 @@
1
1
  import { RemoteError } from './remote_error.js';
2
2
  import { Connection } from '../connection.js';
3
3
  import { Response } from '../OCP1/response.js';
4
+ import { CommandRrq } from '../OCP1/commandrrq.js';
4
5
  import { KeepAlive } from '../OCP1/keepalive.js';
5
6
  import { Notification } from '../OCP1/notification.js';
7
+ import { Notification2 } from '../OCP1/notification2.js';
6
8
  import { Arguments } from './arguments.js';
7
9
  import { OcaStatus } from '../types/OcaStatus.js';
10
+ import { EncodedArguments } from '../OCP1/encoded_arguments.js';
11
+ import { CloseError } from '../close_error.js';
8
12
 
9
13
  class PendingCommand {
10
14
  get handle() {
11
15
  return this.command.handle;
12
16
  }
13
17
 
14
- constructor(resolve, reject, returnTypes, command, stack) {
18
+ constructor(resolve, reject, returnTypes, command, stack, name) {
15
19
  this.resolve = resolve;
16
20
  this.reject = reject;
17
21
  this.returnTypes = returnTypes;
18
22
  this.command = command;
19
23
  this.stack = stack;
24
+ this.name = name;
20
25
  this.lastSent = 0;
21
26
  this.retries = 0;
22
27
  }
23
28
 
29
+ get_arguments() {
30
+ const parameters = this.command.parameters;
31
+
32
+ if (parameters && parameters instanceof EncodedArguments) {
33
+ return parameters.data;
34
+ }
35
+ }
36
+
24
37
  handleError(error) {
25
38
  if (this.stack && error instanceof Error) error.stack = this.stack;
26
39
  this.reject(error);
@@ -80,16 +93,21 @@ export class ClientConnection extends Connection {
80
93
  this._subscribers = new Map();
81
94
  }
82
95
 
83
- cleanup() {
84
- super.cleanup();
96
+ cleanup(error) {
97
+ super.cleanup(error);
98
+ const subscribers = this._subscribers;
85
99
  this._subscribers = null;
86
-
87
100
  const pendingCommands = this._pendingCommands;
88
101
  this._pendingCommands = null;
89
- const e = new Error('closed');
102
+
103
+ const e = new CloseError(error);
90
104
  pendingCommands.forEach((pendingCommand, id) => {
91
105
  pendingCommand.handleError(structuredClone(e));
92
106
  });
107
+
108
+ subscribers.forEach((cb) => {
109
+ cb(false, e);
110
+ });
93
111
  }
94
112
 
95
113
  _addSubscriber(event, callback) {
@@ -102,6 +120,7 @@ export class ClientConnection extends Connection {
102
120
  }
103
121
 
104
122
  _removeSubscriber(event) {
123
+ if (this.is_closed()) return;
105
124
  const key = eventToKey(event);
106
125
  const subscribers = this._subscribers;
107
126
 
@@ -130,7 +149,19 @@ export class ClientConnection extends Connection {
130
149
  return this._now();
131
150
  }
132
151
 
133
- send_command(command, returnTypes, callback, stack) {
152
+ find_pending_command(pdu) {
153
+ const pendingCommands = this._pendingCommands;
154
+
155
+ if (pdu instanceof CommandRrq) {
156
+ return pendingCommands.get(pdu.handle);
157
+ } else if (pdu instanceof Response) {
158
+ return pendingCommands.get(pdu.handle);
159
+ } else {
160
+ throw new Error(`Expected command or response.`);
161
+ }
162
+ }
163
+
164
+ send_command(command, returnTypes, callback, stack, name) {
134
165
  const executor = (resolve, reject) => {
135
166
  const handle = this._getNextCommandHandle();
136
167
 
@@ -141,7 +172,8 @@ export class ClientConnection extends Connection {
141
172
  reject,
142
173
  returnTypes,
143
174
  command,
144
- stack
175
+ stack,
176
+ name
145
177
  );
146
178
 
147
179
  this._pendingCommands.set(handle, pendingCommand);
@@ -179,7 +211,7 @@ export class ClientConnection extends Connection {
179
211
  }
180
212
 
181
213
  const o = pdus[i];
182
- //log("INCOMING", o);
214
+ this.emit('receive', o);
183
215
  if (o instanceof Response) {
184
216
  const pendingCommand = this._removePendingCommand(o.handle);
185
217
 
@@ -193,7 +225,7 @@ export class ClientConnection extends Connection {
193
225
  }
194
226
 
195
227
  pendingCommand.response(o);
196
- } else if (o instanceof Notification) {
228
+ } else if (o instanceof Notification || o instanceof Notification2) {
197
229
  const subscribers = this._subscribers;
198
230
  const key = eventToKey(o.event);
199
231
 
@@ -202,8 +234,9 @@ export class ClientConnection extends Connection {
202
234
  if (!cb) {
203
235
  // NOTE: this is legal
204
236
  continue;
237
+ } else {
238
+ cb(true, o);
205
239
  }
206
- cb(o);
207
240
  } else if (o instanceof KeepAlive) {
208
241
  if (!(o.time > 0)) {
209
242
  throw new Error('Bad keepalive timeout.');
@@ -1,5 +1,5 @@
1
1
  import { BaseEvent } from './base_event.js';
2
- import { error } from '../log.js';
2
+ import { NotificationError } from './notification_error.js';
3
3
 
4
4
  const emptyBuffer = new ArrayBuffer();
5
5
 
@@ -11,8 +11,18 @@ const emptyBuffer = new ArrayBuffer();
11
11
  export class Event extends BaseEvent {
12
12
  constructor(object, id, argumentTypes) {
13
13
  super(object, id, argumentTypes);
14
- this.callback = (notification) => {
15
- if (!this.handlers.size) return;
14
+ this.callback = (ok, notification) => {
15
+ if (!ok) {
16
+ this.emit_error(notification);
17
+ return;
18
+ }
19
+
20
+ if (!this.has_subscribers()) return;
21
+
22
+ if (notification.exception) {
23
+ this.emit_error(new NotificationError(notification));
24
+ return;
25
+ }
16
26
 
17
27
  const args = new Array(argumentTypes.length);
18
28
  // Events without arguments have parameters = null
@@ -23,28 +33,15 @@ export class Event extends BaseEvent {
23
33
  [pos, tmp] = argumentTypes[i].decodeFrom(data, pos);
24
34
  args[i] = tmp;
25
35
  }
26
- const object = this.object;
27
- this.handlers.forEach(function (callback) {
28
- try {
29
- callback.apply(object, args);
30
- } catch (e) {
31
- error(e);
32
- }
33
- });
36
+ this.emit(args);
34
37
  };
35
38
  }
36
39
 
37
40
  do_subscribe() {
38
- return this.object.device.add_subscription(
39
- this.GetOcaEvent(),
40
- this.callback
41
- );
41
+ this.object.device.add_subscription(this.GetOcaEvent(), this.callback);
42
42
  }
43
43
 
44
- do_unsubscribe(callback) {
45
- return this.object.device.remove_subscription(
46
- this.GetOcaEvent(),
47
- this.callback
48
- );
44
+ do_unsubscribe() {
45
+ this.object.device.remove_subscription(this.GetOcaEvent(), this.callback);
49
46
  }
50
47
  }
@@ -58,6 +58,8 @@ function implement_method(cls, method) {
58
58
 
59
59
  const [name, level, index, argumentTypes, returnTypes, aliases] = method;
60
60
 
61
+ const debugName = `${cls.ClassName}.${name}`;
62
+
61
63
  cls.prototype[name] = function (...args) {
62
64
  const argumentCount = argumentTypes.length;
63
65
  let callback = null;
@@ -86,7 +88,7 @@ function implement_method(cls, method) {
86
88
  argumentCount,
87
89
  new EncodedArguments(argumentTypes, args)
88
90
  );
89
- return this.device.send_command(cmd, returnTypes, callback);
91
+ return this.device.send_command(cmd, returnTypes, callback, debugName);
90
92
  };
91
93
 
92
94
  if (aliases) {
@@ -0,0 +1,40 @@
1
+ export class OcaNotificationExceptionType {
2
+ static Unspecified: OcaNotificationExceptionType;
3
+ // Device canceled subscription
4
+ static CanceledByDevice: OcaNotificationExceptionType;
5
+ // Object was deleted
6
+ static ObjectDeleted: OcaNotificationExceptionType;
7
+ // Something went wrong in the Device.
8
+ static DeviceError: OcaNotificationExceptionType;
9
+
10
+ /**
11
+ * Returns the numeric value of this enum entry.
12
+ */
13
+ valueOf(): number;
14
+
15
+ /**
16
+ * Returns the string representation of this enum entry.
17
+ */
18
+ toString(): string;
19
+
20
+ /**
21
+ * Returns the name of an enum entry.
22
+ */
23
+ static getName(value: number): string;
24
+
25
+ /**
26
+ * Returns the value of an enum entry name.
27
+ */
28
+ static getValue(name: string): number;
29
+ }
30
+
31
+ export declare class NotificationError extends Error {
32
+ notification: unknown;
33
+ type: OcaNotificationExceptionType;
34
+ try_again: boolean;
35
+ data: ArrayBuffer | null;
36
+
37
+ constructor(notification: unknown);
38
+
39
+ is_object_deleted(): boolean;
40
+ }