hap-nodejs 0.11.0-beta.13 → 0.11.0-beta.15

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 (221) hide show
  1. package/dist/BridgedCore.js +4 -4
  2. package/dist/BridgedCore.js.map +1 -1
  3. package/dist/Core.js +2 -2
  4. package/dist/Core.js.map +1 -1
  5. package/dist/accessories/AirConditioner_accessory.js +18 -18
  6. package/dist/accessories/AirConditioner_accessory.js.map +1 -1
  7. package/dist/accessories/AppleTVRemote_accessory.js +6 -6
  8. package/dist/accessories/AppleTVRemote_accessory.js.map +1 -1
  9. package/dist/accessories/Camera_accessory.js +96 -87
  10. package/dist/accessories/Camera_accessory.js.map +1 -1
  11. package/dist/accessories/Fan_accessory.js +6 -6
  12. package/dist/accessories/Fan_accessory.js.map +1 -1
  13. package/dist/accessories/GarageDoorOpener_accessory.js +4 -4
  14. package/dist/accessories/GarageDoorOpener_accessory.js.map +1 -1
  15. package/dist/accessories/Light-AdaptiveLighting_accessory.js +2 -2
  16. package/dist/accessories/Light-AdaptiveLighting_accessory.js.map +1 -1
  17. package/dist/accessories/Light_accessory.js +10 -10
  18. package/dist/accessories/Light_accessory.js.map +1 -1
  19. package/dist/accessories/Lock_accessory.js +4 -4
  20. package/dist/accessories/Lock_accessory.js.map +1 -1
  21. package/dist/accessories/MotionSensor_accessory.js +3 -3
  22. package/dist/accessories/MotionSensor_accessory.js.map +1 -1
  23. package/dist/accessories/Outlet_accessory.js +4 -4
  24. package/dist/accessories/Outlet_accessory.js.map +1 -1
  25. package/dist/accessories/SmartSpeaker_accessory.js +5 -5
  26. package/dist/accessories/SmartSpeaker_accessory.js.map +1 -1
  27. package/dist/accessories/Sprinkler_accessory.js +7 -7
  28. package/dist/accessories/Sprinkler_accessory.js.map +1 -1
  29. package/dist/accessories/TV_accessory.js +9 -9
  30. package/dist/accessories/TV_accessory.js.map +1 -1
  31. package/dist/accessories/TemperatureSensor_accessory.js +2 -2
  32. package/dist/accessories/TemperatureSensor_accessory.js.map +1 -1
  33. package/dist/accessories/Wi-FiRouter_accessory.js +2 -2
  34. package/dist/accessories/Wi-FiRouter_accessory.js.map +1 -1
  35. package/dist/accessories/Wi-FiSatellite_accessory.js +2 -2
  36. package/dist/accessories/Wi-FiSatellite_accessory.js.map +1 -1
  37. package/dist/accessories/gstreamer-audioProducer.d.ts +2 -2
  38. package/dist/accessories/gstreamer-audioProducer.d.ts.map +1 -1
  39. package/dist/accessories/gstreamer-audioProducer.js +20 -20
  40. package/dist/accessories/gstreamer-audioProducer.js.map +1 -1
  41. package/dist/index.d.ts +30 -6
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +39 -25
  44. package/dist/index.js.map +1 -1
  45. package/dist/internal-types.d.ts +20 -125
  46. package/dist/internal-types.d.ts.map +1 -1
  47. package/dist/internal-types.js +15 -5
  48. package/dist/internal-types.js.map +1 -1
  49. package/dist/lib/Accessory.d.ts +71 -10
  50. package/dist/lib/Accessory.d.ts.map +1 -1
  51. package/dist/lib/Accessory.js +168 -148
  52. package/dist/lib/Accessory.js.map +1 -1
  53. package/dist/lib/AccessoryLoader.d.ts +12 -0
  54. package/dist/lib/AccessoryLoader.d.ts.map +1 -1
  55. package/dist/lib/AccessoryLoader.js +18 -6
  56. package/dist/lib/AccessoryLoader.js.map +1 -1
  57. package/dist/lib/Advertiser.d.ts +26 -0
  58. package/dist/lib/Advertiser.d.ts.map +1 -1
  59. package/dist/lib/Advertiser.js +59 -39
  60. package/dist/lib/Advertiser.js.map +1 -1
  61. package/dist/lib/Bridge.d.ts +2 -0
  62. package/dist/lib/Bridge.d.ts.map +1 -1
  63. package/dist/lib/Bridge.js +3 -1
  64. package/dist/lib/Bridge.js.map +1 -1
  65. package/dist/lib/Characteristic.d.ts +818 -13
  66. package/dist/lib/Characteristic.d.ts.map +1 -1
  67. package/dist/lib/Characteristic.js +155 -127
  68. package/dist/lib/Characteristic.js.map +1 -1
  69. package/dist/lib/HAPServer.d.ts +72 -18
  70. package/dist/lib/HAPServer.d.ts.map +1 -1
  71. package/dist/lib/HAPServer.js +178 -160
  72. package/dist/lib/HAPServer.js.map +1 -1
  73. package/dist/lib/Service.d.ts +266 -14
  74. package/dist/lib/Service.d.ts.map +1 -1
  75. package/dist/lib/Service.js +36 -35
  76. package/dist/lib/Service.js.map +1 -1
  77. package/dist/lib/camera/Camera.d.ts +13 -4
  78. package/dist/lib/camera/Camera.d.ts.map +1 -1
  79. package/dist/lib/camera/Camera.js +3 -0
  80. package/dist/lib/camera/Camera.js.map +1 -1
  81. package/dist/lib/camera/RTPProxy.d.ts +5 -0
  82. package/dist/lib/camera/RTPProxy.d.ts.map +1 -1
  83. package/dist/lib/camera/RTPProxy.js +2 -1
  84. package/dist/lib/camera/RTPProxy.js.map +1 -1
  85. package/dist/lib/camera/RTPStreamManagement.d.ts +154 -31
  86. package/dist/lib/camera/RTPStreamManagement.d.ts.map +1 -1
  87. package/dist/lib/camera/RTPStreamManagement.js +198 -161
  88. package/dist/lib/camera/RTPStreamManagement.js.map +1 -1
  89. package/dist/lib/camera/RecordingManagement.d.ts +61 -11
  90. package/dist/lib/camera/RecordingManagement.d.ts.map +1 -1
  91. package/dist/lib/camera/RecordingManagement.js +171 -138
  92. package/dist/lib/camera/RecordingManagement.js.map +1 -1
  93. package/dist/lib/camera/index.js +4 -4
  94. package/dist/lib/camera/index.js.map +1 -1
  95. package/dist/lib/controller/AdaptiveLightingController.d.ts +28 -2
  96. package/dist/lib/controller/AdaptiveLightingController.d.ts.map +1 -1
  97. package/dist/lib/controller/AdaptiveLightingController.js +72 -65
  98. package/dist/lib/controller/AdaptiveLightingController.js.map +1 -1
  99. package/dist/lib/controller/CameraController.d.ts +44 -13
  100. package/dist/lib/controller/CameraController.d.ts.map +1 -1
  101. package/dist/lib/controller/CameraController.js +42 -34
  102. package/dist/lib/controller/CameraController.js.map +1 -1
  103. package/dist/lib/controller/Controller.d.ts +28 -7
  104. package/dist/lib/controller/Controller.d.ts.map +1 -1
  105. package/dist/lib/controller/Controller.js +7 -0
  106. package/dist/lib/controller/Controller.js.map +1 -1
  107. package/dist/lib/controller/DoorbellController.d.ts +5 -1
  108. package/dist/lib/controller/DoorbellController.d.ts.map +1 -1
  109. package/dist/lib/controller/DoorbellController.js +5 -3
  110. package/dist/lib/controller/DoorbellController.js.map +1 -1
  111. package/dist/lib/controller/RemoteController.d.ts +108 -39
  112. package/dist/lib/controller/RemoteController.d.ts.map +1 -1
  113. package/dist/lib/controller/RemoteController.js +190 -175
  114. package/dist/lib/controller/RemoteController.js.map +1 -1
  115. package/dist/lib/controller/index.js +5 -5
  116. package/dist/lib/controller/index.js.map +1 -1
  117. package/dist/lib/datastream/DataStreamManagement.d.ts +25 -19
  118. package/dist/lib/datastream/DataStreamManagement.d.ts.map +1 -1
  119. package/dist/lib/datastream/DataStreamManagement.js +36 -30
  120. package/dist/lib/datastream/DataStreamManagement.js.map +1 -1
  121. package/dist/lib/datastream/DataStreamParser.d.ts +39 -0
  122. package/dist/lib/datastream/DataStreamParser.d.ts.map +1 -1
  123. package/dist/lib/datastream/DataStreamParser.js +125 -88
  124. package/dist/lib/datastream/DataStreamParser.js.map +1 -1
  125. package/dist/lib/datastream/DataStreamServer.d.ts +121 -46
  126. package/dist/lib/datastream/DataStreamServer.d.ts.map +1 -1
  127. package/dist/lib/datastream/DataStreamServer.js +134 -100
  128. package/dist/lib/datastream/DataStreamServer.js.map +1 -1
  129. package/dist/lib/datastream/index.js +3 -3
  130. package/dist/lib/datastream/index.js.map +1 -1
  131. package/dist/lib/definitions/CharacteristicDefinitions.js +799 -799
  132. package/dist/lib/definitions/CharacteristicDefinitions.js.map +1 -1
  133. package/dist/lib/definitions/ServiceDefinitions.js +77 -77
  134. package/dist/lib/definitions/ServiceDefinitions.js.map +1 -1
  135. package/dist/lib/definitions/generate-definitions.js +60 -59
  136. package/dist/lib/definitions/generate-definitions.js.map +1 -1
  137. package/dist/lib/definitions/generator-configuration.js +15 -15
  138. package/dist/lib/definitions/generator-configuration.js.map +1 -1
  139. package/dist/lib/definitions/index.js +2 -2
  140. package/dist/lib/definitions/index.js.map +1 -1
  141. package/dist/lib/model/AccessoryInfo.d.ts +10 -4
  142. package/dist/lib/model/AccessoryInfo.d.ts.map +1 -1
  143. package/dist/lib/model/AccessoryInfo.js +21 -17
  144. package/dist/lib/model/AccessoryInfo.js.map +1 -1
  145. package/dist/lib/model/ControllerStorage.d.ts +3 -0
  146. package/dist/lib/model/ControllerStorage.d.ts.map +1 -1
  147. package/dist/lib/model/ControllerStorage.js +8 -5
  148. package/dist/lib/model/ControllerStorage.js.map +1 -1
  149. package/dist/lib/model/HAPStorage.d.ts +3 -0
  150. package/dist/lib/model/HAPStorage.d.ts.map +1 -1
  151. package/dist/lib/model/HAPStorage.js +4 -1
  152. package/dist/lib/model/HAPStorage.js.map +1 -1
  153. package/dist/lib/model/IdentifierCache.d.ts +1 -0
  154. package/dist/lib/model/IdentifierCache.d.ts.map +1 -1
  155. package/dist/lib/model/IdentifierCache.js +3 -2
  156. package/dist/lib/model/IdentifierCache.js.map +1 -1
  157. package/dist/lib/tv/AccessControlManagement.d.ts +11 -0
  158. package/dist/lib/tv/AccessControlManagement.d.ts.map +1 -1
  159. package/dist/lib/tv/AccessControlManagement.js +15 -7
  160. package/dist/lib/tv/AccessControlManagement.js.map +1 -1
  161. package/dist/lib/util/clone.d.ts +2 -1
  162. package/dist/lib/util/clone.d.ts.map +1 -1
  163. package/dist/lib/util/clone.js +5 -4
  164. package/dist/lib/util/clone.js.map +1 -1
  165. package/dist/lib/util/color-utils.d.ts +3 -0
  166. package/dist/lib/util/color-utils.d.ts.map +1 -1
  167. package/dist/lib/util/color-utils.js +4 -1
  168. package/dist/lib/util/color-utils.js.map +1 -1
  169. package/dist/lib/util/eventedhttp.d.ts +34 -5
  170. package/dist/lib/util/eventedhttp.d.ts.map +1 -1
  171. package/dist/lib/util/eventedhttp.js +62 -51
  172. package/dist/lib/util/eventedhttp.js.map +1 -1
  173. package/dist/lib/util/hapCrypto.d.ts +27 -0
  174. package/dist/lib/util/hapCrypto.d.ts.map +1 -1
  175. package/dist/lib/util/hapCrypto.js +28 -4
  176. package/dist/lib/util/hapCrypto.js.map +1 -1
  177. package/dist/lib/util/hapStatusError.d.ts +2 -0
  178. package/dist/lib/util/hapStatusError.d.ts.map +1 -1
  179. package/dist/lib/util/hapStatusError.js +4 -2
  180. package/dist/lib/util/hapStatusError.js.map +1 -1
  181. package/dist/lib/util/net-utils.d.ts +7 -0
  182. package/dist/lib/util/net-utils.d.ts.map +1 -1
  183. package/dist/lib/util/net-utils.js +11 -4
  184. package/dist/lib/util/net-utils.js.map +1 -1
  185. package/dist/lib/util/once.d.ts +5 -0
  186. package/dist/lib/util/once.d.ts.map +1 -1
  187. package/dist/lib/util/once.js +6 -1
  188. package/dist/lib/util/once.js.map +1 -1
  189. package/dist/lib/util/promise-utils.d.ts +9 -0
  190. package/dist/lib/util/promise-utils.d.ts.map +1 -1
  191. package/dist/lib/util/promise-utils.js +3 -0
  192. package/dist/lib/util/promise-utils.js.map +1 -1
  193. package/dist/lib/util/request-util.d.ts +16 -0
  194. package/dist/lib/util/request-util.d.ts.map +1 -1
  195. package/dist/lib/util/request-util.js +42 -27
  196. package/dist/lib/util/request-util.js.map +1 -1
  197. package/dist/lib/util/time.d.ts +6 -0
  198. package/dist/lib/util/time.d.ts.map +1 -1
  199. package/dist/lib/util/time.js +7 -1
  200. package/dist/lib/util/time.js.map +1 -1
  201. package/dist/lib/util/tlv.d.ts +33 -2
  202. package/dist/lib/util/tlv.d.ts.map +1 -1
  203. package/dist/lib/util/tlv.js +29 -5
  204. package/dist/lib/util/tlv.js.map +1 -1
  205. package/dist/lib/util/uuid.d.ts +2 -3
  206. package/dist/lib/util/uuid.d.ts.map +1 -1
  207. package/dist/lib/util/uuid.js +1 -1
  208. package/dist/lib/util/uuid.js.map +1 -1
  209. package/dist/types.d.ts +264 -20
  210. package/dist/types.d.ts.map +1 -1
  211. package/dist/types.js +8 -0
  212. package/dist/types.js.map +1 -1
  213. package/package.json +5 -4
  214. package/dist/lib/util/HAPHTTPError.d.ts +0 -16
  215. package/dist/lib/util/HAPHTTPError.d.ts.map +0 -1
  216. package/dist/lib/util/HAPHTTPError.js +0 -26
  217. package/dist/lib/util/HAPHTTPError.js.map +0 -1
  218. package/dist/lib/util/tlvError.d.ts +0 -14
  219. package/dist/lib/util/tlvError.d.ts.map +0 -1
  220. package/dist/lib/util/tlvError.js +0 -24
  221. package/dist/lib/util/tlvError.js.map +0 -1
@@ -1,21 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StreamController = exports.RTPStreamManagement = exports.StreamRequestTypes = exports.AudioStreamingSamplerate = exports.AudioStreamingCodecType = exports.SRTPCryptoSuites = exports.H264Level = exports.H264Profile = exports.VideoCodecType = void 0;
3
+ exports.StreamController = exports.RTPStreamManagement = exports.StreamRequestTypes = exports.AudioStreamingSamplerate = exports.AudioStreamingCodecType = exports.SRTPCryptoSuites = exports.AudioSamplerate = exports.AudioBitrate = exports.VideoCodecPacketizationMode = exports.H264Level = exports.H264Profile = exports.VideoCodecType = void 0;
4
4
  var tslib_1 = require("tslib");
5
- var assert_1 = (0, tslib_1.__importDefault)(require("assert"));
6
- var crypto_1 = (0, tslib_1.__importDefault)(require("crypto"));
7
- var debug_1 = (0, tslib_1.__importDefault)(require("debug"));
8
- var net_1 = (0, tslib_1.__importDefault)(require("net"));
5
+ var assert_1 = tslib_1.__importDefault(require("assert"));
6
+ var crypto_1 = tslib_1.__importDefault(require("crypto"));
7
+ var debug_1 = tslib_1.__importDefault(require("debug"));
8
+ var net_1 = tslib_1.__importDefault(require("net"));
9
9
  var Characteristic_1 = require("../Characteristic");
10
10
  var controller_1 = require("../controller");
11
11
  var Service_1 = require("../Service");
12
12
  var hapStatusError_1 = require("../util/hapStatusError");
13
13
  var once_1 = require("../util/once");
14
- var tlv = (0, tslib_1.__importStar)(require("../util/tlv"));
15
- var uuid = (0, tslib_1.__importStar)(require("../util/uuid"));
14
+ var tlv = tslib_1.__importStar(require("../util/tlv"));
15
+ var uuid = tslib_1.__importStar(require("../util/uuid"));
16
16
  // noinspection JSDeprecatedSymbols
17
17
  var Camera_1 = require("./Camera");
18
- var RTPProxy_1 = (0, tslib_1.__importDefault)(require("./RTPProxy"));
18
+ var RTPProxy_1 = tslib_1.__importDefault(require("./RTPProxy"));
19
19
  var debug = (0, debug_1.default)("HAP-NodeJS:Camera:RTPStreamManagement");
20
20
  // ---------------------------------- TLV DEFINITIONS START ----------------------------------
21
21
  var StreamingStatusTypes;
@@ -53,28 +53,40 @@ var VideoAttributesTypes;
53
53
  VideoAttributesTypes[VideoAttributesTypes["IMAGE_HEIGHT"] = 2] = "IMAGE_HEIGHT";
54
54
  VideoAttributesTypes[VideoAttributesTypes["FRAME_RATE"] = 3] = "FRAME_RATE";
55
55
  })(VideoAttributesTypes || (VideoAttributesTypes = {}));
56
+ /**
57
+ * @group Camera
58
+ */
56
59
  var VideoCodecType;
57
60
  (function (VideoCodecType) {
58
61
  VideoCodecType[VideoCodecType["H264"] = 0] = "H264";
59
62
  // while the namespace is already reserved for H265 it isn't currently supported.
60
63
  // H265 = 0x01,
61
64
  })(VideoCodecType = exports.VideoCodecType || (exports.VideoCodecType = {}));
65
+ /**
66
+ * @group Camera
67
+ */
62
68
  var H264Profile;
63
69
  (function (H264Profile) {
64
70
  H264Profile[H264Profile["BASELINE"] = 0] = "BASELINE";
65
71
  H264Profile[H264Profile["MAIN"] = 1] = "MAIN";
66
72
  H264Profile[H264Profile["HIGH"] = 2] = "HIGH";
67
73
  })(H264Profile = exports.H264Profile || (exports.H264Profile = {}));
74
+ /**
75
+ * @group Camera
76
+ */
68
77
  var H264Level;
69
78
  (function (H264Level) {
70
79
  H264Level[H264Level["LEVEL3_1"] = 0] = "LEVEL3_1";
71
80
  H264Level[H264Level["LEVEL3_2"] = 1] = "LEVEL3_2";
72
81
  H264Level[H264Level["LEVEL4_0"] = 2] = "LEVEL4_0";
73
82
  })(H264Level = exports.H264Level || (exports.H264Level = {}));
83
+ /**
84
+ * @group Camera
85
+ */
74
86
  var VideoCodecPacketizationMode;
75
87
  (function (VideoCodecPacketizationMode) {
76
88
  VideoCodecPacketizationMode[VideoCodecPacketizationMode["NON_INTERLEAVED"] = 0] = "NON_INTERLEAVED";
77
- })(VideoCodecPacketizationMode || (VideoCodecPacketizationMode = {}));
89
+ })(VideoCodecPacketizationMode = exports.VideoCodecPacketizationMode || (exports.VideoCodecPacketizationMode = {}));
78
90
  var VideoCodecCVO;
79
91
  (function (VideoCodecCVO) {
80
92
  VideoCodecCVO[VideoCodecCVO["UNSUPPORTED"] = 0] = "UNSUPPORTED";
@@ -108,11 +120,17 @@ var AudioCodecParametersTypes;
108
120
  AudioCodecParametersTypes[AudioCodecParametersTypes["SAMPLE_RATE"] = 3] = "SAMPLE_RATE";
109
121
  AudioCodecParametersTypes[AudioCodecParametersTypes["PACKET_TIME"] = 4] = "PACKET_TIME"; // only present in selected audio codec parameters tlv
110
122
  })(AudioCodecParametersTypes || (AudioCodecParametersTypes = {}));
123
+ /**
124
+ * @group Camera
125
+ */
111
126
  var AudioBitrate;
112
127
  (function (AudioBitrate) {
113
128
  AudioBitrate[AudioBitrate["VARIABLE"] = 0] = "VARIABLE";
114
129
  AudioBitrate[AudioBitrate["CONSTANT"] = 1] = "CONSTANT";
115
- })(AudioBitrate || (AudioBitrate = {}));
130
+ })(AudioBitrate = exports.AudioBitrate || (exports.AudioBitrate = {}));
131
+ /**
132
+ * @group Camera
133
+ */
116
134
  var AudioSamplerate;
117
135
  (function (AudioSamplerate) {
118
136
  AudioSamplerate[AudioSamplerate["KHZ_8"] = 0] = "KHZ_8";
@@ -120,12 +138,15 @@ var AudioSamplerate;
120
138
  AudioSamplerate[AudioSamplerate["KHZ_24"] = 2] = "KHZ_24";
121
139
  // 3, 4, 5 are theoretically defined, but no idea to what kHz value they correspond to
122
140
  // probably KHZ_32, KHZ_44_1, KHZ_48 (as supported by Secure Video recordings)
123
- })(AudioSamplerate || (AudioSamplerate = {}));
141
+ })(AudioSamplerate = exports.AudioSamplerate || (exports.AudioSamplerate = {}));
124
142
  // ----------
125
143
  var SupportedRTPConfigurationTypes;
126
144
  (function (SupportedRTPConfigurationTypes) {
127
145
  SupportedRTPConfigurationTypes[SupportedRTPConfigurationTypes["SRTP_CRYPTO_SUITE"] = 2] = "SRTP_CRYPTO_SUITE";
128
146
  })(SupportedRTPConfigurationTypes || (SupportedRTPConfigurationTypes = {}));
147
+ /**
148
+ * @group Camera
149
+ */
129
150
  var SRTPCryptoSuites;
130
151
  (function (SRTPCryptoSuites) {
131
152
  SRTPCryptoSuites[SRTPCryptoSuites["AES_CM_128_HMAC_SHA1_80"] = 0] = "AES_CM_128_HMAC_SHA1_80";
@@ -228,6 +249,9 @@ var AudioRTPParametersTypes;
228
249
  function isLegacySRTPOptions(options) {
229
250
  return "srtp" in options;
230
251
  }
252
+ /**
253
+ * @group Camera
254
+ */
231
255
  var AudioStreamingCodecType;
232
256
  (function (AudioStreamingCodecType) {
233
257
  AudioStreamingCodecType["PCMU"] = "PCMU";
@@ -238,23 +262,35 @@ var AudioStreamingCodecType;
238
262
  AudioStreamingCodecType["AMR"] = "AMR";
239
263
  AudioStreamingCodecType["AMR_WB"] = "AMR-WB";
240
264
  })(AudioStreamingCodecType = exports.AudioStreamingCodecType || (exports.AudioStreamingCodecType = {}));
265
+ /**
266
+ * @group Camera
267
+ */
241
268
  var AudioStreamingSamplerate;
242
269
  (function (AudioStreamingSamplerate) {
243
270
  AudioStreamingSamplerate[AudioStreamingSamplerate["KHZ_8"] = 8] = "KHZ_8";
244
271
  AudioStreamingSamplerate[AudioStreamingSamplerate["KHZ_16"] = 16] = "KHZ_16";
245
272
  AudioStreamingSamplerate[AudioStreamingSamplerate["KHZ_24"] = 24] = "KHZ_24";
246
273
  })(AudioStreamingSamplerate = exports.AudioStreamingSamplerate || (exports.AudioStreamingSamplerate = {}));
274
+ /**
275
+ * @group Camera
276
+ */
247
277
  var StreamRequestTypes;
248
278
  (function (StreamRequestTypes) {
249
279
  StreamRequestTypes["RECONFIGURE"] = "reconfigure";
250
280
  StreamRequestTypes["START"] = "start";
251
281
  StreamRequestTypes["STOP"] = "stop";
252
282
  })(StreamRequestTypes = exports.StreamRequestTypes || (exports.StreamRequestTypes = {}));
283
+ /**
284
+ * @group Camera
285
+ */
253
286
  var RTPStreamManagement = /** @class */ (function () {
254
287
  function RTPStreamManagement(id, options, delegate, service, disabledThroughOperatingMode) {
255
288
  this.videoOnly = false;
256
289
  this.sessionIdentifier = undefined;
257
- this.streamStatus = 0 /* AVAILABLE */; // use _updateStreamStatus to update this property
290
+ /**
291
+ * @private private API
292
+ */
293
+ this.streamStatus = 0 /* StreamingStatus.AVAILABLE */; // use _updateStreamStatus to update this property
258
294
  this.selectedConfiguration = ""; // base64 representation of the currently selected configuration
259
295
  this.setupEndpointsResponse = ""; // response of the SetupEndpoints Characteristic
260
296
  this.id = id;
@@ -262,13 +298,13 @@ var RTPStreamManagement = /** @class */ (function () {
262
298
  this.requireProxy = options.proxy || false;
263
299
  this.disableAudioProxy = options.disable_audio_proxy || false;
264
300
  if (isLegacySRTPOptions(options)) {
265
- this.supportedCryptoSuites = [options.srtp ? 0 /* AES_CM_128_HMAC_SHA1_80 */ : 2 /* NONE */];
301
+ this.supportedCryptoSuites = [options.srtp ? 0 /* SRTPCryptoSuites.AES_CM_128_HMAC_SHA1_80 */ : 2 /* SRTPCryptoSuites.NONE */];
266
302
  }
267
303
  else {
268
304
  this.supportedCryptoSuites = options.supportedCryptoSuites;
269
305
  }
270
306
  if (this.supportedCryptoSuites.length === 0) {
271
- this.supportedCryptoSuites.push(2 /* NONE */);
307
+ this.supportedCryptoSuites.push(2 /* SRTPCryptoSuites.NONE */);
272
308
  }
273
309
  if (!options.video) {
274
310
  throw new Error("Video parameters cannot be undefined in options");
@@ -324,35 +360,35 @@ var RTPStreamManagement = /** @class */ (function () {
324
360
  this.service.setCharacteristic(Characteristic_1.Characteristic.Active, true);
325
361
  }
326
362
  this.service.getCharacteristic(Characteristic_1.Characteristic.Active)
327
- .on("change" /* CHANGE */, function () { var _a; return (_a = _this.stateChangeDelegate) === null || _a === void 0 ? void 0 : _a.call(_this); })
328
- .setProps({ adminOnlyAccess: [1 /* WRITE */] });
363
+ .on("change" /* CharacteristicEventTypes.CHANGE */, function () { var _a; return (_a = _this.stateChangeDelegate) === null || _a === void 0 ? void 0 : _a.call(_this); })
364
+ .setProps({ adminOnlyAccess: [1 /* Access.WRITE */] });
329
365
  // ensure that configurations are up-to-date and reflected in the characteristic values
330
366
  this.service.setCharacteristic(Characteristic_1.Characteristic.SupportedRTPConfiguration, this.supportedRTPConfiguration);
331
367
  this.service.setCharacteristic(Characteristic_1.Characteristic.SupportedVideoStreamConfiguration, this.supportedVideoStreamConfiguration);
332
368
  this.service.setCharacteristic(Characteristic_1.Characteristic.SupportedAudioStreamConfiguration, this.supportedAudioStreamConfiguration);
333
- this._updateStreamStatus(0 /* AVAILABLE */); // reset streaming status to available
369
+ this._updateStreamStatus(0 /* StreamingStatus.AVAILABLE */); // reset streaming status to available
334
370
  this.service.setCharacteristic(Characteristic_1.Characteristic.SetupEndpoints, this.setupEndpointsResponse); // reset SetupEndpoints to default
335
371
  this.service.getCharacteristic(Characteristic_1.Characteristic.SelectedRTPStreamConfiguration)
336
- .on("get" /* GET */, function (callback) {
372
+ .on("get" /* CharacteristicEventTypes.GET */, function (callback) {
337
373
  if (_this.streamingIsDisabled()) {
338
- callback(null, tlv.encode(1 /* SESSION_CONTROL */, tlv.encode(2 /* COMMAND */, SessionControlCommand.SUSPEND_SESSION)).toString("base64"));
374
+ callback(null, tlv.encode(1 /* SelectedRTPStreamConfigurationTypes.SESSION_CONTROL */, tlv.encode(2 /* SessionControlTypes.COMMAND */, SessionControlCommand.SUSPEND_SESSION)).toString("base64"));
339
375
  return;
340
376
  }
341
377
  callback(null, _this.selectedConfiguration);
342
378
  })
343
- .on("set" /* SET */, this._handleSelectedStreamConfigurationWrite.bind(this));
379
+ .on("set" /* CharacteristicEventTypes.SET */, this._handleSelectedStreamConfigurationWrite.bind(this));
344
380
  this.service.getCharacteristic(Characteristic_1.Characteristic.SetupEndpoints)
345
- .on("get" /* GET */, function (callback) {
381
+ .on("get" /* CharacteristicEventTypes.GET */, function (callback) {
346
382
  if (_this.streamingIsDisabled()) {
347
- callback(null, tlv.encode(2 /* STATUS */, 2 /* ERROR */).toString("base64"));
383
+ callback(null, tlv.encode(2 /* SetupEndpointsResponseTypes.STATUS */, 2 /* SetupEndpointsStatus.ERROR */).toString("base64"));
348
384
  return;
349
385
  }
350
386
  callback(null, _this.setupEndpointsResponse);
351
387
  })
352
- .on("set" /* SET */, function (value, callback, context, connection) {
388
+ .on("set" /* CharacteristicEventTypes.SET */, function (value, callback, context, connection) {
353
389
  if (!connection) {
354
390
  debug("Set event handler for SetupEndpoints cannot be called from plugin. Connection undefined!");
355
- callback(-70410 /* INVALID_VALUE_IN_REQUEST */);
391
+ callback(-70410 /* HAPStatus.INVALID_VALUE_IN_REQUEST */);
356
392
  return;
357
393
  }
358
394
  _this.handleSetupEndpoints(value, callback, connection);
@@ -362,10 +398,10 @@ var RTPStreamManagement = /** @class */ (function () {
362
398
  this.resetSelectedStreamConfiguration();
363
399
  this.resetSetupEndpointsResponse();
364
400
  if (this.activeConnection) {
365
- this.activeConnection.removeListener("closed" /* CLOSED */, this.activeConnectionClosedListener);
401
+ this.activeConnection.removeListener("closed" /* HAPConnectionEvent.CLOSED */, this.activeConnectionClosedListener);
366
402
  this.activeConnection = undefined;
367
403
  }
368
- this._updateStreamStatus(0 /* AVAILABLE */);
404
+ this._updateStreamStatus(0 /* StreamingStatus.AVAILABLE */);
369
405
  this.sessionIdentifier = undefined;
370
406
  // noinspection JSDeprecatedSymbols
371
407
  this.connectionID = undefined;
@@ -382,11 +418,11 @@ var RTPStreamManagement = /** @class */ (function () {
382
418
  RTPStreamManagement.prototype.streamingIsDisabled = function (callback) {
383
419
  var _a;
384
420
  if (!this.service.getCharacteristic(Characteristic_1.Characteristic.Active).value) {
385
- callback && callback(new hapStatusError_1.HapStatusError(-70412 /* NOT_ALLOWED_IN_CURRENT_STATE */));
421
+ callback && callback(new hapStatusError_1.HapStatusError(-70412 /* HAPStatus.NOT_ALLOWED_IN_CURRENT_STATE */));
386
422
  return true;
387
423
  }
388
424
  if ((_a = this.disabledThroughOperatingMode) === null || _a === void 0 ? void 0 : _a.call(this)) {
389
- callback && callback(new hapStatusError_1.HapStatusError(-70412 /* NOT_ALLOWED_IN_CURRENT_STATE */));
425
+ callback && callback(new hapStatusError_1.HapStatusError(-70412 /* HAPStatus.NOT_ALLOWED_IN_CURRENT_STATE */));
390
426
  return true;
391
427
  }
392
428
  return false;
@@ -398,12 +434,12 @@ var RTPStreamManagement = /** @class */ (function () {
398
434
  }
399
435
  var data = Buffer.from(value, "base64");
400
436
  var objects = tlv.decode(data);
401
- var sessionControl = tlv.decode(objects[1 /* SESSION_CONTROL */]);
402
- var sessionIdentifier = uuid.unparse(sessionControl[1 /* SESSION_IDENTIFIER */]);
403
- var requestType = sessionControl[2 /* COMMAND */][0];
437
+ var sessionControl = tlv.decode(objects[1 /* SelectedRTPStreamConfigurationTypes.SESSION_CONTROL */]);
438
+ var sessionIdentifier = uuid.unparse(sessionControl[1 /* SessionControlTypes.SESSION_IDENTIFIER */]);
439
+ var requestType = sessionControl[2 /* SessionControlTypes.COMMAND */][0];
404
440
  if (sessionIdentifier !== this.sessionIdentifier) {
405
441
  debug("Received unknown session Identifier with request to ".concat(SessionControlCommand[requestType]));
406
- callback(-70410 /* INVALID_VALUE_IN_REQUEST */);
442
+ callback(-70410 /* HAPStatus.INVALID_VALUE_IN_REQUEST */);
407
443
  return;
408
444
  }
409
445
  this.selectedConfiguration = value;
@@ -416,13 +452,13 @@ var RTPStreamManagement = /** @class */ (function () {
416
452
  };
417
453
  switch (requestType) {
418
454
  case SessionControlCommand.START_SESSION: {
419
- var selectedVideoParameters = tlv.decode(objects[2 /* SELECTED_VIDEO_PARAMETERS */]);
420
- var selectedAudioParameters = tlv.decode(objects[3 /* SELECTED_AUDIO_PARAMETERS */]);
455
+ var selectedVideoParameters = tlv.decode(objects[2 /* SelectedRTPStreamConfigurationTypes.SELECTED_VIDEO_PARAMETERS */]);
456
+ var selectedAudioParameters = tlv.decode(objects[3 /* SelectedRTPStreamConfigurationTypes.SELECTED_AUDIO_PARAMETERS */]);
421
457
  this._handleStartStream(selectedVideoParameters, selectedAudioParameters, streamCallback);
422
458
  break;
423
459
  }
424
460
  case SessionControlCommand.RECONFIGURE_SESSION: {
425
- var reconfiguredVideoParameters = tlv.decode(objects[2 /* SELECTED_VIDEO_PARAMETERS */]);
461
+ var reconfiguredVideoParameters = tlv.decode(objects[2 /* SelectedRTPStreamConfigurationTypes.SELECTED_VIDEO_PARAMETERS */]);
426
462
  this.handleReconfigureStream(reconfiguredVideoParameters, streamCallback);
427
463
  break;
428
464
  }
@@ -433,60 +469,60 @@ var RTPStreamManagement = /** @class */ (function () {
433
469
  case SessionControlCommand.SUSPEND_SESSION:
434
470
  default:
435
471
  debug("Unhandled request type ".concat(SessionControlCommand[requestType]));
436
- callback(-70410 /* INVALID_VALUE_IN_REQUEST */);
472
+ callback(-70410 /* HAPStatus.INVALID_VALUE_IN_REQUEST */);
437
473
  return;
438
474
  }
439
475
  };
440
476
  RTPStreamManagement.prototype._handleStartStream = function (videoConfiguration, audioConfiguration, callback) {
441
477
  // selected video configuration
442
478
  // noinspection JSUnusedLocalSymbols
443
- var videoCodec = videoConfiguration[1 /* CODEC_TYPE */]; // always 0x00 for h264
444
- var videoParametersTLV = videoConfiguration[2 /* CODEC_PARAMETERS */];
445
- var videoAttributesTLV = videoConfiguration[3 /* ATTRIBUTES */];
446
- var videoRTPParametersTLV = videoConfiguration[4 /* RTP_PARAMETERS */];
479
+ var videoCodec = videoConfiguration[1 /* SelectedVideoParametersTypes.CODEC_TYPE */]; // always 0x00 for h264
480
+ var videoParametersTLV = videoConfiguration[2 /* SelectedVideoParametersTypes.CODEC_PARAMETERS */];
481
+ var videoAttributesTLV = videoConfiguration[3 /* SelectedVideoParametersTypes.ATTRIBUTES */];
482
+ var videoRTPParametersTLV = videoConfiguration[4 /* SelectedVideoParametersTypes.RTP_PARAMETERS */];
447
483
  // video parameters
448
484
  var videoParameters = tlv.decode(videoParametersTLV);
449
- var h264Profile = videoParameters[1 /* PROFILE_ID */][0];
450
- var h264Level = videoParameters[2 /* LEVEL */][0];
451
- var packetizationMode = videoParameters[3 /* PACKETIZATION_MODE */][0];
452
- var cvoEnabled = videoParameters[4 /* CVO_ENABLED */];
485
+ var h264Profile = videoParameters[1 /* VideoCodecParametersTypes.PROFILE_ID */][0];
486
+ var h264Level = videoParameters[2 /* VideoCodecParametersTypes.LEVEL */][0];
487
+ var packetizationMode = videoParameters[3 /* VideoCodecParametersTypes.PACKETIZATION_MODE */][0];
488
+ var cvoEnabled = videoParameters[4 /* VideoCodecParametersTypes.CVO_ENABLED */];
453
489
  var cvoId = undefined;
454
- if (cvoEnabled && cvoEnabled[0] === 1 /* SUPPORTED */) {
455
- cvoId = videoParameters[5 /* CVO_ID */].readUInt8(0);
490
+ if (cvoEnabled && cvoEnabled[0] === 1 /* VideoCodecCVO.SUPPORTED */) {
491
+ cvoId = videoParameters[5 /* VideoCodecParametersTypes.CVO_ID */].readUInt8(0);
456
492
  }
457
493
  // video attributes
458
494
  var videoAttributes = tlv.decode(videoAttributesTLV);
459
- var width = videoAttributes[1 /* IMAGE_WIDTH */].readUInt16LE(0);
460
- var height = videoAttributes[2 /* IMAGE_HEIGHT */].readUInt16LE(0);
461
- var frameRate = videoAttributes[3 /* FRAME_RATE */].readUInt8(0);
495
+ var width = videoAttributes[1 /* VideoAttributesTypes.IMAGE_WIDTH */].readUInt16LE(0);
496
+ var height = videoAttributes[2 /* VideoAttributesTypes.IMAGE_HEIGHT */].readUInt16LE(0);
497
+ var frameRate = videoAttributes[3 /* VideoAttributesTypes.FRAME_RATE */].readUInt8(0);
462
498
  // video rtp parameters
463
499
  var videoRTPParameters = tlv.decode(videoRTPParametersTLV);
464
- var videoPayloadType = videoRTPParameters[1 /* PAYLOAD_TYPE */].readUInt8(0); // 99
465
- var videoSSRC = videoRTPParameters[2 /* SYNCHRONIZATION_SOURCE */].readUInt32LE(0);
466
- var videoMaximumBitrate = videoRTPParameters[3 /* MAX_BIT_RATE */].readUInt16LE(0);
467
- var videoRTCPInterval = videoRTPParameters[4 /* MIN_RTCP_INTERVAL */].readFloatLE(0);
500
+ var videoPayloadType = videoRTPParameters[1 /* VideoRTPParametersTypes.PAYLOAD_TYPE */].readUInt8(0); // 99
501
+ var videoSSRC = videoRTPParameters[2 /* VideoRTPParametersTypes.SYNCHRONIZATION_SOURCE */].readUInt32LE(0);
502
+ var videoMaximumBitrate = videoRTPParameters[3 /* VideoRTPParametersTypes.MAX_BIT_RATE */].readUInt16LE(0);
503
+ var videoRTCPInterval = videoRTPParameters[4 /* VideoRTPParametersTypes.MIN_RTCP_INTERVAL */].readFloatLE(0);
468
504
  var maxMTU = this.ipVersion === "ipv6" ? 1228 : 1378; // default values ipv4: 1378 bytes; ipv6: 1228 bytes
469
- if (videoRTPParameters[5 /* MAX_MTU */]) {
470
- maxMTU = videoRTPParameters[5 /* MAX_MTU */].readUInt16LE(0);
505
+ if (videoRTPParameters[5 /* VideoRTPParametersTypes.MAX_MTU */]) {
506
+ maxMTU = videoRTPParameters[5 /* VideoRTPParametersTypes.MAX_MTU */].readUInt16LE(0);
471
507
  }
472
508
  // selected audio configuration
473
- var audioCodec = audioConfiguration[1 /* CODEC_TYPE */][0];
474
- var audioParametersTLV = audioConfiguration[2 /* CODEC_PARAMETERS */];
475
- var audioRTPParametersTLV = audioConfiguration[3 /* RTP_PARAMETERS */];
476
- var comfortNoise = !!audioConfiguration[4 /* COMFORT_NOISE */].readUInt8(0);
509
+ var audioCodec = audioConfiguration[1 /* SelectedAudioParametersTypes.CODEC_TYPE */][0];
510
+ var audioParametersTLV = audioConfiguration[2 /* SelectedAudioParametersTypes.CODEC_PARAMETERS */];
511
+ var audioRTPParametersTLV = audioConfiguration[3 /* SelectedAudioParametersTypes.RTP_PARAMETERS */];
512
+ var comfortNoise = !!audioConfiguration[4 /* SelectedAudioParametersTypes.COMFORT_NOISE */].readUInt8(0);
477
513
  // audio parameters
478
514
  var audioParameters = tlv.decode(audioParametersTLV);
479
- var channels = audioParameters[1 /* CHANNEL */][0];
480
- var audioBitrate = audioParameters[2 /* BIT_RATE */][0];
481
- var samplerate = audioParameters[3 /* SAMPLE_RATE */][0];
482
- var rtpPacketTime = audioParameters[4 /* PACKET_TIME */].readUInt8(0);
515
+ var channels = audioParameters[1 /* AudioCodecParametersTypes.CHANNEL */][0];
516
+ var audioBitrate = audioParameters[2 /* AudioCodecParametersTypes.BIT_RATE */][0];
517
+ var samplerate = audioParameters[3 /* AudioCodecParametersTypes.SAMPLE_RATE */][0];
518
+ var rtpPacketTime = audioParameters[4 /* AudioCodecParametersTypes.PACKET_TIME */].readUInt8(0);
483
519
  // audio rtp parameters
484
520
  var audioRTPParameters = tlv.decode(audioRTPParametersTLV);
485
- var audioPayloadType = audioRTPParameters[1 /* PAYLOAD_TYPE */].readUInt8(0); // 110
486
- var audioSSRC = audioRTPParameters[2 /* SYNCHRONIZATION_SOURCE */].readUInt32LE(0);
487
- var audioMaximumBitrate = audioRTPParameters[3 /* MAX_BIT_RATE */].readUInt16LE(0);
488
- var audioRTCPInterval = audioRTPParameters[4 /* MIN_RTCP_INTERVAL */].readFloatLE(0);
489
- var comfortNoisePayloadType = audioRTPParameters[6 /* COMFORT_NOISE_PAYLOAD_TYPE */].readUInt8(0); // 13
521
+ var audioPayloadType = audioRTPParameters[1 /* AudioRTPParametersTypes.PAYLOAD_TYPE */].readUInt8(0); // 110
522
+ var audioSSRC = audioRTPParameters[2 /* AudioRTPParametersTypes.SYNCHRONIZATION_SOURCE */].readUInt32LE(0);
523
+ var audioMaximumBitrate = audioRTPParameters[3 /* AudioRTPParametersTypes.MAX_BIT_RATE */].readUInt16LE(0);
524
+ var audioRTCPInterval = audioRTPParameters[4 /* AudioRTPParametersTypes.MIN_RTCP_INTERVAL */].readFloatLE(0);
525
+ var comfortNoisePayloadType = audioRTPParameters[6 /* AudioRTPParametersTypes.COMFORT_NOISE_PAYLOAD_TYPE */].readUInt8(0); // 13
490
526
  if (this.requireProxy) {
491
527
  this.videoProxy.setOutgoingPayloadType(videoPayloadType);
492
528
  if (!this.disableAudioProxy) {
@@ -511,38 +547,38 @@ var RTPStreamManagement = /** @class */ (function () {
511
547
  var audioCodecName;
512
548
  var samplerateNum;
513
549
  switch (audioCodec) {
514
- case 0 /* PCMU */:
515
- audioCodecName = "PCMU" /* PCMU */;
550
+ case 0 /* AudioCodecTypes.PCMU */:
551
+ audioCodecName = "PCMU" /* AudioStreamingCodecType.PCMU */;
516
552
  break;
517
- case 1 /* PCMA */:
518
- audioCodecName = "PCMA" /* PCMA */;
553
+ case 1 /* AudioCodecTypes.PCMA */:
554
+ audioCodecName = "PCMA" /* AudioStreamingCodecType.PCMA */;
519
555
  break;
520
- case 2 /* AAC_ELD */:
521
- audioCodecName = "AAC-eld" /* AAC_ELD */;
556
+ case 2 /* AudioCodecTypes.AAC_ELD */:
557
+ audioCodecName = "AAC-eld" /* AudioStreamingCodecType.AAC_ELD */;
522
558
  break;
523
- case 3 /* OPUS */:
524
- audioCodecName = "OPUS" /* OPUS */;
559
+ case 3 /* AudioCodecTypes.OPUS */:
560
+ audioCodecName = "OPUS" /* AudioStreamingCodecType.OPUS */;
525
561
  break;
526
- case 4 /* MSBC */:
527
- audioCodecName = "mSBC" /* MSBC */;
562
+ case 4 /* AudioCodecTypes.MSBC */:
563
+ audioCodecName = "mSBC" /* AudioStreamingCodecType.MSBC */;
528
564
  break;
529
- case 5 /* AMR */:
530
- audioCodecName = "AMR" /* AMR */;
565
+ case 5 /* AudioCodecTypes.AMR */:
566
+ audioCodecName = "AMR" /* AudioStreamingCodecType.AMR */;
531
567
  break;
532
- case 6 /* AMR_WB */:
533
- audioCodecName = "AMR-WB" /* AMR_WB */;
568
+ case 6 /* AudioCodecTypes.AMR_WB */:
569
+ audioCodecName = "AMR-WB" /* AudioStreamingCodecType.AMR_WB */;
534
570
  break;
535
571
  default:
536
572
  throw new Error("Encountered unknown selected audio codec ".concat(audioCodec));
537
573
  }
538
574
  switch (samplerate) {
539
- case 0 /* KHZ_8 */:
575
+ case 0 /* AudioSamplerate.KHZ_8 */:
540
576
  samplerateNum = 8;
541
577
  break;
542
- case 1 /* KHZ_16 */:
578
+ case 1 /* AudioSamplerate.KHZ_16 */:
543
579
  samplerateNum = 16;
544
580
  break;
545
- case 2 /* KHZ_24 */:
581
+ case 2 /* AudioSamplerate.KHZ_24 */:
546
582
  samplerateNum = 24;
547
583
  break;
548
584
  default:
@@ -563,7 +599,7 @@ var RTPStreamManagement = /** @class */ (function () {
563
599
  };
564
600
  var request = {
565
601
  sessionID: this.sessionIdentifier,
566
- type: "start" /* START */,
602
+ type: "start" /* StreamRequestTypes.START */,
567
603
  video: videoInfo,
568
604
  audio: audioInfo,
569
605
  };
@@ -571,18 +607,18 @@ var RTPStreamManagement = /** @class */ (function () {
571
607
  };
572
608
  RTPStreamManagement.prototype.handleReconfigureStream = function (videoConfiguration, callback) {
573
609
  // selected video configuration
574
- var videoAttributesTLV = videoConfiguration[3 /* ATTRIBUTES */];
575
- var videoRTPParametersTLV = videoConfiguration[4 /* RTP_PARAMETERS */];
610
+ var videoAttributesTLV = videoConfiguration[3 /* SelectedVideoParametersTypes.ATTRIBUTES */];
611
+ var videoRTPParametersTLV = videoConfiguration[4 /* SelectedVideoParametersTypes.RTP_PARAMETERS */];
576
612
  // video attributes
577
613
  var videoAttributes = tlv.decode(videoAttributesTLV);
578
- var width = videoAttributes[1 /* IMAGE_WIDTH */].readUInt16LE(0);
579
- var height = videoAttributes[2 /* IMAGE_HEIGHT */].readUInt16LE(0);
580
- var frameRate = videoAttributes[3 /* FRAME_RATE */].readUInt8(0);
614
+ var width = videoAttributes[1 /* VideoAttributesTypes.IMAGE_WIDTH */].readUInt16LE(0);
615
+ var height = videoAttributes[2 /* VideoAttributesTypes.IMAGE_HEIGHT */].readUInt16LE(0);
616
+ var frameRate = videoAttributes[3 /* VideoAttributesTypes.FRAME_RATE */].readUInt8(0);
581
617
  // video rtp parameters
582
618
  var videoRTPParameters = tlv.decode(videoRTPParametersTLV);
583
- var videoMaximumBitrate = videoRTPParameters[3 /* MAX_BIT_RATE */].readUInt16LE(0);
619
+ var videoMaximumBitrate = videoRTPParameters[3 /* VideoRTPParametersTypes.MAX_BIT_RATE */].readUInt16LE(0);
584
620
  // seems to be always zero, use default of 0.5
585
- var videoRTCPInterval = videoRTPParameters[4 /* MIN_RTCP_INTERVAL */].readFloatLE(0) || 0.5;
621
+ var videoRTCPInterval = videoRTPParameters[4 /* VideoRTPParametersTypes.MIN_RTCP_INTERVAL */].readFloatLE(0) || 0.5;
586
622
  var reconfiguredVideoInfo = {
587
623
  width: width,
588
624
  height: height,
@@ -592,7 +628,7 @@ var RTPStreamManagement = /** @class */ (function () {
592
628
  };
593
629
  var request = {
594
630
  sessionID: this.sessionIdentifier,
595
- type: "reconfigure" /* RECONFIGURE */,
631
+ type: "reconfigure" /* StreamRequestTypes.RECONFIGURE */,
596
632
  video: reconfiguredVideoInfo,
597
633
  };
598
634
  this.delegate.handleStreamRequest(request, function (error) { return callback(error); });
@@ -600,7 +636,7 @@ var RTPStreamManagement = /** @class */ (function () {
600
636
  RTPStreamManagement.prototype._handleStopStream = function (callback) {
601
637
  var request = {
602
638
  sessionID: this.sessionIdentifier,
603
- type: "stop" /* STOP */,
639
+ type: "stop" /* StreamRequestTypes.STOP */,
604
640
  };
605
641
  this.handleSessionClosed();
606
642
  this.delegate.handleStreamRequest(request, function (error) { return callback ? callback(error) : undefined; });
@@ -612,43 +648,43 @@ var RTPStreamManagement = /** @class */ (function () {
612
648
  }
613
649
  var data = Buffer.from(value, "base64");
614
650
  var objects = tlv.decode(data);
615
- var sessionIdentifier = uuid.unparse(objects[1 /* SESSION_ID */]);
616
- if (this.streamStatus !== 0 /* AVAILABLE */) {
617
- this.setupEndpointsResponse = tlv.encode(1 /* SESSION_ID */, uuid.write(sessionIdentifier), 2 /* STATUS */, 1 /* BUSY */).toString("base64");
651
+ var sessionIdentifier = uuid.unparse(objects[1 /* SetupEndpointsTypes.SESSION_ID */]);
652
+ if (this.streamStatus !== 0 /* StreamingStatus.AVAILABLE */) {
653
+ this.setupEndpointsResponse = tlv.encode(1 /* SetupEndpointsResponseTypes.SESSION_ID */, uuid.write(sessionIdentifier), 2 /* SetupEndpointsResponseTypes.STATUS */, 1 /* SetupEndpointsStatus.BUSY */).toString("base64");
618
654
  callback();
619
655
  return;
620
656
  }
621
657
  (0, assert_1.default)(this.activeConnection == null, "Found non-nil `activeConnection` when trying to setup streaming endpoints, even though streamStatus is reported to be AVAILABLE!");
622
658
  this.activeConnection = connection;
623
- this.activeConnection.on("closed" /* CLOSED */, this.activeConnectionClosedListener);
659
+ this.activeConnection.on("closed" /* HAPConnectionEvent.CLOSED */, this.activeConnectionClosedListener);
624
660
  // noinspection JSDeprecatedSymbols
625
661
  this.connectionID = connection.sessionID;
626
662
  this.sessionIdentifier = sessionIdentifier;
627
- this._updateStreamStatus(1 /* IN_USE */);
663
+ this._updateStreamStatus(1 /* StreamingStatus.IN_USE */);
628
664
  // Address
629
- var targetAddressPayload = objects[3 /* CONTROLLER_ADDRESS */];
665
+ var targetAddressPayload = objects[3 /* SetupEndpointsTypes.CONTROLLER_ADDRESS */];
630
666
  var processedAddressInfo = tlv.decode(targetAddressPayload);
631
- var addressVersion = processedAddressInfo[1 /* ADDRESS_VERSION */][0];
632
- var controllerAddress = processedAddressInfo[2 /* ADDRESS */].toString("utf8");
633
- var targetVideoPort = processedAddressInfo[3 /* VIDEO_RTP_PORT */].readUInt16LE(0);
634
- var targetAudioPort = processedAddressInfo[4 /* AUDIO_RTP_PORT */].readUInt16LE(0);
667
+ var addressVersion = processedAddressInfo[1 /* AddressTypes.ADDRESS_VERSION */][0];
668
+ var controllerAddress = processedAddressInfo[2 /* AddressTypes.ADDRESS */].toString("utf8");
669
+ var targetVideoPort = processedAddressInfo[3 /* AddressTypes.VIDEO_RTP_PORT */].readUInt16LE(0);
670
+ var targetAudioPort = processedAddressInfo[4 /* AddressTypes.AUDIO_RTP_PORT */].readUInt16LE(0);
635
671
  // Video SRTP Params
636
- var videoSRTPPayload = objects[4 /* VIDEO_SRTP_PARAMETERS */];
672
+ var videoSRTPPayload = objects[4 /* SetupEndpointsTypes.VIDEO_SRTP_PARAMETERS */];
637
673
  var processedVideoInfo = tlv.decode(videoSRTPPayload);
638
- var videoCryptoSuite = processedVideoInfo[1 /* SRTP_CRYPTO_SUITE */][0];
639
- var videoMasterKey = processedVideoInfo[2 /* MASTER_KEY */];
640
- var videoMasterSalt = processedVideoInfo[3 /* MASTER_SALT */];
674
+ var videoCryptoSuite = processedVideoInfo[1 /* SRTPParametersTypes.SRTP_CRYPTO_SUITE */][0];
675
+ var videoMasterKey = processedVideoInfo[2 /* SRTPParametersTypes.MASTER_KEY */];
676
+ var videoMasterSalt = processedVideoInfo[3 /* SRTPParametersTypes.MASTER_SALT */];
641
677
  // Audio SRTP Params
642
- var audioSRTPPayload = objects[5 /* AUDIO_SRTP_PARAMETERS */];
678
+ var audioSRTPPayload = objects[5 /* SetupEndpointsTypes.AUDIO_SRTP_PARAMETERS */];
643
679
  var processedAudioInfo = tlv.decode(audioSRTPPayload);
644
- var audioCryptoSuite = processedAudioInfo[1 /* SRTP_CRYPTO_SUITE */][0];
645
- var audioMasterKey = processedAudioInfo[2 /* MASTER_KEY */];
646
- var audioMasterSalt = processedAudioInfo[3 /* MASTER_SALT */];
680
+ var audioCryptoSuite = processedAudioInfo[1 /* SRTPParametersTypes.SRTP_CRYPTO_SUITE */][0];
681
+ var audioMasterKey = processedAudioInfo[2 /* SRTPParametersTypes.MASTER_KEY */];
682
+ var audioMasterSalt = processedAudioInfo[3 /* SRTPParametersTypes.MASTER_SALT */];
647
683
  debug("Session: ", sessionIdentifier, "\nControllerAddress: ", controllerAddress, "\nVideoPort: ", targetVideoPort, "\nAudioPort: ", targetAudioPort, "\nVideo Crypto: ", videoCryptoSuite, "\nVideo Master Key: ", videoMasterKey, "\nVideo Master Salt: ", videoMasterSalt, "\nAudio Crypto: ", audioCryptoSuite, "\nAudio Master Key: ", audioMasterKey, "\nAudio Master Salt: ", audioMasterSalt);
648
684
  var prepareRequest = {
649
685
  sessionID: sessionIdentifier,
650
686
  targetAddress: controllerAddress,
651
- addressVersion: addressVersion === 1 /* IPV6 */ ? "ipv6" : "ipv4",
687
+ addressVersion: addressVersion === 1 /* IPAddressVersion.IPV6 */ ? "ipv6" : "ipv4",
652
688
  video: {
653
689
  port: targetVideoPort,
654
690
  srtpCryptoSuite: videoCryptoSuite,
@@ -664,7 +700,7 @@ var RTPStreamManagement = /** @class */ (function () {
664
700
  };
665
701
  var promises = [];
666
702
  if (this.requireProxy) {
667
- prepareRequest.targetAddress = connection.getLocalAddress(addressVersion === 1 /* IPV6 */ ? "ipv6" : "ipv4"); // ip versions must be the same
703
+ prepareRequest.targetAddress = connection.getLocalAddress(addressVersion === 1 /* IPAddressVersion.IPV6 */ ? "ipv6" : "ipv4"); // ip versions must be the same
668
704
  this.videoProxy = new RTPProxy_1.default({
669
705
  outgoingAddress: controllerAddress,
670
706
  outgoingPort: targetVideoPort,
@@ -692,7 +728,7 @@ var RTPStreamManagement = /** @class */ (function () {
692
728
  _this.delegate.prepareStream(prepareRequest, (0, once_1.once)(function (error, response) {
693
729
  if (error || !response) {
694
730
  debug("PrepareStream request encountered an error: ".concat(error ? error.message : undefined));
695
- _this.setupEndpointsResponse = tlv.encode(1 /* SESSION_ID */, uuid.write(sessionIdentifier), 2 /* STATUS */, 2 /* ERROR */).toString("base64");
731
+ _this.setupEndpointsResponse = tlv.encode(1 /* SetupEndpointsResponseTypes.SESSION_ID */, uuid.write(sessionIdentifier), 2 /* SetupEndpointsResponseTypes.STATUS */, 2 /* SetupEndpointsStatus.ERROR */).toString("base64");
696
732
  _this.handleSessionClosed();
697
733
  callback(error);
698
734
  }
@@ -740,11 +776,11 @@ var RTPStreamManagement = /** @class */ (function () {
740
776
  }
741
777
  videoPort = videoInfo.port;
742
778
  audioPort = audioInfo.port;
743
- if (request.video.srtpCryptoSuite !== 2 /* NONE */
779
+ if (request.video.srtpCryptoSuite !== 2 /* SRTPCryptoSuites.NONE */
744
780
  && (videoInfo.srtp_key === undefined || videoInfo.srtp_salt === undefined)) {
745
781
  throw new Error("SRTP was selected for the prepared video stream, but no 'srtp_key' or 'srtp_salt' was specified!");
746
782
  }
747
- if (request.audio.srtpCryptoSuite !== 2 /* NONE */
783
+ if (request.audio.srtpCryptoSuite !== 2 /* SRTPCryptoSuites.NONE */
748
784
  && (audioInfo.srtp_key === undefined || audioInfo.srtp_salt === undefined)) {
749
785
  throw new Error("SRTP was selected for the prepared audio stream, but no 'srtp_key' or 'srtp_salt' was specified!");
750
786
  }
@@ -760,10 +796,10 @@ var RTPStreamManagement = /** @class */ (function () {
760
796
  else {
761
797
  var videoInfo = response.video;
762
798
  address = connection.getLocalAddress(request.addressVersion);
763
- videoCryptoSuite = 2 /* NONE */;
799
+ videoCryptoSuite = 2 /* SRTPCryptoSuites.NONE */;
764
800
  videoSRTPKey = Buffer.alloc(0);
765
801
  videoSRTPSalt = Buffer.alloc(0);
766
- audioCryptoSuite = 2 /* NONE */;
802
+ audioCryptoSuite = 2 /* SRTPCryptoSuites.NONE */;
767
803
  audioSRTPKey = Buffer.alloc(0);
768
804
  audioSRTPSalt = Buffer.alloc(0);
769
805
  this.videoProxy.setIncomingPayloadType(videoInfo.proxy_pt);
@@ -788,21 +824,21 @@ var RTPStreamManagement = /** @class */ (function () {
788
824
  }
789
825
  }
790
826
  this.ipVersion = addressVersion; // we need to save this in order to calculate some default mtu values later
791
- var accessoryAddress = tlv.encode(1 /* ADDRESS_VERSION */, addressVersion === "ipv4" ? 0 /* IPV4 */ : 1 /* IPV6 */, 2 /* ADDRESS */, address, 3 /* VIDEO_RTP_PORT */, tlv.writeUInt16(videoPort), 4 /* AUDIO_RTP_PORT */, tlv.writeUInt16(audioPort));
792
- var videoSRTPParameters = tlv.encode(1 /* SRTP_CRYPTO_SUITE */, videoCryptoSuite, 2 /* MASTER_KEY */, videoSRTPKey, 3 /* MASTER_SALT */, videoSRTPSalt);
793
- var audioSRTPParameters = tlv.encode(1 /* SRTP_CRYPTO_SUITE */, audioCryptoSuite, 2 /* MASTER_KEY */, audioSRTPKey, 3 /* MASTER_SALT */, audioSRTPSalt);
794
- this.setupEndpointsResponse = tlv.encode(1 /* SESSION_ID */, uuid.write(identifier), 2 /* STATUS */, 0 /* SUCCESS */, 3 /* ACCESSORY_ADDRESS */, accessoryAddress, 4 /* VIDEO_SRTP_PARAMETERS */, videoSRTPParameters, 5 /* AUDIO_SRTP_PARAMETERS */, audioSRTPParameters, 6 /* VIDEO_SSRC */, tlv.writeUInt32(videoSSRC), 7 /* AUDIO_SSRC */, tlv.writeUInt32(audioSSRC)).toString("base64");
827
+ var accessoryAddress = tlv.encode(1 /* AddressTypes.ADDRESS_VERSION */, addressVersion === "ipv4" ? 0 /* IPAddressVersion.IPV4 */ : 1 /* IPAddressVersion.IPV6 */, 2 /* AddressTypes.ADDRESS */, address, 3 /* AddressTypes.VIDEO_RTP_PORT */, tlv.writeUInt16(videoPort), 4 /* AddressTypes.AUDIO_RTP_PORT */, tlv.writeUInt16(audioPort));
828
+ var videoSRTPParameters = tlv.encode(1 /* SRTPParametersTypes.SRTP_CRYPTO_SUITE */, videoCryptoSuite, 2 /* SRTPParametersTypes.MASTER_KEY */, videoSRTPKey, 3 /* SRTPParametersTypes.MASTER_SALT */, videoSRTPSalt);
829
+ var audioSRTPParameters = tlv.encode(1 /* SRTPParametersTypes.SRTP_CRYPTO_SUITE */, audioCryptoSuite, 2 /* SRTPParametersTypes.MASTER_KEY */, audioSRTPKey, 3 /* SRTPParametersTypes.MASTER_SALT */, audioSRTPSalt);
830
+ this.setupEndpointsResponse = tlv.encode(1 /* SetupEndpointsResponseTypes.SESSION_ID */, uuid.write(identifier), 2 /* SetupEndpointsResponseTypes.STATUS */, 0 /* SetupEndpointsStatus.SUCCESS */, 3 /* SetupEndpointsResponseTypes.ACCESSORY_ADDRESS */, accessoryAddress, 4 /* SetupEndpointsResponseTypes.VIDEO_SRTP_PARAMETERS */, videoSRTPParameters, 5 /* SetupEndpointsResponseTypes.AUDIO_SRTP_PARAMETERS */, audioSRTPParameters, 6 /* SetupEndpointsResponseTypes.VIDEO_SSRC */, tlv.writeUInt32(videoSSRC), 7 /* SetupEndpointsResponseTypes.AUDIO_SSRC */, tlv.writeUInt32(audioSSRC)).toString("base64");
795
831
  callback();
796
832
  };
797
833
  RTPStreamManagement.prototype._updateStreamStatus = function (status) {
798
834
  this.streamStatus = status;
799
- this.service.updateCharacteristic(Characteristic_1.Characteristic.StreamingStatus, tlv.encode(1 /* STATUS */, this.streamStatus).toString("base64"));
835
+ this.service.updateCharacteristic(Characteristic_1.Characteristic.StreamingStatus, tlv.encode(1 /* StreamingStatusTypes.STATUS */, this.streamStatus).toString("base64"));
800
836
  };
801
837
  RTPStreamManagement._supportedRTPConfiguration = function (supportedCryptoSuites) {
802
- if (supportedCryptoSuites.length === 1 && supportedCryptoSuites[0] === 2 /* NONE */) {
838
+ if (supportedCryptoSuites.length === 1 && supportedCryptoSuites[0] === 2 /* SRTPCryptoSuites.NONE */) {
803
839
  debug("Client claims it doesn't support SRTP. The stream may stops working with future iOS releases.");
804
840
  }
805
- return tlv.encode(2 /* SRTP_CRYPTO_SUITE */, supportedCryptoSuites).toString("base64");
841
+ return tlv.encode(2 /* SupportedRTPConfigurationTypes.SRTP_CRYPTO_SUITE */, supportedCryptoSuites).toString("base64");
806
842
  };
807
843
  RTPStreamManagement._supportedVideoStreamConfiguration = function (videoOptions) {
808
844
  if (!videoOptions.codec) {
@@ -811,14 +847,14 @@ var RTPStreamManagement = /** @class */ (function () {
811
847
  if (!videoOptions.resolutions) {
812
848
  throw new Error("Video resolutions cannot be undefined");
813
849
  }
814
- var codecParameters = tlv.encode(1 /* PROFILE_ID */, videoOptions.codec.profiles, 2 /* LEVEL */, videoOptions.codec.levels, 3 /* PACKETIZATION_MODE */, 0 /* NON_INTERLEAVED */);
850
+ var codecParameters = tlv.encode(1 /* VideoCodecParametersTypes.PROFILE_ID */, videoOptions.codec.profiles, 2 /* VideoCodecParametersTypes.LEVEL */, videoOptions.codec.levels, 3 /* VideoCodecParametersTypes.PACKETIZATION_MODE */, 0 /* VideoCodecPacketizationMode.NON_INTERLEAVED */);
815
851
  if (videoOptions.cvoId != null) {
816
852
  codecParameters = Buffer.concat([
817
853
  codecParameters,
818
- tlv.encode(4 /* CVO_ENABLED */, 1 /* SUPPORTED */, 5 /* CVO_ID */, videoOptions.cvoId),
854
+ tlv.encode(4 /* VideoCodecParametersTypes.CVO_ENABLED */, 1 /* VideoCodecCVO.SUPPORTED */, 5 /* VideoCodecParametersTypes.CVO_ID */, videoOptions.cvoId),
819
855
  ]);
820
856
  }
821
- var videoStreamConfiguration = tlv.encode(1 /* CODEC_TYPE */, 0 /* H264 */, 2 /* CODEC_PARAMETERS */, codecParameters, 3 /* ATTRIBUTES */, videoOptions.resolutions.map(function (resolution) {
857
+ var videoStreamConfiguration = tlv.encode(1 /* VideoCodecConfigurationTypes.CODEC_TYPE */, 0 /* VideoCodecType.H264 */, 2 /* VideoCodecConfigurationTypes.CODEC_PARAMETERS */, codecParameters, 3 /* VideoCodecConfigurationTypes.ATTRIBUTES */, videoOptions.resolutions.map(function (resolution) {
822
858
  if (resolution.length !== 3) {
823
859
  throw new Error("Unexpected video resolution");
824
860
  }
@@ -828,9 +864,9 @@ var RTPStreamManagement = /** @class */ (function () {
828
864
  width.writeUInt16LE(resolution[0], 0);
829
865
  height.writeUInt16LE(resolution[1], 0);
830
866
  frameRate.writeUInt8(resolution[2], 0);
831
- return tlv.encode(1 /* IMAGE_WIDTH */, width, 2 /* IMAGE_HEIGHT */, height, 3 /* FRAME_RATE */, frameRate);
867
+ return tlv.encode(1 /* VideoAttributesTypes.IMAGE_WIDTH */, width, 2 /* VideoAttributesTypes.IMAGE_HEIGHT */, height, 3 /* VideoAttributesTypes.FRAME_RATE */, frameRate);
832
868
  }));
833
- return tlv.encode(1 /* VIDEO_CODEC_CONFIGURATION */, videoStreamConfiguration).toString("base64");
869
+ return tlv.encode(1 /* SupportedVideoStreamConfigurationTypes.VIDEO_CODEC_CONFIGURATION */, videoStreamConfiguration).toString("base64");
834
870
  };
835
871
  RTPStreamManagement.prototype.checkForLegacyAudioCodecRepresentation = function (codecs) {
836
872
  var codecMap = {};
@@ -861,33 +897,33 @@ var RTPStreamManagement = /** @class */ (function () {
861
897
  debug("Client doesn't support any audio codec that HomeKit supports.");
862
898
  this.videoOnly = true;
863
899
  supportedCodecs.push({
864
- type: "OPUS" /* OPUS */,
865
- samplerate: [16 /* KHZ_16 */, 24 /* KHZ_24 */], // 16 and 24 must be supported
900
+ type: "OPUS" /* AudioStreamingCodecType.OPUS */,
901
+ samplerate: [16 /* AudioStreamingSamplerate.KHZ_16 */, 24 /* AudioStreamingSamplerate.KHZ_24 */], // 16 and 24 must be supported
866
902
  });
867
903
  }
868
904
  var codecConfigurations = supportedCodecs.map(function (codec) {
869
905
  var type;
870
906
  switch (codec.type) {
871
- case "OPUS" /* OPUS */:
872
- type = 3 /* OPUS */;
907
+ case "OPUS" /* AudioStreamingCodecType.OPUS */:
908
+ type = 3 /* AudioCodecTypes.OPUS */;
873
909
  break;
874
- case "AAC-eld" /* AAC_ELD */:
875
- type = 2 /* AAC_ELD */;
910
+ case "AAC-eld" /* AudioStreamingCodecType.AAC_ELD */:
911
+ type = 2 /* AudioCodecTypes.AAC_ELD */;
876
912
  break;
877
- case "PCMA" /* PCMA */:
878
- type = 1 /* PCMA */;
913
+ case "PCMA" /* AudioStreamingCodecType.PCMA */:
914
+ type = 1 /* AudioCodecTypes.PCMA */;
879
915
  break;
880
- case "PCMU" /* PCMU */:
881
- type = 0 /* PCMU */;
916
+ case "PCMU" /* AudioStreamingCodecType.PCMU */:
917
+ type = 0 /* AudioCodecTypes.PCMU */;
882
918
  break;
883
- case "mSBC" /* MSBC */:
884
- type = 4 /* MSBC */;
919
+ case "mSBC" /* AudioStreamingCodecType.MSBC */:
920
+ type = 4 /* AudioCodecTypes.MSBC */;
885
921
  break;
886
- case "AMR" /* AMR */:
887
- type = 5 /* AMR */;
922
+ case "AMR" /* AudioStreamingCodecType.AMR */:
923
+ type = 5 /* AudioCodecTypes.AMR */;
888
924
  break;
889
- case "AMR-WB" /* AMR_WB */:
890
- type = 6 /* AMR_WB */;
925
+ case "AMR-WB" /* AudioStreamingCodecType.AMR_WB */:
926
+ type = 6 /* AudioCodecTypes.AMR_WB */;
891
927
  break;
892
928
  default:
893
929
  throw new Error("Unsupported codec: " + codec.type);
@@ -895,14 +931,14 @@ var RTPStreamManagement = /** @class */ (function () {
895
931
  var providedSamplerates = (typeof codec.samplerate === "number" ? [codec.samplerate] : codec.samplerate).map(function (rate) {
896
932
  var samplerate;
897
933
  switch (rate) {
898
- case 8 /* KHZ_8 */:
899
- samplerate = 0 /* KHZ_8 */;
934
+ case 8 /* AudioStreamingSamplerate.KHZ_8 */:
935
+ samplerate = 0 /* AudioSamplerate.KHZ_8 */;
900
936
  break;
901
- case 16 /* KHZ_16 */:
902
- samplerate = 1 /* KHZ_16 */;
937
+ case 16 /* AudioStreamingSamplerate.KHZ_16 */:
938
+ samplerate = 1 /* AudioSamplerate.KHZ_16 */;
903
939
  break;
904
- case 24 /* KHZ_24 */:
905
- samplerate = 2 /* KHZ_24 */;
940
+ case 24 /* AudioStreamingSamplerate.KHZ_24 */:
941
+ samplerate = 2 /* AudioSamplerate.KHZ_24 */;
906
942
  break;
907
943
  default:
908
944
  console.log("Unsupported sample rate: ", codec.samplerate);
@@ -913,17 +949,17 @@ var RTPStreamManagement = /** @class */ (function () {
913
949
  if (providedSamplerates.length === 0) {
914
950
  throw new Error("Audio samplerate cannot be empty!");
915
951
  }
916
- var audioParameters = tlv.encode(1 /* CHANNEL */, Math.max(1, codec.audioChannels || 1), 2 /* BIT_RATE */, codec.bitrate || 0 /* VARIABLE */, 3 /* SAMPLE_RATE */, providedSamplerates);
917
- return tlv.encode(1 /* CODEC_TYPE */, type, 2 /* CODEC_PARAMETERS */, audioParameters);
952
+ var audioParameters = tlv.encode(1 /* AudioCodecParametersTypes.CHANNEL */, Math.max(1, codec.audioChannels || 1), 2 /* AudioCodecParametersTypes.BIT_RATE */, codec.bitrate || 0 /* AudioBitrate.VARIABLE */, 3 /* AudioCodecParametersTypes.SAMPLE_RATE */, providedSamplerates);
953
+ return tlv.encode(1 /* AudioCodecConfigurationTypes.CODEC_TYPE */, type, 2 /* AudioCodecConfigurationTypes.CODEC_PARAMETERS */, audioParameters);
918
954
  });
919
- return tlv.encode(1 /* AUDIO_CODEC_CONFIGURATION */, codecConfigurations, 2 /* COMFORT_NOISE_SUPPORT */, comfortNoise ? 1 : 0).toString("base64");
955
+ return tlv.encode(1 /* SupportedAudioStreamConfigurationTypes.AUDIO_CODEC_CONFIGURATION */, codecConfigurations, 2 /* SupportedAudioStreamConfigurationTypes.COMFORT_NOISE_SUPPORT */, comfortNoise ? 1 : 0).toString("base64");
920
956
  };
921
957
  RTPStreamManagement.prototype.resetSetupEndpointsResponse = function () {
922
- this.setupEndpointsResponse = tlv.encode(2 /* STATUS */, 2 /* ERROR */).toString("base64");
958
+ this.setupEndpointsResponse = tlv.encode(2 /* SetupEndpointsResponseTypes.STATUS */, 2 /* SetupEndpointsStatus.ERROR */).toString("base64");
923
959
  this.service.updateCharacteristic(Characteristic_1.Characteristic.SetupEndpoints, this.setupEndpointsResponse);
924
960
  };
925
961
  RTPStreamManagement.prototype.resetSelectedStreamConfiguration = function () {
926
- this.selectedConfiguration = tlv.encode(1 /* SESSION_CONTROL */, tlv.encode(2 /* COMMAND */, SessionControlCommand.SUSPEND_SESSION)).toString("base64");
962
+ this.selectedConfiguration = tlv.encode(1 /* SelectedRTPStreamConfigurationTypes.SESSION_CONTROL */, tlv.encode(2 /* SessionControlTypes.COMMAND */, SessionControlCommand.SUSPEND_SESSION)).toString("base64");
927
963
  this.service.updateCharacteristic(Characteristic_1.Characteristic.SelectedRTPStreamConfiguration, this.selectedConfiguration);
928
964
  };
929
965
  /**
@@ -970,10 +1006,11 @@ var RTPStreamManagement = /** @class */ (function () {
970
1006
  }());
971
1007
  exports.RTPStreamManagement = RTPStreamManagement;
972
1008
  /**
973
- * @deprecated - only there for backwards compatibility, please use {@see RTPStreamManagement} directly
1009
+ * @group Camera
1010
+ * @deprecated - only there for backwards compatibility, please use {@link RTPStreamManagement} directly
974
1011
  */
975
1012
  var StreamController = /** @class */ (function (_super) {
976
- (0, tslib_1.__extends)(StreamController, _super);
1013
+ tslib_1.__extends(StreamController, _super);
977
1014
  // noinspection JSDeprecatedSymbols
978
1015
  function StreamController(id, options, delegate, service) {
979
1016
  var _this = _super.call(this, id, options, new Camera_1.LegacyCameraSourceAdapter(delegate), service) || this;