@willieee802/zigbee-herdsman 0.19.2 → 0.34.3

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 (530) hide show
  1. package/.babelrc.js +0 -4
  2. package/.release-please-manifest.json +1 -2
  3. package/CHANGELOG.md +376 -0
  4. package/README.md +1 -1
  5. package/dist/adapter/adapter.d.ts +61 -61
  6. package/dist/adapter/adapter.d.ts.map +1 -1
  7. package/dist/adapter/adapter.js +158 -146
  8. package/dist/adapter/adapter.js.map +1 -1
  9. package/dist/adapter/deconz/adapter/deconzAdapter.d.ts +68 -68
  10. package/dist/adapter/deconz/adapter/deconzAdapter.d.ts.map +1 -1
  11. package/dist/adapter/deconz/adapter/deconzAdapter.js +1081 -1060
  12. package/dist/adapter/deconz/adapter/deconzAdapter.js.map +1 -1
  13. package/dist/adapter/deconz/adapter/index.d.ts +2 -2
  14. package/dist/adapter/deconz/adapter/index.js +10 -10
  15. package/dist/adapter/deconz/driver/constants.d.ts +104 -104
  16. package/dist/adapter/deconz/driver/constants.js +55 -55
  17. package/dist/adapter/deconz/driver/driver.d.ts +81 -81
  18. package/dist/adapter/deconz/driver/driver.d.ts.map +1 -1
  19. package/dist/adapter/deconz/driver/driver.js +750 -732
  20. package/dist/adapter/deconz/driver/driver.js.map +1 -1
  21. package/dist/adapter/deconz/driver/frame.d.ts +6 -6
  22. package/dist/adapter/deconz/driver/frame.js +13 -13
  23. package/dist/adapter/deconz/driver/frameParser.d.ts +2 -2
  24. package/dist/adapter/deconz/driver/frameParser.js +443 -443
  25. package/dist/adapter/deconz/driver/frameParser.js.map +1 -1
  26. package/dist/adapter/deconz/driver/parser.d.ts +12 -12
  27. package/dist/adapter/deconz/driver/parser.js +63 -61
  28. package/dist/adapter/deconz/driver/parser.js.map +1 -1
  29. package/dist/adapter/deconz/driver/writer.d.ts +8 -8
  30. package/dist/adapter/deconz/driver/writer.js +44 -44
  31. package/dist/adapter/ember/adapter/emberAdapter.d.ts +817 -0
  32. package/dist/adapter/ember/adapter/emberAdapter.d.ts.map +1 -0
  33. package/dist/adapter/ember/adapter/emberAdapter.js +2981 -0
  34. package/dist/adapter/ember/adapter/emberAdapter.js.map +1 -0
  35. package/dist/adapter/ember/adapter/endpoints.d.ts +25 -0
  36. package/dist/adapter/ember/adapter/endpoints.d.ts.map +1 -0
  37. package/dist/adapter/ember/adapter/endpoints.js +66 -0
  38. package/dist/adapter/ember/adapter/endpoints.js.map +1 -0
  39. package/dist/adapter/ember/adapter/index.d.ts +3 -0
  40. package/dist/adapter/ember/adapter/index.d.ts.map +1 -0
  41. package/dist/adapter/ember/adapter/index.js +6 -0
  42. package/dist/adapter/ember/adapter/index.js.map +1 -0
  43. package/dist/adapter/ember/adapter/oneWaitress.d.ts +97 -0
  44. package/dist/adapter/ember/adapter/oneWaitress.d.ts.map +1 -0
  45. package/dist/adapter/ember/adapter/oneWaitress.js +226 -0
  46. package/dist/adapter/ember/adapter/oneWaitress.js.map +1 -0
  47. package/dist/adapter/ember/adapter/requestQueue.d.ts +59 -0
  48. package/dist/adapter/ember/adapter/requestQueue.d.ts.map +1 -0
  49. package/dist/adapter/ember/adapter/requestQueue.js +144 -0
  50. package/dist/adapter/ember/adapter/requestQueue.js.map +1 -0
  51. package/dist/adapter/ember/adapter/tokensManager.d.ts +69 -0
  52. package/dist/adapter/ember/adapter/tokensManager.d.ts.map +1 -0
  53. package/dist/adapter/ember/adapter/tokensManager.js +685 -0
  54. package/dist/adapter/ember/adapter/tokensManager.js.map +1 -0
  55. package/dist/adapter/ember/consts.d.ts +198 -0
  56. package/dist/adapter/ember/consts.d.ts.map +1 -0
  57. package/dist/adapter/ember/consts.js +253 -0
  58. package/dist/adapter/ember/consts.js.map +1 -0
  59. package/dist/adapter/ember/enums.d.ts +2184 -0
  60. package/dist/adapter/ember/enums.d.ts.map +1 -0
  61. package/dist/adapter/ember/enums.js +2391 -0
  62. package/dist/adapter/ember/enums.js.map +1 -0
  63. package/dist/adapter/ember/ezsp/buffalo.d.ts +156 -0
  64. package/dist/adapter/ember/ezsp/buffalo.d.ts.map +1 -0
  65. package/dist/adapter/ember/ezsp/buffalo.js +1033 -0
  66. package/dist/adapter/ember/ezsp/buffalo.js.map +1 -0
  67. package/dist/adapter/ember/ezsp/consts.d.ts +116 -0
  68. package/dist/adapter/ember/ezsp/consts.d.ts.map +1 -0
  69. package/dist/adapter/ember/ezsp/consts.js +128 -0
  70. package/dist/adapter/ember/ezsp/consts.js.map +1 -0
  71. package/dist/adapter/ember/ezsp/enums.d.ts +879 -0
  72. package/dist/adapter/ember/ezsp/enums.d.ts.map +1 -0
  73. package/dist/adapter/ember/ezsp/enums.js +948 -0
  74. package/dist/adapter/ember/ezsp/enums.js.map +1 -0
  75. package/dist/adapter/ember/ezsp/ezsp.d.ts +2664 -0
  76. package/dist/adapter/ember/ezsp/ezsp.d.ts.map +1 -0
  77. package/dist/adapter/ember/ezsp/ezsp.js +6438 -0
  78. package/dist/adapter/ember/ezsp/ezsp.js.map +1 -0
  79. package/dist/adapter/ember/types.d.ts +733 -0
  80. package/dist/adapter/ember/types.d.ts.map +1 -0
  81. package/dist/adapter/ember/types.js +3 -0
  82. package/dist/adapter/ember/types.js.map +1 -0
  83. package/dist/adapter/ember/uart/ash.d.ts +451 -0
  84. package/dist/adapter/ember/uart/ash.d.ts.map +1 -0
  85. package/dist/adapter/ember/uart/ash.js +1584 -0
  86. package/dist/adapter/ember/uart/ash.js.map +1 -0
  87. package/dist/adapter/ember/uart/consts.d.ts +91 -0
  88. package/dist/adapter/ember/uart/consts.d.ts.map +1 -0
  89. package/dist/adapter/ember/uart/consts.js +100 -0
  90. package/dist/adapter/ember/uart/consts.js.map +1 -0
  91. package/dist/adapter/ember/uart/enums.d.ts +191 -0
  92. package/dist/adapter/ember/uart/enums.d.ts.map +1 -0
  93. package/dist/adapter/ember/uart/enums.js +197 -0
  94. package/dist/adapter/ember/uart/enums.js.map +1 -0
  95. package/dist/adapter/ember/uart/parser.d.ts +10 -0
  96. package/dist/adapter/ember/uart/parser.d.ts.map +1 -0
  97. package/dist/adapter/ember/uart/parser.js +41 -0
  98. package/dist/adapter/ember/uart/parser.js.map +1 -0
  99. package/dist/adapter/ember/uart/queues.d.ts +85 -0
  100. package/dist/adapter/ember/uart/queues.d.ts.map +1 -0
  101. package/dist/adapter/ember/uart/queues.js +212 -0
  102. package/dist/adapter/ember/uart/queues.js.map +1 -0
  103. package/dist/adapter/ember/uart/writer.d.ts +15 -0
  104. package/dist/adapter/ember/uart/writer.d.ts.map +1 -0
  105. package/dist/adapter/ember/uart/writer.js +48 -0
  106. package/dist/adapter/ember/uart/writer.js.map +1 -0
  107. package/dist/adapter/ember/utils/initters.d.ts +20 -0
  108. package/dist/adapter/ember/utils/initters.d.ts.map +1 -0
  109. package/dist/adapter/ember/utils/initters.js +58 -0
  110. package/dist/adapter/ember/utils/initters.js.map +1 -0
  111. package/dist/adapter/ember/utils/math.d.ts +51 -0
  112. package/dist/adapter/ember/utils/math.d.ts.map +1 -0
  113. package/dist/adapter/ember/utils/math.js +102 -0
  114. package/dist/adapter/ember/utils/math.js.map +1 -0
  115. package/dist/adapter/ember/zdo.d.ts +921 -0
  116. package/dist/adapter/ember/zdo.d.ts.map +1 -0
  117. package/dist/adapter/ember/zdo.js +723 -0
  118. package/dist/adapter/ember/zdo.js.map +1 -0
  119. package/dist/adapter/events.d.ts +47 -47
  120. package/dist/adapter/events.js +13 -14
  121. package/dist/adapter/events.js.map +1 -1
  122. package/dist/adapter/ezsp/adapter/backup.d.ts +9 -9
  123. package/dist/adapter/ezsp/adapter/backup.d.ts.map +1 -1
  124. package/dist/adapter/ezsp/adapter/backup.js +72 -53
  125. package/dist/adapter/ezsp/adapter/backup.js.map +1 -1
  126. package/dist/adapter/ezsp/adapter/ezspAdapter.d.ts +61 -59
  127. package/dist/adapter/ezsp/adapter/ezspAdapter.d.ts.map +1 -1
  128. package/dist/adapter/ezsp/adapter/ezspAdapter.js +629 -603
  129. package/dist/adapter/ezsp/adapter/ezspAdapter.js.map +1 -1
  130. package/dist/adapter/ezsp/adapter/index.d.ts +2 -2
  131. package/dist/adapter/ezsp/adapter/index.js +10 -10
  132. package/dist/adapter/ezsp/driver/commands.d.ts +36 -36
  133. package/dist/adapter/ezsp/driver/commands.d.ts.map +1 -1
  134. package/dist/adapter/ezsp/driver/commands.js +2388 -2359
  135. package/dist/adapter/ezsp/driver/commands.js.map +1 -1
  136. package/dist/adapter/ezsp/driver/consts.d.ts +10 -10
  137. package/dist/adapter/ezsp/driver/consts.js +13 -13
  138. package/dist/adapter/ezsp/driver/driver.d.ts +106 -103
  139. package/dist/adapter/ezsp/driver/driver.d.ts.map +1 -1
  140. package/dist/adapter/ezsp/driver/driver.js +731 -639
  141. package/dist/adapter/ezsp/driver/driver.js.map +1 -1
  142. package/dist/adapter/ezsp/driver/ezsp.d.ts +105 -96
  143. package/dist/adapter/ezsp/driver/ezsp.d.ts.map +1 -1
  144. package/dist/adapter/ezsp/driver/ezsp.js +651 -586
  145. package/dist/adapter/ezsp/driver/ezsp.js.map +1 -1
  146. package/dist/adapter/ezsp/driver/frame.d.ts +40 -0
  147. package/dist/adapter/ezsp/driver/frame.d.ts.map +1 -0
  148. package/dist/adapter/ezsp/driver/frame.js +101 -0
  149. package/dist/adapter/ezsp/driver/frame.js.map +1 -0
  150. package/dist/adapter/ezsp/driver/index.d.ts +3 -3
  151. package/dist/adapter/ezsp/driver/index.js +8 -8
  152. package/dist/adapter/ezsp/driver/multicast.d.ts +12 -12
  153. package/dist/adapter/ezsp/driver/multicast.d.ts.map +1 -1
  154. package/dist/adapter/ezsp/driver/multicast.js +77 -74
  155. package/dist/adapter/ezsp/driver/multicast.js.map +1 -1
  156. package/dist/adapter/ezsp/driver/parser.d.ts +11 -12
  157. package/dist/adapter/ezsp/driver/parser.d.ts.map +1 -1
  158. package/dist/adapter/ezsp/driver/parser.js +104 -111
  159. package/dist/adapter/ezsp/driver/parser.js.map +1 -1
  160. package/dist/adapter/ezsp/driver/types/basic.d.ts +62 -62
  161. package/dist/adapter/ezsp/driver/types/basic.js +208 -208
  162. package/dist/adapter/ezsp/driver/types/basic.js.map +1 -1
  163. package/dist/adapter/ezsp/driver/types/index.d.ts +9 -9
  164. package/dist/adapter/ezsp/driver/types/index.d.ts.map +1 -1
  165. package/dist/adapter/ezsp/driver/types/index.js +138 -133
  166. package/dist/adapter/ezsp/driver/types/index.js.map +1 -1
  167. package/dist/adapter/ezsp/driver/types/named.d.ts +1287 -697
  168. package/dist/adapter/ezsp/driver/types/named.d.ts.map +1 -1
  169. package/dist/adapter/ezsp/driver/types/named.js +2329 -1726
  170. package/dist/adapter/ezsp/driver/types/named.js.map +1 -1
  171. package/dist/adapter/ezsp/driver/types/struct.d.ts +270 -251
  172. package/dist/adapter/ezsp/driver/types/struct.d.ts.map +1 -1
  173. package/dist/adapter/ezsp/driver/types/struct.js +803 -708
  174. package/dist/adapter/ezsp/driver/types/struct.js.map +1 -1
  175. package/dist/adapter/ezsp/driver/uart.d.ts +48 -44
  176. package/dist/adapter/ezsp/driver/uart.d.ts.map +1 -1
  177. package/dist/adapter/ezsp/driver/uart.js +382 -368
  178. package/dist/adapter/ezsp/driver/uart.js.map +1 -1
  179. package/dist/adapter/ezsp/driver/utils/crc16ccitt.d.ts +2 -2
  180. package/dist/adapter/ezsp/driver/utils/crc16ccitt.js +55 -55
  181. package/dist/adapter/ezsp/driver/utils/crc16ccitt.js.map +1 -1
  182. package/dist/adapter/ezsp/driver/utils/index.d.ts +18 -18
  183. package/dist/adapter/ezsp/driver/utils/index.js +72 -67
  184. package/dist/adapter/ezsp/driver/utils/index.js.map +1 -1
  185. package/dist/adapter/ezsp/driver/writer.d.ts +13 -13
  186. package/dist/adapter/ezsp/driver/writer.d.ts.map +1 -1
  187. package/dist/adapter/ezsp/driver/writer.js +85 -88
  188. package/dist/adapter/ezsp/driver/writer.js.map +1 -1
  189. package/dist/adapter/index.d.ts +4 -4
  190. package/dist/adapter/index.js +35 -35
  191. package/dist/adapter/serialPort.d.ts +10 -8
  192. package/dist/adapter/serialPort.d.ts.map +1 -1
  193. package/dist/adapter/serialPort.js +53 -22
  194. package/dist/adapter/serialPort.js.map +1 -1
  195. package/dist/adapter/serialPortUtils.d.ts +12 -12
  196. package/dist/adapter/serialPortUtils.js +18 -18
  197. package/dist/adapter/serialPortUtils.js.map +1 -1
  198. package/dist/adapter/socketPortUtils.d.ts +10 -10
  199. package/dist/adapter/socketPortUtils.js +16 -16
  200. package/dist/adapter/tstype.d.ts +85 -85
  201. package/dist/adapter/tstype.d.ts.map +1 -1
  202. package/dist/adapter/tstype.js +2 -2
  203. package/dist/adapter/z-stack/adapter/adapter-backup.d.ts +62 -62
  204. package/dist/adapter/z-stack/adapter/adapter-backup.d.ts.map +1 -1
  205. package/dist/adapter/z-stack/adapter/adapter-backup.js +462 -460
  206. package/dist/adapter/z-stack/adapter/adapter-backup.js.map +1 -1
  207. package/dist/adapter/z-stack/adapter/adapter-nv-memory.d.ts +150 -150
  208. package/dist/adapter/z-stack/adapter/adapter-nv-memory.js +258 -258
  209. package/dist/adapter/z-stack/adapter/adapter-nv-memory.js.map +1 -1
  210. package/dist/adapter/z-stack/adapter/endpoints.d.ts +11 -11
  211. package/dist/adapter/z-stack/adapter/endpoints.js +73 -73
  212. package/dist/adapter/z-stack/adapter/index.d.ts +2 -2
  213. package/dist/adapter/z-stack/adapter/index.js +8 -8
  214. package/dist/adapter/z-stack/adapter/manager.d.ts +86 -86
  215. package/dist/adapter/z-stack/adapter/manager.d.ts.map +1 -1
  216. package/dist/adapter/z-stack/adapter/manager.js +482 -476
  217. package/dist/adapter/z-stack/adapter/manager.js.map +1 -1
  218. package/dist/adapter/z-stack/adapter/tstype.d.ts +6 -6
  219. package/dist/adapter/z-stack/adapter/tstype.js +9 -10
  220. package/dist/adapter/z-stack/adapter/tstype.js.map +1 -1
  221. package/dist/adapter/z-stack/adapter/zStackAdapter.d.ts +81 -81
  222. package/dist/adapter/z-stack/adapter/zStackAdapter.d.ts.map +1 -1
  223. package/dist/adapter/z-stack/adapter/zStackAdapter.js +891 -868
  224. package/dist/adapter/z-stack/adapter/zStackAdapter.js.map +1 -1
  225. package/dist/adapter/z-stack/constants/af.d.ts +23 -23
  226. package/dist/adapter/z-stack/constants/af.js +27 -27
  227. package/dist/adapter/z-stack/constants/common.d.ts +278 -278
  228. package/dist/adapter/z-stack/constants/common.d.ts.map +1 -1
  229. package/dist/adapter/z-stack/constants/common.js +292 -289
  230. package/dist/adapter/z-stack/constants/common.js.map +1 -1
  231. package/dist/adapter/z-stack/constants/dbg.d.ts +22 -22
  232. package/dist/adapter/z-stack/constants/dbg.js +24 -24
  233. package/dist/adapter/z-stack/constants/index.d.ts +10 -10
  234. package/dist/adapter/z-stack/constants/index.js +47 -47
  235. package/dist/adapter/z-stack/constants/mac.d.ts +127 -127
  236. package/dist/adapter/z-stack/constants/mac.js +129 -129
  237. package/dist/adapter/z-stack/constants/sapi.d.ts +24 -24
  238. package/dist/adapter/z-stack/constants/sapi.js +26 -26
  239. package/dist/adapter/z-stack/constants/sys.d.ts +71 -71
  240. package/dist/adapter/z-stack/constants/sys.js +73 -73
  241. package/dist/adapter/z-stack/constants/util.d.ts +81 -81
  242. package/dist/adapter/z-stack/constants/util.js +83 -83
  243. package/dist/adapter/z-stack/constants/utils.d.ts +4 -4
  244. package/dist/adapter/z-stack/constants/utils.js +14 -14
  245. package/dist/adapter/z-stack/constants/zdo.d.ts +102 -102
  246. package/dist/adapter/z-stack/constants/zdo.js +104 -104
  247. package/dist/adapter/z-stack/models/index.d.ts +1 -1
  248. package/dist/adapter/z-stack/models/index.js +17 -17
  249. package/dist/adapter/z-stack/models/startup-options.d.ts +12 -12
  250. package/dist/adapter/z-stack/models/startup-options.js +2 -2
  251. package/dist/adapter/z-stack/structs/entries/address-manager-entry.d.ts +23 -23
  252. package/dist/adapter/z-stack/structs/entries/address-manager-entry.js +45 -45
  253. package/dist/adapter/z-stack/structs/entries/address-manager-entry.js.map +1 -1
  254. package/dist/adapter/z-stack/structs/entries/address-manager-table.d.ts +10 -10
  255. package/dist/adapter/z-stack/structs/entries/address-manager-table.js +22 -22
  256. package/dist/adapter/z-stack/structs/entries/aps-link-key-data-entry.d.ts +10 -10
  257. package/dist/adapter/z-stack/structs/entries/aps-link-key-data-entry.js +21 -21
  258. package/dist/adapter/z-stack/structs/entries/aps-link-key-data-table.d.ts +10 -10
  259. package/dist/adapter/z-stack/structs/entries/aps-link-key-data-table.js +23 -23
  260. package/dist/adapter/z-stack/structs/entries/aps-tc-link-key-entry.d.ts +10 -10
  261. package/dist/adapter/z-stack/structs/entries/aps-tc-link-key-entry.js +24 -24
  262. package/dist/adapter/z-stack/structs/entries/aps-tc-link-key-table.d.ts +10 -10
  263. package/dist/adapter/z-stack/structs/entries/aps-tc-link-key-table.js +23 -23
  264. package/dist/adapter/z-stack/structs/entries/channel-list.d.ts +8 -8
  265. package/dist/adapter/z-stack/structs/entries/channel-list.js +15 -15
  266. package/dist/adapter/z-stack/structs/entries/has-configured.d.ts +8 -8
  267. package/dist/adapter/z-stack/structs/entries/has-configured.js +16 -16
  268. package/dist/adapter/z-stack/structs/entries/index.d.ts +16 -16
  269. package/dist/adapter/z-stack/structs/entries/index.js +32 -32
  270. package/dist/adapter/z-stack/structs/entries/nib.d.ts +10 -10
  271. package/dist/adapter/z-stack/structs/entries/nib.js +68 -68
  272. package/dist/adapter/z-stack/structs/entries/nwk-key-descriptor.d.ts +10 -10
  273. package/dist/adapter/z-stack/structs/entries/nwk-key-descriptor.js +18 -18
  274. package/dist/adapter/z-stack/structs/entries/nwk-key.d.ts +8 -8
  275. package/dist/adapter/z-stack/structs/entries/nwk-key.js +15 -15
  276. package/dist/adapter/z-stack/structs/entries/nwk-pan-id.d.ts +8 -8
  277. package/dist/adapter/z-stack/structs/entries/nwk-pan-id.js +15 -15
  278. package/dist/adapter/z-stack/structs/entries/nwk-sec-material-descriptor-entry.d.ts +13 -13
  279. package/dist/adapter/z-stack/structs/entries/nwk-sec-material-descriptor-entry.js +23 -23
  280. package/dist/adapter/z-stack/structs/entries/nwk-sec-material-descriptor-table.d.ts +10 -10
  281. package/dist/adapter/z-stack/structs/entries/nwk-sec-material-descriptor-table.js +22 -22
  282. package/dist/adapter/z-stack/structs/entries/security-manager-entry.d.ts +20 -20
  283. package/dist/adapter/z-stack/structs/entries/security-manager-entry.js +36 -36
  284. package/dist/adapter/z-stack/structs/entries/security-manager-entry.js.map +1 -1
  285. package/dist/adapter/z-stack/structs/entries/security-manager-table.d.ts +10 -10
  286. package/dist/adapter/z-stack/structs/entries/security-manager-table.js +24 -24
  287. package/dist/adapter/z-stack/structs/index.d.ts +4 -4
  288. package/dist/adapter/z-stack/structs/index.js +20 -20
  289. package/dist/adapter/z-stack/structs/serializable-memory-object.d.ts +13 -13
  290. package/dist/adapter/z-stack/structs/serializable-memory-object.js +2 -2
  291. package/dist/adapter/z-stack/structs/struct.d.ts +99 -99
  292. package/dist/adapter/z-stack/structs/struct.js +296 -295
  293. package/dist/adapter/z-stack/structs/struct.js.map +1 -1
  294. package/dist/adapter/z-stack/structs/table.d.ts +94 -94
  295. package/dist/adapter/z-stack/structs/table.js +163 -161
  296. package/dist/adapter/z-stack/structs/table.js.map +1 -1
  297. package/dist/adapter/z-stack/unpi/constants.d.ts +28 -28
  298. package/dist/adapter/z-stack/unpi/constants.js +39 -41
  299. package/dist/adapter/z-stack/unpi/constants.js.map +1 -1
  300. package/dist/adapter/z-stack/unpi/frame.d.ts +16 -16
  301. package/dist/adapter/z-stack/unpi/frame.js +54 -48
  302. package/dist/adapter/z-stack/unpi/frame.js.map +1 -1
  303. package/dist/adapter/z-stack/unpi/index.d.ts +5 -5
  304. package/dist/adapter/z-stack/unpi/index.js +37 -37
  305. package/dist/adapter/z-stack/unpi/parser.d.ts +10 -10
  306. package/dist/adapter/z-stack/unpi/parser.js +75 -74
  307. package/dist/adapter/z-stack/unpi/parser.js.map +1 -1
  308. package/dist/adapter/z-stack/unpi/writer.d.ts +10 -10
  309. package/dist/adapter/z-stack/unpi/writer.js +44 -44
  310. package/dist/adapter/z-stack/utils/channel-list.d.ts +20 -20
  311. package/dist/adapter/z-stack/utils/channel-list.js +40 -40
  312. package/dist/adapter/z-stack/utils/channel-list.js.map +1 -1
  313. package/dist/adapter/z-stack/utils/index.d.ts +2 -2
  314. package/dist/adapter/z-stack/utils/index.js +18 -18
  315. package/dist/adapter/z-stack/utils/network-options.d.ts +8 -8
  316. package/dist/adapter/z-stack/utils/network-options.js +22 -22
  317. package/dist/adapter/z-stack/znp/buffaloZnp.d.ts +11 -11
  318. package/dist/adapter/z-stack/znp/buffaloZnp.js +113 -113
  319. package/dist/adapter/z-stack/znp/buffaloZnp.js.map +1 -1
  320. package/dist/adapter/z-stack/znp/definition.d.ts +5 -5
  321. package/dist/adapter/z-stack/znp/definition.js +3050 -3050
  322. package/dist/adapter/z-stack/znp/index.d.ts +3 -3
  323. package/dist/adapter/z-stack/znp/index.js +10 -10
  324. package/dist/adapter/z-stack/znp/parameterType.d.ts +22 -22
  325. package/dist/adapter/z-stack/znp/parameterType.js +25 -25
  326. package/dist/adapter/z-stack/znp/tstype.d.ts +21 -21
  327. package/dist/adapter/z-stack/znp/tstype.js +2 -2
  328. package/dist/adapter/z-stack/znp/znp.d.ts +44 -43
  329. package/dist/adapter/z-stack/znp/znp.d.ts.map +1 -1
  330. package/dist/adapter/z-stack/znp/znp.js +326 -325
  331. package/dist/adapter/z-stack/znp/znp.js.map +1 -1
  332. package/dist/adapter/z-stack/znp/zpiObject.d.ts +19 -19
  333. package/dist/adapter/z-stack/znp/zpiObject.js +102 -96
  334. package/dist/adapter/z-stack/znp/zpiObject.js.map +1 -1
  335. package/dist/adapter/zigate/adapter/index.d.ts +2 -2
  336. package/dist/adapter/zigate/adapter/index.js +10 -10
  337. package/dist/adapter/zigate/adapter/zigateAdapter.d.ts +70 -69
  338. package/dist/adapter/zigate/adapter/zigateAdapter.d.ts.map +1 -1
  339. package/dist/adapter/zigate/adapter/zigateAdapter.js +689 -678
  340. package/dist/adapter/zigate/adapter/zigateAdapter.js.map +1 -1
  341. package/dist/adapter/zigate/debug.d.ts +7 -7
  342. package/dist/adapter/zigate/debug.d.ts.map +1 -1
  343. package/dist/adapter/zigate/debug.js +19 -22
  344. package/dist/adapter/zigate/debug.js.map +1 -1
  345. package/dist/adapter/zigate/driver/buffaloZiGate.d.ts +18 -18
  346. package/dist/adapter/zigate/driver/buffaloZiGate.js +139 -139
  347. package/dist/adapter/zigate/driver/buffaloZiGate.js.map +1 -1
  348. package/dist/adapter/zigate/driver/commandType.d.ts +41 -41
  349. package/dist/adapter/zigate/driver/commandType.js +385 -385
  350. package/dist/adapter/zigate/driver/commandType.js.map +1 -1
  351. package/dist/adapter/zigate/driver/constants.d.ts +276 -276
  352. package/dist/adapter/zigate/driver/constants.d.ts.map +1 -1
  353. package/dist/adapter/zigate/driver/constants.js +371 -371
  354. package/dist/adapter/zigate/driver/constants.js.map +1 -1
  355. package/dist/adapter/zigate/driver/frame.d.ts +26 -26
  356. package/dist/adapter/zigate/driver/frame.js +172 -172
  357. package/dist/adapter/zigate/driver/frame.js.map +1 -1
  358. package/dist/adapter/zigate/driver/messageType.d.ts +11 -11
  359. package/dist/adapter/zigate/driver/messageType.js +278 -278
  360. package/dist/adapter/zigate/driver/messageType.js.map +1 -1
  361. package/dist/adapter/zigate/driver/parameterType.d.ts +20 -20
  362. package/dist/adapter/zigate/driver/parameterType.js +23 -23
  363. package/dist/adapter/zigate/driver/ziGateObject.d.ts +23 -23
  364. package/dist/adapter/zigate/driver/ziGateObject.js +110 -106
  365. package/dist/adapter/zigate/driver/ziGateObject.js.map +1 -1
  366. package/dist/adapter/zigate/driver/zigate.d.ts +49 -49
  367. package/dist/adapter/zigate/driver/zigate.d.ts.map +1 -1
  368. package/dist/adapter/zigate/driver/zigate.js +296 -303
  369. package/dist/adapter/zigate/driver/zigate.js.map +1 -1
  370. package/dist/buffalo/buffalo.d.ts +50 -50
  371. package/dist/buffalo/buffalo.js +324 -322
  372. package/dist/buffalo/buffalo.js.map +1 -1
  373. package/dist/buffalo/index.d.ts +3 -3
  374. package/dist/buffalo/index.js +33 -33
  375. package/dist/buffalo/tstype.d.ts +8 -8
  376. package/dist/buffalo/tstype.js +2 -2
  377. package/dist/controller/controller.d.ts +113 -113
  378. package/dist/controller/controller.d.ts.map +1 -1
  379. package/dist/controller/controller.js +641 -619
  380. package/dist/controller/controller.js.map +1 -1
  381. package/dist/controller/database.d.ts +18 -18
  382. package/dist/controller/database.js +96 -93
  383. package/dist/controller/database.js.map +1 -1
  384. package/dist/controller/events.d.ts +58 -58
  385. package/dist/controller/events.d.ts.map +1 -1
  386. package/dist/controller/events.js +108 -101
  387. package/dist/controller/events.js.map +1 -1
  388. package/dist/controller/greenPower.d.ts +12 -12
  389. package/dist/controller/greenPower.js +221 -220
  390. package/dist/controller/greenPower.js.map +1 -1
  391. package/dist/controller/helpers/index.d.ts +2 -2
  392. package/dist/controller/helpers/index.js +28 -28
  393. package/dist/controller/helpers/request.d.ts +21 -22
  394. package/dist/controller/helpers/request.d.ts.map +1 -1
  395. package/dist/controller/helpers/request.js +77 -71
  396. package/dist/controller/helpers/request.js.map +1 -1
  397. package/dist/controller/helpers/requestQueue.d.ts +13 -0
  398. package/dist/controller/helpers/requestQueue.d.ts.map +1 -0
  399. package/dist/controller/helpers/requestQueue.js +116 -0
  400. package/dist/controller/helpers/requestQueue.js.map +1 -0
  401. package/dist/controller/helpers/zclFrameConverter.d.ts +7 -7
  402. package/dist/controller/helpers/zclFrameConverter.d.ts.map +1 -1
  403. package/dist/controller/helpers/zclFrameConverter.js +50 -31
  404. package/dist/controller/helpers/zclFrameConverter.js.map +1 -1
  405. package/dist/controller/helpers/zclTransactionSequenceNumber.d.ts +5 -5
  406. package/dist/controller/helpers/zclTransactionSequenceNumber.js +13 -13
  407. package/dist/controller/helpers/zclTransactionSequenceNumber.js.map +1 -1
  408. package/dist/controller/index.d.ts +5 -5
  409. package/dist/controller/index.js +8 -8
  410. package/dist/controller/logger-stub.d.ts +6 -6
  411. package/dist/controller/logger-stub.js +2 -2
  412. package/dist/controller/model/device.d.ts +132 -133
  413. package/dist/controller/model/device.d.ts.map +1 -1
  414. package/dist/controller/model/device.js +724 -717
  415. package/dist/controller/model/device.js.map +1 -1
  416. package/dist/controller/model/endpoint.d.ts +128 -131
  417. package/dist/controller/model/endpoint.d.ts.map +1 -1
  418. package/dist/controller/model/endpoint.js +755 -816
  419. package/dist/controller/model/endpoint.js.map +1 -1
  420. package/dist/controller/model/entity.d.ts +14 -14
  421. package/dist/controller/model/entity.js +26 -26
  422. package/dist/controller/model/entity.js.map +1 -1
  423. package/dist/controller/model/group.d.ts +38 -38
  424. package/dist/controller/model/group.d.ts.map +1 -1
  425. package/dist/controller/model/group.js +225 -221
  426. package/dist/controller/model/group.js.map +1 -1
  427. package/dist/controller/model/index.d.ts +5 -5
  428. package/dist/controller/model/index.js +14 -14
  429. package/dist/controller/touchlink.d.ts +19 -19
  430. package/dist/controller/touchlink.js +159 -157
  431. package/dist/controller/touchlink.js.map +1 -1
  432. package/dist/controller/tstype.d.ts +20 -21
  433. package/dist/controller/tstype.d.ts.map +1 -1
  434. package/dist/controller/tstype.js +8 -9
  435. package/dist/controller/tstype.js.map +1 -1
  436. package/dist/index.d.ts +3 -3
  437. package/dist/index.js +33 -33
  438. package/dist/models/backup-storage-legacy.d.ts +26 -26
  439. package/dist/models/backup-storage-legacy.js +2 -2
  440. package/dist/models/backup-storage-unified.d.ts +49 -49
  441. package/dist/models/backup-storage-unified.js +2 -2
  442. package/dist/models/backup.d.ts +37 -37
  443. package/dist/models/backup.js +2 -2
  444. package/dist/models/index.d.ts +4 -4
  445. package/dist/models/index.js +20 -20
  446. package/dist/models/network-options.d.ts +12 -12
  447. package/dist/models/network-options.js +2 -2
  448. package/dist/utils/assertString.d.ts +2 -2
  449. package/dist/utils/assertString.js +8 -8
  450. package/dist/utils/assertString.js.map +1 -1
  451. package/dist/utils/backup.d.ts +20 -20
  452. package/dist/utils/backup.d.ts.map +1 -1
  453. package/dist/utils/backup.js +189 -187
  454. package/dist/utils/backup.js.map +1 -1
  455. package/dist/utils/equalsPartial.d.ts +2 -2
  456. package/dist/utils/equalsPartial.js +11 -11
  457. package/dist/utils/index.d.ts +9 -9
  458. package/dist/utils/index.js +45 -45
  459. package/dist/utils/isNumberArray.d.ts +2 -2
  460. package/dist/utils/isNumberArray.js +6 -6
  461. package/dist/utils/queue.d.ts +11 -11
  462. package/dist/utils/queue.d.ts.map +1 -1
  463. package/dist/utils/queue.js +61 -50
  464. package/dist/utils/queue.js.map +1 -1
  465. package/dist/utils/realpathSync.d.ts +2 -2
  466. package/dist/utils/realpathSync.js +12 -12
  467. package/dist/utils/wait.d.ts +2 -2
  468. package/dist/utils/wait.js +8 -8
  469. package/dist/utils/waitress.d.ts +21 -21
  470. package/dist/utils/waitress.d.ts.map +1 -1
  471. package/dist/utils/waitress.js +68 -61
  472. package/dist/utils/waitress.js.map +1 -1
  473. package/dist/zcl/buffaloZcl.d.ts +41 -41
  474. package/dist/zcl/buffaloZcl.d.ts.map +1 -1
  475. package/dist/zcl/buffaloZcl.js +594 -591
  476. package/dist/zcl/buffaloZcl.js.map +1 -1
  477. package/dist/zcl/definition/buffaloZclDataType.d.ts +17 -17
  478. package/dist/zcl/definition/buffaloZclDataType.js +20 -20
  479. package/dist/zcl/definition/cluster.d.ts +29 -29
  480. package/dist/zcl/definition/cluster.d.ts.map +1 -1
  481. package/dist/zcl/definition/cluster.js +5520 -5335
  482. package/dist/zcl/definition/cluster.js.map +1 -1
  483. package/dist/zcl/definition/dataType.d.ts +59 -59
  484. package/dist/zcl/definition/dataType.js +64 -64
  485. package/dist/zcl/definition/direction.d.ts +5 -5
  486. package/dist/zcl/definition/direction.js +8 -8
  487. package/dist/zcl/definition/endpointDeviceType.d.ts +4 -4
  488. package/dist/zcl/definition/endpointDeviceType.js +15 -15
  489. package/dist/zcl/definition/foundation.d.ts +11 -11
  490. package/dist/zcl/definition/foundation.js +167 -167
  491. package/dist/zcl/definition/frameControl.d.ts +10 -10
  492. package/dist/zcl/definition/frameControl.js +2 -2
  493. package/dist/zcl/definition/frameType.d.ts +5 -5
  494. package/dist/zcl/definition/frameType.js +8 -8
  495. package/dist/zcl/definition/index.d.ts +13 -13
  496. package/dist/zcl/definition/index.js +51 -51
  497. package/dist/zcl/definition/manufacturerCode.d.ts +1077 -1074
  498. package/dist/zcl/definition/manufacturerCode.d.ts.map +1 -1
  499. package/dist/zcl/definition/manufacturerCode.js +1082 -1079
  500. package/dist/zcl/definition/manufacturerCode.js.map +1 -1
  501. package/dist/zcl/definition/powerSource.d.ts +4 -4
  502. package/dist/zcl/definition/powerSource.js +12 -12
  503. package/dist/zcl/definition/status.d.ts +38 -38
  504. package/dist/zcl/definition/status.js +41 -41
  505. package/dist/zcl/definition/tstype.d.ts +16 -16
  506. package/dist/zcl/definition/tstype.js +2 -2
  507. package/dist/zcl/index.d.ts +16 -15
  508. package/dist/zcl/index.d.ts.map +1 -1
  509. package/dist/zcl/index.js +55 -55
  510. package/dist/zcl/index.js.map +1 -1
  511. package/dist/zcl/tstype.d.ts +56 -56
  512. package/dist/zcl/tstype.js +9 -10
  513. package/dist/zcl/tstype.js.map +1 -1
  514. package/dist/zcl/utils.d.ts +6 -6
  515. package/dist/zcl/utils.js +164 -165
  516. package/dist/zcl/utils.js.map +1 -1
  517. package/dist/zcl/zclFrame.d.ts +40 -45
  518. package/dist/zcl/zclFrame.d.ts.map +1 -1
  519. package/dist/zcl/zclFrame.js +351 -347
  520. package/dist/zcl/zclFrame.js.map +1 -1
  521. package/dist/zcl/zclHeader.d.ts +9 -0
  522. package/dist/zcl/zclHeader.d.ts.map +1 -0
  523. package/dist/zcl/zclHeader.js +3 -0
  524. package/dist/zcl/zclHeader.js.map +1 -0
  525. package/dist/zcl/zclStatusError.d.ts +5 -5
  526. package/dist/zcl/zclStatusError.js +14 -13
  527. package/dist/zcl/zclStatusError.js.map +1 -1
  528. package/package.json +11 -11
  529. package/release-please-config.json +1 -5
  530. package/tsconfig.json +4 -2
@@ -0,0 +1,2664 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import EventEmitter from "events";
4
+ import { SerialPortOptions } from "../../tstype";
5
+ import { EmberOutgoingMessageType, EmberCounterType, EmberDutyCycleState, EmberEntropySource, EmberEventUnits, EmberLibraryId, EmberLibraryStatus, EmberMultiPhyNwkConfig, EmberNetworkStatus, EmberNodeType, EmberStatus, EzspNetworkScanType, EzspStatus, SLStatus, EmberIncomingMessageType, EmberSourceRouteDiscoveryMode, EmberMacPassthroughType, EmberKeyStatus, SecManFlag, EmberDeviceUpdate, EmberJoinDecision, EzspZllNetworkOperation, EmberGpSecurityLevel, EmberGpKeyType, EmberTXPowerMode, EmberExtendedSecurityBitmask, EmberStackError } from "../enums";
6
+ import { EmberVersion, EmberEUI64, EmberPanId, EmberBeaconData, EmberBeaconIterator, EmberBindingTableEntry, EmberChildData, EmberDutyCycleLimits, EmberMultiPhyRadioParameters, EmberNeighborTableEntry, EmberNetworkInitStruct, EmberNetworkParameters, EmberNodeId, EmberPerDeviceDutyCycle, EmberRouteTableEntry, EmberApsFrame, EmberMulticastTableEntry, EmberBeaconClassificationParams, EmberInitialSecurityState, EmberCurrentSecurityState, SecManContext, SecManKey, SecManNetworkKeyInfo, SecManAPSKeyMetadata, EmberKeyData, EmberAesMmoHashContext, EmberPublicKeyData, EmberCertificateData, EmberSmacData, EmberPublicKey283k1Data, EmberCertificate283k1Data, EmberMessageDigest, EmberSignatureData, EmberSignature283k1Data, EmberPrivateKeyData, EmberZllNetwork, EmberZllInitialSecurityState, EmberZllDeviceInfoRecord, EmberZllAddressAssignment, EmberTokTypeStackZllData, EmberTokTypeStackZllSecurity, EmberGpAddress, EmberGpProxyTableEntry, EmberGpSinkTableEntry, EmberTokenInfo, EmberTokenData, EmberZigbeeNetwork } from "../types";
7
+ import { EmberLeaveReason, EmberRejoinReason, EzspConfigId, EzspEndpointFlag, EzspExtendedValueId, EzspMfgTokenId, EzspPolicyId, EzspValueId } from "./enums";
8
+ import { UartAsh } from "../uart/ash";
9
+ export declare enum EzspEvents {
10
+ ncpNeedsResetAndInit = "ncpNeedsResetAndInit",
11
+ /** params => status: EmberZdoStatus, sender: EmberNodeId, apsFrame: EmberApsFrame, payload: { cluster-dependent @see zdo.ts } */
12
+ ZDO_RESPONSE = "ZDO_RESPONSE",
13
+ /** params => type: EmberIncomingMessageType, apsFrame: EmberApsFrame, lastHopLqi: number, sender: EmberNodeId, messageContents: Buffer */
14
+ INCOMING_MESSAGE = "INCOMING_MESSAGE",
15
+ /** params => sourcePanId: EmberPanId, sourceAddress: EmberEUI64, groupId: number | null, lastHopLqi: number, messageContents: Buffer */
16
+ TOUCHLINK_MESSAGE = "TOUCHLINK_MESSAGE",
17
+ /** params => sender: EmberNodeId, apsFrame: EmberApsFrame, payload: EndDeviceAnnouncePayload */
18
+ END_DEVICE_ANNOUNCE = "END_DEVICE_ANNOUNCE",
19
+ /** params => status: EmberStatus */
20
+ STACK_STATUS = "STACK_STATUS",
21
+ /** params => newNodeId: EmberNodeId, newNodeEui64: EmberEUI64, status: EmberDeviceUpdate, policyDecision: EmberJoinDecision, parentOfNewNodeId: EmberNodeId */
22
+ TRUST_CENTER_JOIN = "TRUST_CENTER_JOIN",
23
+ /** params => type: EmberOutgoingMessageType, indexOrDestination: number, apsFrame: EmberApsFrame, messageTag: number */
24
+ /** params => type: EmberOutgoingMessageType, indexOrDestination: number, apsFrame: EmberApsFrame, messageTag: number */
25
+ MESSAGE_SENT_DELIVERY_FAILED = "MESSAGE_SENT_DELIVERY_FAILED",
26
+ /** params => sequenceNumber: number, commandIdentifier: number, sourceId: number, frameCounter: number, gpdCommandId: number, gpdCommandPayload: Buffer, gpdLink: number */
27
+ GREENPOWER_MESSAGE = "GREENPOWER_MESSAGE"
28
+ }
29
+ /**
30
+ * Host EZSP layer.
31
+ *
32
+ * Provides functions that allow the Host application to send every EZSP command to the NCP.
33
+ *
34
+ * Commands to send to the serial>ASH layers all are named `ezsp${CommandName}`.
35
+ * They do nothing but build the command, send it and return the value(s).
36
+ * Callers are expected to handle errors appropriately.
37
+ * - They will throw `EzspStatus` if `sendCommand` fails or the returned value(s) by NCP are invalid (wrong length, etc).
38
+ * - Most will return `EmberStatus` given by NCP (some `EzspStatus`, some `SLStatus`...).
39
+ *
40
+ * @event 'ncpNeedsResetAndInit(EzspStatus)' An error was detected that requires resetting the NCP.
41
+ */
42
+ export declare class Ezsp extends EventEmitter {
43
+ private readonly tickInterval;
44
+ readonly ash: UartAsh;
45
+ private readonly buffalo;
46
+ /** The contents of the current EZSP frame. CAREFUL using this guy, it's pre-allocated. */
47
+ private readonly frameContents;
48
+ /** The total Length of the incoming frame */
49
+ private frameLength;
50
+ private initialVersionSent;
51
+ /** True if a command is in the process of being sent. */
52
+ private sendingCommand;
53
+ /** EZSP frame sequence number. Used in EZSP_SEQUENCE_INDEX byte. */
54
+ private frameSequence;
55
+ /** Sequence used for EZSP send() tagging. static uint8_t */
56
+ private sendSequence;
57
+ /** If if a command is currently waiting for a response. Used to manage async CBs vs command responses */
58
+ private waitingForResponse;
59
+ /** Awaiting response resolve/timer struct. If waitingForResponse is not true, this should not be used. */
60
+ private responseWaiter;
61
+ /** Counter for Queue Full errors */
62
+ counterErrQueueFull: number;
63
+ /** Handle used to tick for possible received callbacks */
64
+ private tickHandle;
65
+ constructor(tickInterval: number, options: SerialPortOptions);
66
+ /**
67
+ * Returns the number of EZSP responses that have been received by the serial
68
+ * protocol and are ready to be collected by the EZSP layer via
69
+ * responseReceived().
70
+ */
71
+ get pendingResponseCount(): number;
72
+ /**
73
+ * Create a string representation of the last frame in storage (sent or received).
74
+ */
75
+ get frameToString(): string;
76
+ private initVariables;
77
+ start(): Promise<EzspStatus>;
78
+ /**
79
+ * Cleanly close down the serial protocol (UART).
80
+ * After this function has been called, init() must be called to resume communication with the NCP.
81
+ */
82
+ stop(): Promise<void>;
83
+ /**
84
+ * Check if connected.
85
+ * If not, attempt to restore the connection.
86
+ *
87
+ * @returns
88
+ */
89
+ checkConnection(): boolean;
90
+ private onAshHostError;
91
+ private onAshNCPError;
92
+ private onAshFrame;
93
+ /**
94
+ * Event from the EZSP layer indicating that the transaction with the NCP could not be completed due to a
95
+ * serial protocol error or that the response received from the NCP reported an error.
96
+ * The status parameter provides more information about the error.
97
+ *
98
+ * @param status
99
+ */
100
+ ezspErrorHandler(status: EzspStatus): void;
101
+ private registerHandlers;
102
+ /**
103
+ * The Host application must call this function periodically to allow the EZSP layer to handle asynchronous events.
104
+ */
105
+ private tick;
106
+ private nextFrameSequence;
107
+ private startCommand;
108
+ /**
109
+ * Sends the current EZSP command frame. Returns EZSP_SUCCESS if the command was sent successfully.
110
+ * Any other return value means that an error has been detected by the serial protocol layer.
111
+ *
112
+ * if ezsp.sendCommand fails early, this will be:
113
+ * - EzspStatus.ERROR_INVALID_CALL
114
+ * - EzspStatus.NOT_CONNECTED
115
+ * - EzspStatus.ERROR_COMMAND_TOO_LONG
116
+ *
117
+ * if ezsp.sendCommand fails, this will be whatever ash.send returns:
118
+ * - EzspStatus.SUCCESS
119
+ * - EzspStatus.NO_TX_SPACE
120
+ * - EzspStatus.DATA_FRAME_TOO_SHORT
121
+ * - EzspStatus.DATA_FRAME_TOO_LONG
122
+ * - EzspStatus.NOT_CONNECTED
123
+ *
124
+ * if ezsp.sendCommand times out, this will be EzspStatus.ASH_ACK_TIMEOUT (XXX: for now)
125
+ *
126
+ * if ezsp.sendCommand resolves, this will be whatever ezsp.responseReceived returns:
127
+ * - EzspStatus.NO_RX_DATA (should not happen if command was sent (since we subscribe to frame event to trigger function))
128
+ * - status from EzspFrameID.INVALID_COMMAND status byte
129
+ * - EzspStatus.ERROR_UNSUPPORTED_CONTROL
130
+ * - EzspStatus.ERROR_WRONG_DIRECTION
131
+ * - EzspStatus.ERROR_TRUNCATED
132
+ * - EzspStatus.SUCCESS
133
+ */
134
+ private sendCommand;
135
+ /**
136
+ * Checks whether a new EZSP response frame has been received.
137
+ * If any, the response payload is stored in frameContents/frameLength.
138
+ * Any other return value means that an error has been detected by the serial protocol layer.
139
+ * @returns NO_RX_DATA if no new response has been received.
140
+ * @returns SUCCESS if a new response has been received.
141
+ */
142
+ checkResponseReceived(): EzspStatus;
143
+ /**
144
+ * Check if a response was received and sets the stage for parsing if valid (indexes buffalo to params index).
145
+ * @returns
146
+ */
147
+ responseReceived(): EzspStatus;
148
+ /**
149
+ * Dispatches callback frames handlers.
150
+ */
151
+ callbackDispatch(): void;
152
+ /**
153
+ *
154
+ * @returns uint8_t
155
+ */
156
+ private nextSendSequence;
157
+ /**
158
+ * Calls ezspSend${x} based on type and takes care of tagging message.
159
+ *
160
+ * Alias types expect `alias` & `sequence` params, along with `apsFrame.radius`.
161
+ *
162
+ * @param type Specifies the outgoing message type.
163
+ * @param indexOrDestination uint16_t Depending on the type of addressing used, this is either the EmberNodeId of the destination,
164
+ * an index into the address table, or an index into the binding table.
165
+ * Unused for multicast types.
166
+ * This must be one of the three ZigBee broadcast addresses for broadcast.
167
+ * @param apsFrame [IN/OUT] EmberApsFrame * The APS frame which is to be added to the message.
168
+ * @param message uint8_t * Content of the message.
169
+ * @param alias The alias source address
170
+ * @param sequence uint8_t The alias sequence number
171
+ * @returns Result of the ezspSend${x} call or EmberStatus.BAD_ARGUMENT if type not supported.
172
+ * @returns apsSequence as returned by ezspSend${x} command
173
+ * @returns messageTag Tag used for ezspSend${x} command
174
+ */
175
+ send(type: EmberOutgoingMessageType, indexOrDestination: number, apsFrame: EmberApsFrame, message: Buffer, alias: EmberNodeId, sequence: number): Promise<[EmberStatus, messageTag: number]>;
176
+ /**
177
+ * Retrieving the new version info.
178
+ * Wrapper for `ezspGetValue`.
179
+ * @returns Send status
180
+ * @returns EmberVersion*, null if status not SUCCESS.
181
+ */
182
+ ezspGetVersionStruct(): Promise<[EzspStatus, version: EmberVersion]>;
183
+ /**
184
+ * Function for manipulating the endpoints flags on the NCP.
185
+ * Wrapper for `ezspGetExtendedValue`
186
+ * @param endpoint uint8_t
187
+ * @param flags EzspEndpointFlags
188
+ * @returns EzspStatus
189
+ */
190
+ ezspSetEndpointFlags(endpoint: number, flags: EzspEndpointFlag): Promise<EzspStatus>;
191
+ /**
192
+ * Function for manipulating the endpoints flags on the NCP.
193
+ * Wrapper for `ezspGetExtendedValue`.
194
+ * @param endpoint uint8_t
195
+ * @returns EzspStatus
196
+ * @returns flags
197
+ */
198
+ ezspGetEndpointFlags(endpoint: number): Promise<[EzspStatus, flags: EzspEndpointFlag]>;
199
+ /**
200
+ * Wrapper for `ezspGetExtendedValue`.
201
+ * @param EmberNodeId
202
+ * @param destination
203
+ * @returns EzspStatus
204
+ * @returns overhead uint8_t
205
+ */
206
+ ezspGetSourceRouteOverhead(destination: EmberNodeId): Promise<[EzspStatus, overhead: number]>;
207
+ /**
208
+ * Wrapper for `ezspGetExtendedValue`.
209
+ * @returns EzspStatus
210
+ * @returns reason
211
+ * @returns nodeId EmberNodeId*
212
+ */
213
+ ezspGetLastLeaveReason(): Promise<[EzspStatus, reason: EmberLeaveReason, nodeId: EmberNodeId]>;
214
+ /**
215
+ * Wrapper for `ezspGetValue`.
216
+ * @returns EzspStatus
217
+ * @returns reason
218
+ */
219
+ ezspGetLastRejoinReason(): Promise<[EzspStatus, reason: EmberRejoinReason]>;
220
+ /**
221
+ * Wrapper for `ezspSetValue`.
222
+ * @param mask
223
+ * @returns
224
+ */
225
+ ezspSetExtendedSecurityBitmask(mask: EmberExtendedSecurityBitmask): Promise<EzspStatus>;
226
+ /**
227
+ * Wrapper for `ezspGetValue`.
228
+ * @returns
229
+ */
230
+ ezspGetExtendedSecurityBitmask(): Promise<[EzspStatus, mask: EmberExtendedSecurityBitmask]>;
231
+ /**
232
+ * Wrapper for `ezspSetValue`.
233
+ * @returns
234
+ */
235
+ ezspStartWritingStackTokens(): Promise<EzspStatus>;
236
+ /**
237
+ * Wrapper for `ezspSetValue`.
238
+ * @returns
239
+ */
240
+ ezspStopWritingStackTokens(): Promise<EzspStatus>;
241
+ /**
242
+ * The command allows the Host to specify the desired EZSP version and must be
243
+ * sent before any other command. The response provides information about the
244
+ * firmware running on the NCP.
245
+ *
246
+ * @param desiredProtocolVersion uint8_t The EZSP version the Host wishes to use.
247
+ * To successfully set the version and allow other commands, this must be same as EZSP_PROTOCOL_VERSION.
248
+ * @return
249
+ * - uint8_t The EZSP version the NCP is using.
250
+ * - uint8_t * The type of stack running on the NCP (2).
251
+ * - uint16_t * The version number of the stack.
252
+ */
253
+ ezspVersion(desiredProtocolVersion: number): Promise<[protocolVersion: number, stackType: number, stackVersion: number]>;
254
+ /**
255
+ * Reads a configuration value from the NCP.
256
+ *
257
+ * @param configId Identifies which configuration value to read.
258
+ * @returns
259
+ * - EzspStatus.SUCCESS if the value was read successfully,
260
+ * - EzspStatus.ERROR_INVALID_ID if the NCP does not recognize configId.
261
+ * - uint16_t * The configuration value.
262
+ */
263
+ ezspGetConfigurationValue(configId: EzspConfigId): Promise<[EzspStatus, value: number]>;
264
+ /**
265
+ * Writes a configuration value to the NCP. Configuration values can be modified
266
+ * by the Host after the NCP has reset. Once the status of the stack changes to
267
+ * EMBER_NETWORK_UP, configuration values can no longer be modified and this
268
+ * command will respond with EzspStatus.ERROR_INVALID_CALL.
269
+ *
270
+ * @param configId Identifies which configuration value to change.
271
+ * @param value uint16_t The new configuration value.
272
+ * @returns EzspStatus
273
+ * - EzspStatus.SUCCESS if the configuration value was changed,
274
+ * - EzspStatus.ERROR_OUT_OF_MEMORY if the new value exceeded the available memory,
275
+ * - EzspStatus.ERROR_INVALID_VALUE if the new value was out of bounds,
276
+ * - EzspStatus.ERROR_INVALID_ID if the NCP does not recognize configId,
277
+ * - EzspStatus.ERROR_INVALID_CALL if configuration values can no longer be modified.
278
+ */
279
+ ezspSetConfigurationValue(configId: EzspConfigId, value: number): Promise<EzspStatus>;
280
+ /**
281
+ * Read attribute data on NCP endpoints.
282
+ * @param endpoint uint8_t Endpoint
283
+ * @param cluster uint16_t Cluster.
284
+ * @param attributeId uint16_t Attribute ID.
285
+ * @param mask uint8_t Mask.
286
+ * @param manufacturerCode uint16_t Manufacturer code.
287
+ * @returns
288
+ * - An EmberStatus value indicating success or the reason for failure.
289
+ * - uint8_t * Attribute data type.
290
+ * - uint8_t * Length of attribute data.
291
+ * - uint8_t * Attribute data.
292
+ */
293
+ ezspReadAttribute(endpoint: number, cluster: number, attributeId: number, mask: number, manufacturerCode: number, readLength: number): Promise<[EmberStatus, dataType: number, outReadLength: number, data: number[]]>;
294
+ /**
295
+ * Write attribute data on NCP endpoints.
296
+ * @param endpoint uint8_t Endpoint
297
+ * @param cluster uint16_t Cluster.
298
+ * @param attributeId uint16_t Attribute ID.
299
+ * @param mask uint8_t Mask.
300
+ * @param manufacturerCode uint16_t Manufacturer code.
301
+ * @param overrideReadOnlyAndDataType Override read only and data type.
302
+ * @param justTest Override read only and data type.
303
+ * @param dataType uint8_t Attribute data type.
304
+ * @param data uint8_t * Attribute data.
305
+ * @returns EmberStatus An EmberStatus value indicating success or the reason for failure.
306
+ */
307
+ ezspWriteAttribute(endpoint: number, cluster: number, attributeId: number, mask: number, manufacturerCode: number, overrideReadOnlyAndDataType: boolean, justTest: boolean, dataType: number, data: Buffer): Promise<EmberStatus>;
308
+ /**
309
+ * Configures endpoint information on the NCP. The NCP does not remember these
310
+ * settings after a reset. Endpoints can be added by the Host after the NCP has
311
+ * reset. Once the status of the stack changes to EMBER_NETWORK_UP, endpoints
312
+ * can no longer be added and this command will respond with EzspStatus.ERROR_INVALID_CALL.
313
+ * @param endpoint uint8_t The application endpoint to be added.
314
+ * @param profileId uint16_t The endpoint's application profile.
315
+ * @param deviceId uint16_t The endpoint's device ID within the application profile.
316
+ * @param deviceVersion uint8_t The endpoint's device version.
317
+ * @param inputClusterList uint16_t * Input cluster IDs the endpoint will accept.
318
+ * @param outputClusterList uint16_t * Output cluster IDs the endpoint may send.
319
+ * @returns EzspStatus
320
+ * - EzspStatus.SUCCESS if the endpoint was added,
321
+ * - EzspStatus.ERROR_OUT_OF_MEMORY if there is not enough memory available to add the endpoint,
322
+ * - EzspStatus.ERROR_INVALID_VALUE if the endpoint already exists,
323
+ * - EzspStatus.ERROR_INVALID_CALL if endpoints can no longer be added.
324
+ */
325
+ ezspAddEndpoint(endpoint: number, profileId: number, deviceId: number, deviceVersion: number, inputClusterList: number[], outputClusterList: number[]): Promise<EzspStatus>;
326
+ /**
327
+ * Allows the Host to change the policies used by the NCP to make fast
328
+ * decisions.
329
+ * @param policyId Identifies which policy to modify.
330
+ * @param decisionId The new decision for the specified policy.
331
+ * @returns
332
+ * - EzspStatus.SUCCESS if the policy was changed,
333
+ * - EzspStatus.ERROR_INVALID_ID if the NCP does not recognize policyId.
334
+ */
335
+ ezspSetPolicy(policyId: EzspPolicyId, decisionId: number): Promise<EzspStatus>;
336
+ /**
337
+ * Allows the Host to read the policies used by the NCP to make fast decisions.
338
+ * @param policyId Identifies which policy to read.
339
+ * @returns
340
+ * - EzspStatus.SUCCESS if the policy was read successfully,
341
+ * - EzspStatus.ERROR_INVALID_ID if the NCP does not recognize policyId.
342
+ * - EzspDecisionId * The current decision for the specified policy.
343
+ */
344
+ ezspGetPolicy(policyId: EzspPolicyId): Promise<[EzspStatus, number]>;
345
+ /**
346
+ * Triggers a pan id update message.
347
+ * @param The new Pan Id
348
+ * @returns true if the request was successfully handed to the stack, false otherwise
349
+ */
350
+ ezspSendPanIdUpdate(newPan: EmberPanId): Promise<boolean>;
351
+ /**
352
+ * Reads a value from the NCP.
353
+ * @param valueId Identifies which value to read.
354
+ * @returns
355
+ * - EzspStatus.SUCCESS if the value was read successfully,
356
+ * - EzspStatus.ERROR_INVALID_ID if the NCP does not recognize valueId,
357
+ * - EzspStatus.ERROR_INVALID_VALUE if the length of the returned value exceeds the size of local storage allocated to receive it.
358
+ * - uint8_t * Both a command and response parameter.
359
+ * On command, the maximum in bytes of local storage allocated to receive the returned value.
360
+ * On response, the actual length in bytes of the returned value.
361
+ * - uint8_t * The value.
362
+ */
363
+ ezspGetValue(valueId: EzspValueId, valueLength: number): Promise<[EzspStatus, outValueLength: number, outValue: number[]]>;
364
+ /**
365
+ * Reads a value from the NCP but passes an extra argument specific to the value
366
+ * being retrieved.
367
+ * @param valueId Identifies which extended value ID to read.
368
+ * @param characteristics uint32_t Identifies which characteristics of the extended value ID to read. These are specific to the value being read.
369
+ * @returns
370
+ * - EzspStatus.SUCCESS if the value was read successfully,
371
+ * - EzspStatus.ERROR_INVALID_ID if the NCP does not recognize valueId,
372
+ * - EzspStatus.ERROR_INVALID_VALUE if the length of the returned value exceeds the size of local storage allocated to receive it.
373
+ * - uint8_t * Both a command and response parameter.
374
+ * On command, the maximum in bytes of local storage allocated to receive the returned value.
375
+ * On response, the actual length in bytes of the returned value.
376
+ * - uint8_t * The value.
377
+ */
378
+ ezspGetExtendedValue(valueId: EzspExtendedValueId, characteristics: number, valueLength: number): Promise<[EzspStatus, outValueLength: number, outValue: number[]]>;
379
+ /**
380
+ * Writes a value to the NCP.
381
+ * @param valueId Identifies which value to change.
382
+ * @param valueLength uint8_t The length of the value parameter in bytes.
383
+ * @param value uint8_t * The new value.
384
+ * @returns EzspStatus
385
+ * - EzspStatus.SUCCESS if the value was changed,
386
+ * - EzspStatus.ERROR_INVALID_VALUE if the new value was out of bounds,
387
+ * - EzspStatus.ERROR_INVALID_ID if the NCP does not recognize valueId,
388
+ * - EzspStatus.ERROR_INVALID_CALL if the value could not be modified.
389
+ */
390
+ ezspSetValue(valueId: EzspValueId, valueLength: number, value: number[]): Promise<EzspStatus>;
391
+ /**
392
+ * Allows the Host to control the broadcast behaviour of a routing device used
393
+ * by the NCP.
394
+ * @param config uint8_t Passive ack config enum.
395
+ * @param minAcksNeeded uint8_t The minimum number of acknowledgments (re-broadcasts) to wait for until
396
+ * deeming the broadcast transmission complete.
397
+ * @returns EmberStatus An EmberStatus value indicating success or the reason for failure.
398
+ */
399
+ ezspSetPassiveAckConfig(config: number, minAcksNeeded: number): Promise<EmberStatus>;
400
+ /**
401
+ * A command which does nothing. The Host can use this to set the sleep mode or to check the status of the NCP.
402
+ */
403
+ ezspNop(): Promise<void>;
404
+ /**
405
+ * Variable length data from the Host is echoed back by the NCP. This command
406
+ * has no other effects and is designed for testing the link between the Host and NCP.
407
+ * @param data uint8_t * The data to be echoed back.
408
+ * @returns
409
+ * - The length of the echo parameter in bytes.
410
+ * - echo uint8_t * The echo of the data.
411
+ */
412
+ ezspEcho(data: Buffer): Promise<Buffer>;
413
+ /**
414
+ * Allows the NCP to respond with a pending callback.
415
+ */
416
+ ezspCallback(): Promise<void>;
417
+ /**
418
+ * Callback
419
+ * Indicates that there are currently no pending callbacks.
420
+ */
421
+ ezspNoCallbacks(): void;
422
+ /**
423
+ * Sets a token (8 bytes of non-volatile storage) in the Simulated EEPROM of the NCP.
424
+ * @param tokenId uint8_t Which token to set
425
+ * @param tokenData uint8_t * The data to write to the token.
426
+ * @returns EmberStatus An EmberStatus value indicating success or the reason for failure.
427
+ */
428
+ ezspSetToken(tokenId: number, tokenData: number[]): Promise<EmberStatus>;
429
+ /**
430
+ * Retrieves a token (8 bytes of non-volatile storage) from the Simulated EEPROM of the NCP.
431
+ * @param tokenId uint8_t Which token to read
432
+ * @returns
433
+ * - An EmberStatus value indicating success or the reason for failure.
434
+ * - uint8_t * The contents of the token.
435
+ */
436
+ ezspGetToken(tokenId: number): Promise<[EmberStatus, tokenData: number[]]>;
437
+ /**
438
+ * Retrieves a manufacturing token from the Flash Information Area of the NCP
439
+ * (except for EZSP_STACK_CAL_DATA which is managed by the stack).
440
+ * @param Which manufacturing token to read.
441
+ * @returns
442
+ * - uint8_t The length of the tokenData parameter in bytes.
443
+ * - uint8_t * The manufacturing token data.
444
+ */
445
+ ezspGetMfgToken(tokenId: EzspMfgTokenId): Promise<[number, tokenData: number[]]>;
446
+ /**
447
+ * Sets a manufacturing token in the Customer Information Block (CIB) area of
448
+ * the NCP if that token currently unset (fully erased). Cannot be used with
449
+ * EZSP_STACK_CAL_DATA, EZSP_STACK_CAL_FILTER, EZSP_MFG_ASH_CONFIG, or
450
+ * EZSP_MFG_CBKE_DATA token.
451
+ * @param tokenId Which manufacturing token to set.
452
+ * @param tokenData uint8_t * The manufacturing token data.
453
+ * @returns An EmberStatus value indicating success or the reason for failure.
454
+ */
455
+ ezspSetMfgToken(tokenId: EzspMfgTokenId, tokenData: Buffer): Promise<EmberStatus>;
456
+ /**
457
+ * Callback
458
+ * A callback invoked to inform the application that a stack token has changed.
459
+ * @param tokenAddress uint16_t The address of the stack token that has changed.
460
+ */
461
+ ezspStackTokenChangedHandler(tokenAddress: number): void;
462
+ /**
463
+ * Returns a pseudorandom number.
464
+ * @returns
465
+ * - Always returns EMBER_SUCCESS.
466
+ * - uint16_t * A pseudorandom number.
467
+ */
468
+ ezspGetRandomNumber(): Promise<[EmberStatus, value: number]>;
469
+ /**
470
+ * Sets a timer on the NCP. There are 2 independent timers available for use by the Host.
471
+ * A timer can be cancelled by setting time to 0 or units to EMBER_EVENT_INACTIVE.
472
+ * @param timerId uint8_t Which timer to set (0 or 1).
473
+ * @param time uint16_t The delay before the timerHandler callback will be generated.
474
+ * Note that the timer clock is free running and is not synchronized with this command.
475
+ * This means that the actual delay will be between time and (time - 1). The maximum delay is 32767.
476
+ * @param units The units for time.
477
+ * @param repeat If true, a timerHandler callback will be generated repeatedly. If false, only a single timerHandler callback will be generated.
478
+ * @returns An EmberStatus value indicating success or the reason for failure.
479
+ */
480
+ ezspSetTimer(timerId: number, time: number, units: EmberEventUnits, repeat: boolean): Promise<EmberStatus>;
481
+ /**
482
+ * Gets information about a timer. The Host can use this command to find out how
483
+ * much longer it will be before a previously set timer will generate a
484
+ * callback.
485
+ * @param timerId uint8_t Which timer to get information about (0 or 1).
486
+ * @returns
487
+ * - uint16_t The delay before the timerHandler callback will be generated.
488
+ * - EmberEventUnits * The units for time.
489
+ * - bool * True if a timerHandler callback will be generated repeatedly. False if only a single timerHandler callback will be generated.
490
+ */
491
+ ezspGetTimer(timerId: number): Promise<[number, units: EmberEventUnits, repeat: boolean]>;
492
+ /**
493
+ * Callback
494
+ * A callback from the timer.
495
+ * @param timerId uint8_t Which timer generated the callback (0 or 1).
496
+ */
497
+ ezspTimerHandler(timerId: number): void;
498
+ /**
499
+ * Sends a debug message from the Host to the Network Analyzer utility via the NCP.
500
+ * @param binaryMessage true if the message should be interpreted as binary data, false if the message should be interpreted as ASCII text.
501
+ * @param messageContents uint8_t * The binary message.
502
+ * @returns An EmberStatus value indicating success or the reason for failure.
503
+ */
504
+ ezspDebugWrite(binaryMessage: boolean, messageContents: Buffer): Promise<EmberStatus>;
505
+ /**
506
+ * Retrieves and clears Ember counters. See the EmberCounterType enumeration for the counter types.
507
+ * @returns uint16_t * A list of all counter values ordered according to the EmberCounterType enumeration.
508
+ */
509
+ ezspReadAndClearCounters(): Promise<number[]>;
510
+ /**
511
+ * Retrieves Ember counters. See the EmberCounterType enumeration for the counter types.
512
+ * @returns uint16_t * A list of all counter values ordered according to the EmberCounterType enumeration.
513
+ */
514
+ ezspReadCounters(): Promise<number[]>;
515
+ /**
516
+ * Callback
517
+ * This call is fired when a counter exceeds its threshold
518
+ * @param type Type of Counter
519
+ */
520
+ ezspCounterRolloverHandler(type: EmberCounterType): void;
521
+ /**
522
+ * Used to test that UART flow control is working correctly.
523
+ * @param delay uint16_t Data will not be read from the host for this many milliseconds.
524
+ */
525
+ ezspDelayTest(delay: number): Promise<void>;
526
+ /**
527
+ * This retrieves the status of the passed library ID to determine if it is compiled into the stack.
528
+ * @param libraryId The ID of the library being queried.
529
+ * @returns The status of the library being queried.
530
+ */
531
+ ezspGetLibraryStatus(libraryId: EmberLibraryId): Promise<EmberLibraryStatus>;
532
+ /**
533
+ * Allows the HOST to know whether the NCP is running the XNCP library. If so,
534
+ * the response contains also the manufacturer ID and the version number of the
535
+ * XNCP application that is running on the NCP.
536
+ * @returns
537
+ * - EMBER_SUCCESS if the NCP is running the XNCP library,
538
+ * - EMBER_INVALID_CALL otherwise.
539
+ * - manufacturerId uint16_t * The manufactured ID the user has defined in the XNCP application.
540
+ * - versionNumber uint16_t * The version number of the XNCP application.
541
+ */
542
+ ezspGetXncpInfo(): Promise<[EmberStatus, manufacturerId: number, versionNumber: number]>;
543
+ /**
544
+ * Provides the customer a custom EZSP frame. On the NCP, these frames are only
545
+ * handled if the XNCP library is included. On the NCP side these frames are
546
+ * handled in the emberXNcpIncomingCustomEzspMessageCallback() callback
547
+ * function.
548
+ * @param uint8_t * The payload of the custom frame (maximum 119 bytes).
549
+ * @param uint8_t The expected length of the response.
550
+ * @returns
551
+ * - The status returned by the custom command.
552
+ * - uint8_t *The response.
553
+ */
554
+ ezspCustomFrame(payload: Buffer, replyLength: number): Promise<[EmberStatus, outReply: Buffer]>;
555
+ /**
556
+ * Callback
557
+ * A callback indicating a custom EZSP message has been received.
558
+ * @param payloadLength uint8_t The length of the custom frame payload.
559
+ * @param payload uint8_t * The payload of the custom frame.
560
+ */
561
+ ezspCustomFrameHandler(payloadLength: number, payload: number[]): void;
562
+ /**
563
+ * Returns the EUI64 ID of the local node.
564
+ * @returns The 64-bit ID.
565
+ */
566
+ ezspGetEui64(): Promise<EmberEUI64>;
567
+ /**
568
+ * Returns the 16-bit node ID of the local node.
569
+ * @returns The 16-bit ID.
570
+ */
571
+ ezspGetNodeId(): Promise<EmberNodeId>;
572
+ /**
573
+ * Returns number of phy interfaces present.
574
+ * @returns uint8_t Value indicate how many phy interfaces present.
575
+ */
576
+ ezspGetPhyInterfaceCount(): Promise<number>;
577
+ /**
578
+ * Returns the entropy source used for true random number generation.
579
+ * @returns Value indicates the used entropy source.
580
+ */
581
+ ezspGetTrueRandomEntropySource(): Promise<EmberEntropySource>;
582
+ /**
583
+ * Sets the manufacturer code to the specified value.
584
+ * The manufacturer code is one of the fields of the node descriptor.
585
+ * @param code uint16_t The manufacturer code for the local node.
586
+ */
587
+ ezspSetManufacturerCode(code: number): Promise<void>;
588
+ /**
589
+ * Sets the power descriptor to the specified value. The power descriptor is a
590
+ * dynamic value. Therefore, you should call this function whenever the value
591
+ * changes.
592
+ * @param descriptor uint16_t The new power descriptor for the local node.
593
+ */
594
+ ezspSetPowerDescriptor(descriptor: number): Promise<void>;
595
+ /**
596
+ * Resume network operation after a reboot. The node retains its original type.
597
+ * This should be called on startup whether or not the node was previously part
598
+ * of a network. EMBER_NOT_JOINED is returned if the node is not part of a
599
+ * network. This command accepts options to control the network initialization.
600
+ * @param networkInitStruct EmberNetworkInitStruct * An EmberNetworkInitStruct containing the options for initialization.
601
+ * @returns An EmberStatus value that indicates one of the following: successful
602
+ * initialization, EMBER_NOT_JOINED if the node is not part of a network, or the
603
+ * reason for failure.
604
+ */
605
+ ezspNetworkInit(networkInitStruct: EmberNetworkInitStruct): Promise<EmberStatus>;
606
+ /**
607
+ * Returns a value indicating whether the node is joining, joined to, or leaving a network.
608
+ * @returns Command send status.
609
+ * @returns An EmberNetworkStatus value indicating the current join status.
610
+ */
611
+ ezspNetworkState(): Promise<EmberNetworkStatus>;
612
+ /**
613
+ * Callback
614
+ * A callback invoked when the status of the stack changes. If the status
615
+ * parameter equals EMBER_NETWORK_UP, then the getNetworkParameters command can
616
+ * be called to obtain the new network parameters. If any of the parameters are
617
+ * being stored in nonvolatile memory by the Host, the stored values should be
618
+ * updated.
619
+ * @param status Stack status
620
+ */
621
+ ezspStackStatusHandler(status: EmberStatus): void;
622
+ /**
623
+ * This function will start a scan.
624
+ * @param scanType Indicates the type of scan to be performed. Possible values are: EZSP_ENERGY_SCAN and EZSP_ACTIVE_SCAN.
625
+ * For each type, the respective callback for reporting results is: energyScanResultHandler and networkFoundHandler.
626
+ * The energy scan and active scan report errors and completion via the scanCompleteHandler.
627
+ * @param channelMask uint32_t Bits set as 1 indicate that this particular channel should be scanned.
628
+ * Bits set to 0 indicate that this particular channel should not be scanned. For example, a channelMask value of 0x00000001
629
+ * would indicate that only channel 0 should be scanned. Valid channels range from 11 to 26 inclusive.
630
+ * This translates to a channel mask value of 0x07FFF800.
631
+ * As a convenience, a value of 0 is reinterpreted as the mask for the current channel.
632
+ * @param duration uint8_t Sets the exponent of the number of scan periods, where a scan period is 960 symbols.
633
+ * The scan will occur for ((2^duration) + 1) scan periods.
634
+ * @returns
635
+ * - SL_STATUS_OK signals that the scan successfully started. Possible error responses and their meanings:
636
+ * - SL_STATUS_MAC_SCANNING, we are already scanning;
637
+ * - SL_STATUS_BAD_SCAN_DURATION, we have set a duration value that is not 0..14 inclusive;
638
+ * - SL_STATUS_MAC_INCORRECT_SCAN_TYPE, we have requested an undefined scanning type;
639
+ * - SL_STATUS_INVALID_CHANNEL_MASK, our channel mask did not specify any valid channels.
640
+ */
641
+ ezspStartScan(scanType: EzspNetworkScanType, channelMask: number, duration: number): Promise<SLStatus>;
642
+ /**
643
+ * Callback
644
+ * Reports the result of an energy scan for a single channel. The scan is not
645
+ * complete until the scanCompleteHandler callback is called.
646
+ * @param channel uint8_t The 802.15.4 channel number that was scanned.
647
+ * @param maxRssiValue int8_t The maximum RSSI value found on the channel.
648
+ */
649
+ ezspEnergyScanResultHandler(channel: number, maxRssiValue: number): void;
650
+ /**
651
+ * Callback
652
+ * Reports that a network was found as a result of a prior call to startScan.
653
+ * Gives the network parameters useful for deciding which network to join.
654
+ * @param networkFound EmberZigbeeNetwork * The parameters associated with the network found.
655
+ * @param lastHopLqi uint8_t The link quality from the node that generated this beacon.
656
+ * @param lastHopRssi int8_t The energy level (in units of dBm) observed during the reception.
657
+ */
658
+ ezspNetworkFoundHandler(networkFound: EmberZigbeeNetwork, lastHopLqi: number, lastHopRssi: number): void;
659
+ /**
660
+ * Callback
661
+ * @param channel uint8_t The channel on which the current error occurred. Undefined for the case of EMBER_SUCCESS.
662
+ * @param status The error condition that occurred on the current channel. Value will be EMBER_SUCCESS when the scan has completed.
663
+ * Returns the status of the current scan of type EZSP_ENERGY_SCAN or
664
+ * EZSP_ACTIVE_SCAN. EMBER_SUCCESS signals that the scan has completed. Other
665
+ * error conditions signify a failure to scan on the channel specified.
666
+ */
667
+ ezspScanCompleteHandler(channel: number, status: EmberStatus): void;
668
+ /**
669
+ * Callback
670
+ * This function returns an unused panID and channel pair found via the find
671
+ * unused panId scan procedure.
672
+ * @param The unused panID which has been found.
673
+ * @param channel uint8_t The channel that the unused panID was found on.
674
+ */
675
+ ezspUnusedPanIdFoundHandler(panId: EmberPanId, channel: number): void;
676
+ /**
677
+ * This function starts a series of scans which will return an available panId.
678
+ * @param channelMask uint32_t The channels that will be scanned for available panIds.
679
+ * @param duration uint8_t The duration of the procedure.
680
+ * @returns The error condition that occurred during the scan. Value will be
681
+ * EMBER_SUCCESS if there are no errors.
682
+ */
683
+ ezspFindUnusedPanId(channelMask: number, duration: number): Promise<EmberStatus>;
684
+ /**
685
+ * Terminates a scan in progress.
686
+ * @returns An EmberStatus value indicating success or the reason for failure.
687
+ */
688
+ ezspStopScan(): Promise<EmberStatus>;
689
+ /**
690
+ * Forms a new network by becoming the coordinator.
691
+ * @param parameters EmberNetworkParameters * Specification of the new network.
692
+ * @returns An EmberStatus value indicating success or the reason for failure.
693
+ */
694
+ ezspFormNetwork(parameters: EmberNetworkParameters): Promise<EmberStatus>;
695
+ /**
696
+ * Causes the stack to associate with the network using the specified network
697
+ * parameters. It can take several seconds for the stack to associate with the
698
+ * local network. Do not send messages until the stackStatusHandler callback
699
+ * informs you that the stack is up.
700
+ * @param nodeType Specification of the role that this node will have in the network.
701
+ * This role must not be EMBER_COORDINATOR. To be a coordinator, use the formNetwork command.
702
+ * @param parameters EmberNetworkParameters * Specification of the network with which the node should associate.
703
+ * @returns An EmberStatus value indicating success or the reason for failure.
704
+ */
705
+ ezspJoinNetwork(nodeType: EmberNodeType, parameters: EmberNetworkParameters): Promise<EmberStatus>;
706
+ /**
707
+ * Causes the stack to associate with the network using the specified network
708
+ * parameters in the beacon parameter. It can take several seconds for the stack
709
+ * to associate with the local network. Do not send messages until the
710
+ * stackStatusHandler callback informs you that the stack is up. Unlike
711
+ * ::emberJoinNetwork(), this function does not issue an active scan before
712
+ * joining. Instead, it will cause the local node to issue a MAC Association
713
+ * Request directly to the specified target node. It is assumed that the beacon
714
+ * parameter is an artifact after issuing an active scan. (For more information,
715
+ * see emberGetBestBeacon and emberGetNextBeacon.)
716
+ * @param localNodeType Specifies the role that this node will have in the network. This role must not be EMBER_COORDINATOR.
717
+ * To be a coordinator, use the formNetwork command.
718
+ * @param beacon EmberBeaconData * Specifies the network with which the node should associate.
719
+ * @param radioTxPower int8_t The radio transmit power to use, specified in dBm.
720
+ * @param clearBeaconsAfterNetworkUp If true, clear beacons in cache upon join success. If join fail, do nothing.
721
+ * @returns An EmberStatus value indicating success or the reason for failure.
722
+ */
723
+ ezspJoinNetworkDirectly(localNodeType: EmberNodeType, beacon: EmberBeaconData, radioTxPower: number, clearBeaconsAfterNetworkUp: boolean): Promise<EmberStatus>;
724
+ /**
725
+ * Causes the stack to leave the current network. This generates a
726
+ * stackStatusHandler callback to indicate that the network is down. The radio
727
+ * will not be used until after sending a formNetwork or joinNetwork command.
728
+ * @returns An EmberStatus value indicating success or the reason for failure.
729
+ */
730
+ ezspLeaveNetwork(): Promise<EmberStatus>;
731
+ /**
732
+ * The application may call this function when contact with the network has been
733
+ * lost. The most common usage case is when an end device can no longer
734
+ * communicate with its parent and wishes to find a new one. Another case is
735
+ * when a device has missed a Network Key update and no longer has the current
736
+ * Network Key. The stack will call ezspStackStatusHandler to indicate that the
737
+ * network is down, then try to re-establish contact with the network by
738
+ * performing an active scan, choosing a network with matching extended pan id,
739
+ * and sending a ZigBee network rejoin request. A second call to the
740
+ * ezspStackStatusHandler callback indicates either the success or the failure
741
+ * of the attempt. The process takes approximately 150 milliseconds per channel
742
+ * to complete.
743
+ * @param haveCurrentNetworkKey This parameter tells the stack whether to try to use the current network key.
744
+ * If it has the current network key it will perform a secure rejoin (encrypted). If this fails the device should try an unsecure rejoin.
745
+ * If the Trust Center allows the rejoin then the current Network Key will be sent encrypted using the device's Link Key.
746
+ * @param channelMask uint32_t A mask indicating the channels to be scanned. See emberStartScan for format details.
747
+ * A value of 0 is reinterpreted as the mask for the current channel.
748
+ * @returns An EmberStatus value indicating success or the reason for failure.
749
+ */
750
+ ezspFindAndRejoinNetwork(haveCurrentNetworkKey: boolean, channelMask: number): Promise<EmberStatus>;
751
+ /**
752
+ * Tells the stack to allow other nodes to join the network with this node as
753
+ * their parent. Joining is initially disabled by default.
754
+ * @param duration uint8_t A value of 0x00 disables joining. A value of 0xFF enables joining.
755
+ * Any other value enables joining for that number of seconds.
756
+ * @returns An EmberStatus value indicating success or the reason for failure.
757
+ */
758
+ ezspPermitJoining(duration: number): Promise<EmberStatus>;
759
+ /**
760
+ * Callback
761
+ * Indicates that a child has joined or left.
762
+ * @param index uint8_t The index of the child of interest.
763
+ * @param joining True if the child is joining. False the child is leaving.
764
+ * @param childId The node ID of the child.
765
+ * @param childEui64 The EUI64 of the child.
766
+ * @param childType The node type of the child.
767
+ */
768
+ ezspChildJoinHandler(index: number, joining: boolean, childId: EmberNodeId, childEui64: EmberEUI64, childType: EmberNodeType): void;
769
+ /**
770
+ * Sends a ZDO energy scan request. This request may only be sent by the current
771
+ * network manager and must be unicast, not broadcast. See ezsp-utils.h for
772
+ * related macros emberSetNetworkManagerRequest() and
773
+ * emberChangeChannelRequest().
774
+ * @param target The network address of the node to perform the scan.
775
+ * @param scanChannels uint32_t A mask of the channels to be scanned
776
+ * @param scanDuration uint8_t How long to scan on each channel.
777
+ * Allowed values are 0..5, with the scan times as specified by 802.15.4 (0 = 31ms, 1 = 46ms, 2 = 77ms, 3 = 138ms, 4 = 261ms, 5 = 507ms).
778
+ * @param scanCount uint16_t The number of scans to be performed on each channel (1..8).
779
+ * @returns An EmberStatus value indicating success or the reason for failure.
780
+ */
781
+ ezspEnergyScanRequest(target: EmberNodeId, scanChannels: number, scanDuration: number, scanCount: number): Promise<EmberStatus>;
782
+ /**
783
+ * Returns the current network parameters.
784
+ * @returns An EmberStatus value indicating success or the reason for failure.
785
+ * @returns EmberNodeType * An EmberNodeType value indicating the current node type.
786
+ * @returns EmberNetworkParameters * The current network parameters.
787
+ */
788
+ ezspGetNetworkParameters(): Promise<[EmberStatus, nodeType: EmberNodeType, parameters: EmberNetworkParameters]>;
789
+ /**
790
+ * Returns the current radio parameters based on phy index.
791
+ * @param phyIndex uint8_t Desired index of phy interface for radio parameters.
792
+ * @returns An EmberStatus value indicating success or the reason for failure.
793
+ * @returns EmberMultiPhyRadioParameters * The current radio parameters based on provided phy index.
794
+ */
795
+ ezspGetRadioParameters(phyIndex: number): Promise<[EmberStatus, parameters: EmberMultiPhyRadioParameters]>;
796
+ /**
797
+ * Returns information about the children of the local node and the parent of
798
+ * the local node.
799
+ * @returns uint8_t The number of children the node currently has.
800
+ * @returns The parent's EUI64. The value is undefined for nodes without parents (coordinators and nodes that are not joined to a network).
801
+ * @returns EmberNodeId * The parent's node ID. The value is undefined for nodes without parents
802
+ * (coordinators and nodes that are not joined to a network).
803
+ */
804
+ ezspGetParentChildParameters(): Promise<[number, parentEui64: EmberEUI64, parentNodeId: EmberNodeId]>;
805
+ /**
806
+ * Returns information about a child of the local node.
807
+ * @param uint8_t The index of the child of interest in the child table. Possible indexes range from zero to EMBER_CHILD_TABLE_SIZE.
808
+ * @returns EMBER_SUCCESS if there is a child at index. EMBER_NOT_JOINED if there is no child at index.
809
+ * @returns EmberChildData * The data of the child.
810
+ */
811
+ ezspGetChildData(index: number): Promise<[EmberStatus, childData: EmberChildData]>;
812
+ /**
813
+ * Sets child data to the child table token.
814
+ * @param index uint8_t The index of the child of interest in the child table. Possible indexes range from zero to (EMBER_CHILD_TABLE_SIZE - 1).
815
+ * @param childData EmberChildData * The data of the child.
816
+ * @returns EMBER_SUCCESS if the child data is set successfully at index. EMBER_INDEX_OUT_OF_RANGE if provided index is out of range.
817
+ */
818
+ ezspSetChildData(index: number, childData: EmberChildData): Promise<EmberStatus>;
819
+ /**
820
+ * Convert a child index to a node ID
821
+ * @param childIndex uint8_t The index of the child of interest in the child table. Possible indexes range from zero to EMBER_CHILD_TABLE_SIZE.
822
+ * @returns The node ID of the child or EMBER_NULL_NODE_ID if there isn't a child at the childIndex specified
823
+ */
824
+ ezspChildId(childIndex: number): Promise<EmberNodeId>;
825
+ /**
826
+ * Convert a node ID to a child index
827
+ * @param childId The node ID of the child
828
+ * @returns uint8_t The child index or 0xFF if the node ID doesn't belong to a child
829
+ */
830
+ ezspChildIndex(childId: EmberNodeId): Promise<number>;
831
+ /**
832
+ * Returns the source route table total size.
833
+ * @returns uint8_t Total size of source route table.
834
+ */
835
+ ezspGetSourceRouteTableTotalSize(): Promise<number>;
836
+ /**
837
+ * Returns the number of filled entries in source route table.
838
+ * @returns uint8_t The number of filled entries in source route table.
839
+ */
840
+ ezspGetSourceRouteTableFilledSize(): Promise<number>;
841
+ /**
842
+ * Returns information about a source route table entry
843
+ * @param index uint8_t The index of the entry of interest in the source route table.
844
+ * Possible indexes range from zero to SOURCE_ROUTE_TABLE_FILLED_SIZE.
845
+ * @returns EMBER_SUCCESS if there is source route entry at index. EMBER_NOT_FOUND if there is no source route at index.
846
+ * @returns EmberNodeId * The node ID of the destination in that entry.
847
+ * @returns uint8_t * The closer node index for this source route table entry
848
+ */
849
+ ezspGetSourceRouteTableEntry(index: number): Promise<[EmberStatus, destination: EmberNodeId, closerIndex: number]>;
850
+ /**
851
+ * Returns the neighbor table entry at the given index. The number of active
852
+ * neighbors can be obtained using the neighborCount command.
853
+ * @param index uint8_t The index of the neighbor of interest. Neighbors are stored in ascending order by node id,
854
+ * with all unused entries at the end of the table.
855
+ * @returns EMBER_ERR_FATAL if the index is greater or equal to the number of active neighbors, or if the device is an end device.
856
+ * Returns EMBER_SUCCESS otherwise.
857
+ * @returns EmberNeighborTableEntry * The contents of the neighbor table entry.
858
+ */
859
+ ezspGetNeighbor(index: number): Promise<[EmberStatus, value: EmberNeighborTableEntry]>;
860
+ /**
861
+ * Return EmberStatus depending on whether the frame counter of the node is
862
+ * found in the neighbor or child table. This function gets the last received
863
+ * frame counter as found in the Network Auxiliary header for the specified
864
+ * neighbor or child
865
+ * @param eui64 eui64 of the node
866
+ * @returns Return EMBER_NOT_FOUND if the node is not found in the neighbor or child table. Returns EMBER_SUCCESS otherwise
867
+ * @returns uint32_t * Return the frame counter of the node from the neighbor or child table
868
+ */
869
+ ezspGetNeighborFrameCounter(eui64: EmberEUI64): Promise<[EmberStatus, returnFrameCounter: number]>;
870
+ /**
871
+ * Sets the frame counter for the neighbour or child.
872
+ * @param eui64 eui64 of the node
873
+ * @param frameCounter uint32_t Return the frame counter of the node from the neighbor or child table
874
+ * @returns
875
+ * - EMBER_NOT_FOUND if the node is not found in the neighbor or child table.
876
+ * - EMBER_SUCCESS otherwise
877
+ */
878
+ ezspSetNeighborFrameCounter(eui64: EmberEUI64, frameCounter: number): Promise<EmberStatus>;
879
+ /**
880
+ * Sets the routing shortcut threshold to directly use a neighbor instead of
881
+ * performing routing.
882
+ * @param costThresh uint8_t The routing shortcut threshold to configure.
883
+ * @returns An EmberStatus value indicating success or the reason for failure.
884
+ */
885
+ ezspSetRoutingShortcutThreshold(costThresh: number): Promise<EmberStatus>;
886
+ /**
887
+ * Gets the routing shortcut threshold used to differentiate between directly
888
+ * using a neighbor vs. performing routing.
889
+ * @returns uint8_t The routing shortcut threshold
890
+ */
891
+ ezspGetRoutingShortcutThreshold(): Promise<number>;
892
+ /**
893
+ * Returns the number of active entries in the neighbor table.
894
+ * @returns uint8_t The number of active entries in the neighbor table.
895
+ */
896
+ ezspNeighborCount(): Promise<number>;
897
+ /**
898
+ * Returns the route table entry at the given index. The route table size can be
899
+ * obtained using the getConfigurationValue command.
900
+ * @param index uint8_t The index of the route table entry of interest.
901
+ * @returns
902
+ * - EMBER_ERR_FATAL if the index is out of range or the device is an end
903
+ * - EMBER_SUCCESS otherwise.
904
+ * @returns EmberRouteTableEntry * The contents of the route table entry.
905
+ */
906
+ ezspGetRouteTableEntry(index: number): Promise<[EmberStatus, value: EmberRouteTableEntry]>;
907
+ /**
908
+ * Sets the radio output power at which a node is operating. Ember radios have
909
+ * discrete power settings. For a list of available power settings, see the
910
+ * technical specification for the RF communication module in your Developer
911
+ * Kit. Note: Care should be taken when using this API on a running network, as
912
+ * it will directly impact the established link qualities neighboring nodes have
913
+ * with the node on which it is called. This can lead to disruption of existing
914
+ * routes and erratic network behavior.
915
+ * @param power int8_t Desired radio output power, in dBm.
916
+ * @returns An EmberStatus value indicating the success or failure of the command.
917
+ */
918
+ ezspSetRadioPower(power: number): Promise<EmberStatus>;
919
+ /**
920
+ * Sets the channel to use for sending and receiving messages. For a list of
921
+ * available radio channels, see the technical specification for the RF
922
+ * communication module in your Developer Kit. Note: Care should be taken when
923
+ * using this API, as all devices on a network must use the same channel.
924
+ * @param channel uint8_t Desired radio channel.
925
+ * @returns An EmberStatus value indicating the success or failure of the command.
926
+ */
927
+ ezspSetRadioChannel(channel: number): Promise<EmberStatus>;
928
+ /**
929
+ * Gets the channel in use for sending and receiving messages.
930
+ * @returns uint8_t Current radio channel.
931
+ */
932
+ ezspGetRadioChannel(): Promise<number>;
933
+ /**
934
+ * Set the configured 802.15.4 CCA mode in the radio.
935
+ * @param ccaMode uint8_t A RAIL_IEEE802154_CcaMode_t value.
936
+ * @returns An EmberStatus value indicating the success or failure of the
937
+ * command.
938
+ */
939
+ ezspSetRadioIeee802154CcaMode(ccaMode: number): Promise<EmberStatus>;
940
+ /**
941
+ * Enable/disable concentrator support.
942
+ * @param on If this bool is true the concentrator support is enabled. Otherwise is disabled.
943
+ * If this bool is false all the other arguments are ignored.
944
+ * @param concentratorType uint16_t Must be either EMBER_HIGH_RAM_CONCENTRATOR or EMBER_LOW_RAM_CONCENTRATOR.
945
+ * The former is used when the caller has enough memory to store source routes for the whole network.
946
+ * In that case, remote nodes stop sending route records once the concentrator has successfully received one.
947
+ * The latter is used when the concentrator has insufficient RAM to store all outbound source routes.
948
+ * In that case, route records are sent to the concentrator prior to every inbound APS unicast.
949
+ * @param minTime uint16_t The minimum amount of time that must pass between MTORR broadcasts.
950
+ * @param maxTime uint16_t The maximum amount of time that can pass between MTORR broadcasts.
951
+ * @param routeErrorThreshold uint8_t The number of route errors that will trigger a re-broadcast of the MTORR.
952
+ * @param deliveryFailureThreshold uint8_t The number of APS delivery failures that will trigger a re-broadcast of the MTORR.
953
+ * @param maxHops uint8_t The maximum number of hops that the MTORR broadcast will be allowed to have.
954
+ * A value of 0 will be converted to the EMBER_MAX_HOPS value set by the stack.
955
+ * @returns An EmberStatus value indicating success or the reason for failure.
956
+ */
957
+ ezspSetConcentrator(on: boolean, concentratorType: number, minTime: number, maxTime: number, routeErrorThreshold: number, deliveryFailureThreshold: number, maxHops: number): Promise<EmberStatus>;
958
+ /**
959
+ * Sets the error code that is sent back from a router with a broken route.
960
+ * @param errorCode uint8_t Desired error code.
961
+ * @returns An EmberStatus value indicating the success or failure of the
962
+ * command.
963
+ */
964
+ ezspSetBrokenRouteErrorCode(errorCode: number): Promise<EmberStatus>;
965
+ /**
966
+ * This causes to initialize the desired radio interface other than native and
967
+ * form a new network by becoming the coordinator with same panId as native
968
+ * radio network.
969
+ * @param phyIndex uint8_t Index of phy interface. The native phy index would be always zero hence valid phy index starts from one.
970
+ * @param page uint8_t Desired radio channel page.
971
+ * @param channel uint8_t Desired radio channel.
972
+ * @param power int8_t Desired radio output power, in dBm.
973
+ * @param bitmask Network configuration bitmask.
974
+ * @returns An EmberStatus value indicating success or the reason for failure.
975
+ */
976
+ ezspMultiPhyStart(phyIndex: number, page: number, channel: number, power: number, bitmask: EmberMultiPhyNwkConfig): Promise<EmberStatus>;
977
+ /**
978
+ * This causes to bring down the radio interface other than native.
979
+ * @param phyIndex uint8_t Index of phy interface. The native phy index would be always zero hence valid phy index starts from one.
980
+ * @returns An EmberStatus value indicating success or the reason for failure.
981
+ */
982
+ ezspMultiPhyStop(phyIndex: number): Promise<EmberStatus>;
983
+ /**
984
+ * Sets the radio output power for desired phy interface at which a node is
985
+ * operating. Ember radios have discrete power settings. For a list of available
986
+ * power settings, see the technical specification for the RF communication
987
+ * module in your Developer Kit. Note: Care should be taken when using this api
988
+ * on a running network, as it will directly impact the established link
989
+ * qualities neighboring nodes have with the node on which it is called. This
990
+ * can lead to disruption of existing routes and erratic network behavior.
991
+ * @param phyIndex uint8_t Index of phy interface. The native phy index would be always zero hence valid phy index starts from one.
992
+ * @param power int8_t Desired radio output power, in dBm.
993
+ * @returns An EmberStatus value indicating the success or failure of the
994
+ * command.
995
+ */
996
+ ezspMultiPhySetRadioPower(phyIndex: number, power: number): Promise<EmberStatus>;
997
+ /**
998
+ * Send Link Power Delta Request from a child to its parent
999
+ * @returns An EmberStatus value indicating the success or failure of sending the request.
1000
+ */
1001
+ ezspSendLinkPowerDeltaRequest(): Promise<EmberStatus>;
1002
+ /**
1003
+ * Sets the channel for desired phy interface to use for sending and receiving
1004
+ * messages. For a list of available radio pages and channels, see the technical
1005
+ * specification for the RF communication module in your Developer Kit. Note:
1006
+ * Care should be taken when using this API, as all devices on a network must
1007
+ * use the same page and channel.
1008
+ * @param phyIndex uint8_t Index of phy interface. The native phy index would be always zero hence valid phy index starts from one.
1009
+ * @param page uint8_t Desired radio channel page.
1010
+ * @param channel uint8_t Desired radio channel.
1011
+ * @returns An EmberStatus value indicating the success or failure of the command.
1012
+ */
1013
+ ezspMultiPhySetRadioChannel(phyIndex: number, page: number, channel: number): Promise<EmberStatus>;
1014
+ /**
1015
+ * Obtains the current duty cycle state.
1016
+ * @returns An EmberStatus value indicating the success or failure of the command.
1017
+ * @returns EmberDutyCycleState * The current duty cycle state in effect.
1018
+ */
1019
+ ezspGetDutyCycleState(): Promise<[EmberStatus, returnedState: EmberDutyCycleState]>;
1020
+ /**
1021
+ * Set the current duty cycle limits configuration. The Default limits set by
1022
+ * stack if this call is not made.
1023
+ * @param limits EmberDutyCycleLimits * The duty cycle limits configuration to utilize.
1024
+ * @returns EMBER_SUCCESS if the duty cycle limit configurations set
1025
+ * successfully, EMBER_BAD_ARGUMENT if set illegal value such as setting only
1026
+ * one of the limits to default or violates constraints Susp > Crit > Limi,
1027
+ * EMBER_INVALID_CALL if device is operating on 2.4Ghz
1028
+ */
1029
+ ezspSetDutyCycleLimitsInStack(limits: EmberDutyCycleLimits): Promise<EmberStatus>;
1030
+ /**
1031
+ * Obtains the current duty cycle limits that were previously set by a call to
1032
+ * emberSetDutyCycleLimitsInStack(), or the defaults set by the stack if no set
1033
+ * call was made.
1034
+ * @returns An EmberStatus value indicating the success or failure of the command.
1035
+ * @returns EmberDutyCycleLimits * Return current duty cycle limits if returnedLimits is not NULL
1036
+ */
1037
+ ezspGetDutyCycleLimits(): Promise<[EmberStatus, returnedLimits: EmberDutyCycleLimits]>;
1038
+ /**
1039
+ * Returns the duty cycle of the stack's connected children that are being
1040
+ * monitored, up to maxDevices. It indicates the amount of overall duty cycle
1041
+ * they have consumed (up to the suspend limit). The first entry is always the
1042
+ * local stack's nodeId, and thus the total aggregate duty cycle for the device.
1043
+ * The passed pointer arrayOfDeviceDutyCycles MUST have space for maxDevices.
1044
+ * @param maxDevices uint8_t Number of devices to retrieve consumed duty cycle.
1045
+ * @returns
1046
+ * - EMBER_SUCCESS if the duty cycles were read successfully,
1047
+ * - EMBER_BAD_ARGUMENT maxDevices is greater than EMBER_MAX_END_DEVICE_CHILDREN + 1.
1048
+ * @returns uint8_t * Consumed duty cycles up to maxDevices. When the number of children that are being monitored is less than maxDevices,
1049
+ * the EmberNodeId element in the EmberPerDeviceDutyCycle will be 0xFFFF.
1050
+ */
1051
+ ezspGetCurrentDutyCycle(maxDevices: number): Promise<[EmberStatus, arrayOfDeviceDutyCycles: number[]]>;
1052
+ /**
1053
+ * Callback
1054
+ * Callback fires when the duty cycle state has changed
1055
+ * @param channelPage uint8_t The channel page whose duty cycle state has changed.
1056
+ * @param channel uint8_t The channel number whose duty cycle state has changed.
1057
+ * @param state The current duty cycle state.
1058
+ * @param totalDevices uint8_t The total number of connected end devices that are being monitored for duty cycle.
1059
+ * @param arrayOfDeviceDutyCycles EmberPerDeviceDutyCycle * Consumed duty cycles of end devices that are being monitored.
1060
+ * The first entry always be the local stack's nodeId, and thus the total aggregate duty cycle for the device.
1061
+ */
1062
+ ezspDutyCycleHandler(channelPage: number, channel: number, state: EmberDutyCycleState, totalDevices: number, arrayOfDeviceDutyCycles: EmberPerDeviceDutyCycle[]): void;
1063
+ /**
1064
+ * Returns the first beacon in the cache. Beacons are stored in cache after
1065
+ * issuing an active scan.
1066
+ * @returns
1067
+ * - EMBER_SUCCESS if first beacon found,
1068
+ * - EMBER_BAD_ARGUMENT if input parameters are invalid, EMBER_INVALID_CALL if no beacons stored,
1069
+ * - EMBER_ERR_FATAL if no first beacon found.
1070
+ * @returns EmberBeaconIterator * The iterator to use when returning the first beacon. This argument must not be NULL.
1071
+ */
1072
+ ezspGetFirstBeacon(): Promise<[EmberStatus, beaconIterator: EmberBeaconIterator]>;
1073
+ /**
1074
+ * Returns the next beacon in the cache. Beacons are stored in cache after
1075
+ * issuing an active scan.
1076
+ * @returns
1077
+ * - EMBER_SUCCESS if next beacon found,
1078
+ * - EMBER_BAD_ARGUMENT if input parameters are invalid,
1079
+ * - EMBER_ERR_FATAL if no next beacon found.
1080
+ * @returns EmberBeaconData * The next beacon retrieved. It is assumed that emberGetFirstBeacon has been called first.
1081
+ * This argument must not be NULL.
1082
+ */
1083
+ ezspGetNextBeacon(): Promise<[EmberStatus, beacon: EmberBeaconData]>;
1084
+ /**
1085
+ * Returns the number of cached beacons that have been collected from a scan.
1086
+ * @returns uint8_t The number of cached beacons that have been collected from a scan.
1087
+ */
1088
+ ezspGetNumStoredBeacons(): Promise<number>;
1089
+ /**
1090
+ * Clears all cached beacons that have been collected from a scan.
1091
+ */
1092
+ ezspClearStoredBeacons(): Promise<void>;
1093
+ /**
1094
+ * This call sets the radio channel in the stack and propagates the information
1095
+ * to the hardware.
1096
+ * @param radioChannel uint8_t The radio channel to be set.
1097
+ * @returns An EmberStatus value indicating success or the reason for failure.
1098
+ */
1099
+ ezspSetLogicalAndRadioChannel(radioChannel: number): Promise<EmberStatus>;
1100
+ /**
1101
+ * Deletes all binding table entries.
1102
+ * @returns An EmberStatus value indicating success or the reason for failure.
1103
+ */
1104
+ ezspClearBindingTable(): Promise<EmberStatus>;
1105
+ /**
1106
+ * Sets an entry in the binding table.
1107
+ * @param index uint8_t The index of a binding table entry.
1108
+ * @param value EmberBindingTableEntry * The contents of the binding entry.
1109
+ * @returns An EmberStatus value indicating success or the reason for failure.
1110
+ */
1111
+ ezspSetBinding(index: number, value: EmberBindingTableEntry): Promise<EmberStatus>;
1112
+ /**
1113
+ * Gets an entry from the binding table.
1114
+ * @param index uint8_t The index of a binding table entry.
1115
+ * @returns An EmberStatus value indicating success or the reason for failure.
1116
+ * @returns EmberBindingTableEntry * The contents of the binding entry.
1117
+ */
1118
+ ezspGetBinding(index: number): Promise<[EmberStatus, value: EmberBindingTableEntry]>;
1119
+ /**
1120
+ * Deletes a binding table entry.
1121
+ * @param index uint8_t The index of a binding table entry.
1122
+ * @returns An EmberStatus value indicating success or the reason for failure.
1123
+ */
1124
+ ezspDeleteBinding(index: number): Promise<EmberStatus>;
1125
+ /**
1126
+ * Indicates whether any messages are currently being sent using this binding
1127
+ * table entry. Note that this command does not indicate whether a binding is
1128
+ * clear. To determine whether a binding is clear, check whether the type field
1129
+ * of the EmberBindingTableEntry has the value EMBER_UNUSED_BINDING.
1130
+ * @param index uint8_t The index of a binding table entry.
1131
+ * @returns True if the binding table entry is active, false otherwise.
1132
+ */
1133
+ ezspBindingIsActive(index: number): Promise<boolean>;
1134
+ /**
1135
+ * Returns the node ID for the binding's destination, if the ID is known. If a
1136
+ * message is sent using the binding and the destination's ID is not known, the
1137
+ * stack will discover the ID by broadcasting a ZDO address request. The
1138
+ * application can avoid the need for this discovery by using
1139
+ * setBindingRemoteNodeId when it knows the correct ID via some other means. The
1140
+ * destination's node ID is forgotten when the binding is changed, when the
1141
+ * local node reboots or, much more rarely, when the destination node changes
1142
+ * its ID in response to an ID conflict.
1143
+ * @param index uint8_t The index of a binding table entry.
1144
+ * @returns The short ID of the destination node or EMBER_NULL_NODE_ID if no destination is known.
1145
+ */
1146
+ ezspGetBindingRemoteNodeId(index: number): Promise<EmberNodeId>;
1147
+ /**
1148
+ * Set the node ID for the binding's destination. See getBindingRemoteNodeId for
1149
+ * a description.
1150
+ * @param index uint8_t The index of a binding table entry.
1151
+ * @param The short ID of the destination node.
1152
+ */
1153
+ ezspSetBindingRemoteNodeId(index: number, nodeId: EmberNodeId): Promise<void>;
1154
+ /**
1155
+ * Callback
1156
+ * The NCP used the external binding modification policy to decide how to handle
1157
+ * a remote set binding request. The Host cannot change the current decision,
1158
+ * but it can change the policy for future decisions using the setPolicy
1159
+ * command.
1160
+ * @param entry EmberBindingTableEntry * The requested binding.
1161
+ * @param index uint8_t The index at which the binding was added.
1162
+ * @param policyDecision EMBER_SUCCESS if the binding was added to the table and any other status if not.
1163
+ */
1164
+ ezspRemoteSetBindingHandler(entry: EmberBindingTableEntry, index: number, policyDecision: EmberStatus): void;
1165
+ /**
1166
+ * Callback
1167
+ * The NCP used the external binding modification policy to decide how to handle
1168
+ * a remote delete binding request. The Host cannot change the current decision,
1169
+ * but it can change the policy for future decisions using the setPolicy
1170
+ * command.
1171
+ * @param index uint8_t The index of the binding whose deletion was requested.
1172
+ * @param policyDecision EMBER_SUCCESS if the binding was removed from the table and any other status if not.
1173
+ */
1174
+ ezspRemoteDeleteBindingHandler(index: number, policyDecision: EmberStatus): void;
1175
+ /**
1176
+ * Returns the maximum size of the payload. The size depends on the security level in use.
1177
+ * @returns uint8_t The maximum APS payload length.
1178
+ */
1179
+ ezspMaximumPayloadLength(): Promise<number>;
1180
+ /**
1181
+ * Sends a unicast message as per the ZigBee specification. The message will
1182
+ * arrive at its destination only if there is a known route to the destination
1183
+ * node. Setting the ENABLE_ROUTE_DISCOVERY option will cause a route to be
1184
+ * discovered if none is known. Setting the FORCE_ROUTE_DISCOVERY option will
1185
+ * force route discovery. Routes to end-device children of the local node are
1186
+ * always known. Setting the APS_RETRY option will cause the message to be
1187
+ * retransmitted until either a matching acknowledgement is received or three
1188
+ * transmissions have been made. Note: Using the FORCE_ROUTE_DISCOVERY option
1189
+ * will cause the first transmission to be consumed by a route request as part
1190
+ * of discovery, so the application payload of this packet will not reach its
1191
+ * destination on the first attempt. If you want the packet to reach its
1192
+ * destination, the APS_RETRY option must be set so that another attempt is made
1193
+ * to transmit the message with its application payload after the route has been
1194
+ * constructed. Note: When sending fragmented messages, the stack will only
1195
+ * assign a new APS sequence number for the first fragment of the message (i.e.,
1196
+ * EMBER_APS_OPTION_FRAGMENT is set and the low-order byte of the groupId field
1197
+ * in the APS frame is zero). For all subsequent fragments of the same message,
1198
+ * the application must set the sequence number field in the APS frame to the
1199
+ * sequence number assigned by the stack to the first fragment.
1200
+ * @param type Specifies the outgoing message type.
1201
+ * Must be one of EMBER_OUTGOING_DIRECT, EMBER_OUTGOING_VIA_ADDRESS_TABLE, or EMBER_OUTGOING_VIA_BINDING.
1202
+ * @param indexOrDestination Depending on the type of addressing used, this is either the EmberNodeId of the destination,
1203
+ * an index into the address table, or an index into the binding table.
1204
+ * @param apsFrame EmberApsFrame * The APS frame which is to be added to the message.
1205
+ * @param messageTag uint8_t A value chosen by the Host. This value is used in the ezspMessageSentHandler response to refer to this message.
1206
+ * @param messageContents uint8_t * Content of the message.
1207
+ * @returns An EmberStatus value indicating success or the reason for failure.
1208
+ * @returns uint8_t * The sequence number that will be used when this message is transmitted.
1209
+ */
1210
+ ezspSendUnicast(type: EmberOutgoingMessageType, indexOrDestination: EmberNodeId, apsFrame: EmberApsFrame, messageTag: number, messageContents: Buffer): Promise<[EmberStatus, apsSequence: number]>;
1211
+ /**
1212
+ * Sends a broadcast message as per the ZigBee specification.
1213
+ * @param destination The destination to which to send the broadcast. This must be one of the three ZigBee broadcast addresses.
1214
+ * @param apsFrame EmberApsFrame * The APS frame for the message.
1215
+ * @param radius uint8_t The message will be delivered to all nodes within radius hops of the sender.
1216
+ * A radius of zero is converted to EMBER_MAX_HOPS.
1217
+ * @param uint8_t A value chosen by the Host. This value is used in the ezspMessageSentHandler response to refer to this message.
1218
+ * @param uint8_t * The broadcast message.
1219
+ * @returns An EmberStatus value indicating success or the reason for failure.
1220
+ * @returns uint8_t * The sequence number that will be used when this message is transmitted.
1221
+ */
1222
+ ezspSendBroadcast(destination: EmberNodeId, apsFrame: EmberApsFrame, radius: number, messageTag: number, messageContents: Buffer): Promise<[EmberStatus, apsSequence: number]>;
1223
+ /**
1224
+ * Sends a proxied broadcast message as per the ZigBee specification.
1225
+ * @param source The source from which to send the broadcast.
1226
+ * @param destination The destination to which to send the broadcast. This must be one of the three ZigBee broadcast addresses.
1227
+ * @param nwkSequence uint8_t The network sequence number for the broadcast.
1228
+ * @param apsFrame EmberApsFrame * The APS frame for the message.
1229
+ * @param radius uint8_t The message will be delivered to all nodes within radius hops of the sender.
1230
+ * A radius of zero is converted to EMBER_MAX_HOPS.
1231
+ * @param messageTag uint8_t A value chosen by the Host. This value is used in the ezspMessageSentHandler response to refer to this message.
1232
+ * @param messageContents uint8_t * The broadcast message.
1233
+ * @returns An EmberStatus value indicating success or the reason for failure.
1234
+ * @returns uint8_t * The APS sequence number that will be used when this message is transmitted.
1235
+ */
1236
+ ezspProxyBroadcast(source: EmberNodeId, destination: EmberNodeId, nwkSequence: number, apsFrame: EmberApsFrame, radius: number, messageTag: number, messageContents: Buffer): Promise<[EmberStatus, apsSequence: number]>;
1237
+ /**
1238
+ * Sends a multicast message to all endpoints that share a specific multicast ID
1239
+ * and are within a specified number of hops of the sender.
1240
+ * @param apsFrame EmberApsFrame * The APS frame for the message. The multicast will be sent to the groupId in this frame.
1241
+ * @param hops uint8_t The message will be delivered to all nodes within this number of hops of the sender.
1242
+ * A value of zero is converted to EMBER_MAX_HOPS.
1243
+ * @param nonmemberRadius uint8_t The number of hops that the message will be forwarded by devices that are not members of the group.
1244
+ * A value of 7 or greater is treated as infinite.
1245
+ * @param messageTag uint8_t A value chosen by the Host. This value is used in the ezspMessageSentHandler response to refer to this message.
1246
+ * @param messageLength uint8_t The length of the messageContents parameter in bytes.
1247
+ * @param messageContents uint8_t * The multicast message.
1248
+ * @returns An EmberStatus value. For any result other than EMBER_SUCCESS, the message will not be sent.
1249
+ * - EMBER_SUCCESS - The message has been submitted for transmission.
1250
+ * - EMBER_INVALID_BINDING_INDEX - The bindingTableIndex refers to a non-multicast binding.
1251
+ * - EMBER_NETWORK_DOWN - The node is not part of a network.
1252
+ * - EMBER_MESSAGE_TOO_LONG - The message is too large to fit in a MAC layer frame.
1253
+ * - EMBER_NO_BUFFERS - The free packet buffer pool is empty.
1254
+ * - EMBER_NETWORK_BUSY - Insufficient resources available in Network or MAC layers to send message.
1255
+ * @returns uint8_t * The sequence number that will be used when this message is transmitted.
1256
+ */
1257
+ ezspSendMulticast(apsFrame: EmberApsFrame, hops: number, nonmemberRadius: number, messageTag: number, messageContents: Buffer): Promise<[EmberStatus, apsSequence: number]>;
1258
+ /**
1259
+ * Sends a multicast message to all endpoints that share a specific multicast ID
1260
+ * and are within a specified number of hops of the sender.
1261
+ * @param apsFrame EmberApsFrame * The APS frame for the message. The multicast will be sent to the groupId in this frame.
1262
+ * @param hops uint8_t The message will be delivered to all nodes within this number of hops of the sender.
1263
+ * A value of zero is converted to EMBER_MAX_HOPS.
1264
+ * @param nonmemberRadius uint8_t The number of hops that the message will be forwarded by devices that are not members of the group.
1265
+ * A value of 7 or greater is treated as infinite.
1266
+ * @param alias uint16_t The alias source address
1267
+ * @param nwkSequence uint8_t the alias sequence number
1268
+ * @param messageTag uint8_t A value chosen by the Host. This value is used in the ezspMessageSentHandler response to refer to this message.
1269
+ * @param messageLength uint8_t The length of the messageContents parameter in bytes.
1270
+ * @param messageContents uint8_t * The multicast message.
1271
+ * @returns An EmberStatus value. For any result other than EMBER_SUCCESS, the
1272
+ * message will not be sent. EMBER_SUCCESS - The message has been submitted for
1273
+ * transmission. EMBER_INVALID_BINDING_INDEX - The bindingTableIndex refers to a
1274
+ * non-multicast binding. EMBER_NETWORK_DOWN - The node is not part of a
1275
+ * network. EMBER_MESSAGE_TOO_LONG - The message is too large to fit in a MAC
1276
+ * layer frame. EMBER_NO_BUFFERS - The free packet buffer pool is empty.
1277
+ * EMBER_NETWORK_BUSY - Insufficient resources available in Network or MAC
1278
+ * layers to send message.
1279
+ * @returns The sequence number that will be used when this message is transmitted.
1280
+ */
1281
+ ezspSendMulticastWithAlias(apsFrame: EmberApsFrame, hops: number, nonmemberRadius: number, alias: number, nwkSequence: number, messageTag: number, messageContents: Buffer): Promise<[EmberStatus, apsSequence: number]>;
1282
+ /**
1283
+ * Sends a reply to a received unicast message. The incomingMessageHandler
1284
+ * callback for the unicast being replied to supplies the values for all the
1285
+ * parameters except the reply itself.
1286
+ * @param sender Value supplied by incoming unicast.
1287
+ * @param apsFrame EmberApsFrame * Value supplied by incoming unicast.
1288
+ * @param uint8_t The length of the messageContents parameter in bytes.
1289
+ * @param uint8_t * The reply message.
1290
+ * @returns An EmberStatus value.
1291
+ * - EMBER_INVALID_CALL - The EZSP_UNICAST_REPLIES_POLICY is set to EZSP_HOST_WILL_NOT_SUPPLY_REPLY.
1292
+ * This means the NCP will automatically send an empty reply. The Host must change
1293
+ * the policy to EZSP_HOST_WILL_SUPPLY_REPLY before it can supply the reply.
1294
+ * There is one exception to this rule: In the case of responses to message
1295
+ * fragments, the host must call sendReply when a message fragment is received.
1296
+ * In this case, the policy set on the NCP does not matter. The NCP expects a
1297
+ * sendReply call from the Host for message fragments regardless of the current
1298
+ * policy settings.
1299
+ * - EMBER_NO_BUFFERS - Not enough memory was available to send the reply.
1300
+ * - EMBER_NETWORK_BUSY - Either no route or insufficient resources available.
1301
+ * - EMBER_SUCCESS - The reply was successfully queued for transmission.
1302
+ */
1303
+ ezspSendReply(sender: EmberNodeId, apsFrame: EmberApsFrame, messageContents: Buffer): Promise<EmberStatus>;
1304
+ /**
1305
+ * Callback
1306
+ * A callback indicating the stack has completed sending a message.
1307
+ * @param type The type of message sent.
1308
+ * @param indexOrDestination uint16_t The destination to which the message was sent, for direct unicasts,
1309
+ * or the address table or binding index for other unicasts. The value is unspecified for multicasts and broadcasts.
1310
+ * @param apsFrame EmberApsFrame * The APS frame for the message.
1311
+ * @param messageTag uint8_t The value supplied by the Host in the ezspSendUnicast, ezspSendBroadcast or ezspSendMulticast command.
1312
+ * @param status An EmberStatus value of EMBER_SUCCESS if an ACK was received from the destination
1313
+ * or EMBER_DELIVERY_FAILED if no ACK was received.
1314
+ * @param messageContents uint8_t * The unicast message supplied by the Host. The message contents are only included here if the decision
1315
+ * for the messageContentsInCallback policy is messageTagAndContentsInCallback.
1316
+ */
1317
+ ezspMessageSentHandler(type: EmberOutgoingMessageType, indexOrDestination: number, apsFrame: EmberApsFrame, messageTag: number, status: EmberStatus, messageContents: Buffer): void;
1318
+ /**
1319
+ * Sends a route request packet that creates routes from every node in the
1320
+ * network back to this node. This function should be called by an application
1321
+ * that wishes to communicate with many nodes, for example, a gateway, central
1322
+ * monitor, or controller. A device using this function was referred to as an
1323
+ * 'aggregator' in EmberZNet 2.x and earlier, and is referred to as a
1324
+ * 'concentrator' in the ZigBee specification and EmberZNet 3. This function
1325
+ * enables large scale networks, because the other devices do not have to
1326
+ * individually perform bandwidth-intensive route discoveries. Instead, when a
1327
+ * remote node sends an APS unicast to a concentrator, its network layer
1328
+ * automatically delivers a special route record packet first, which lists the
1329
+ * network ids of all the intermediate relays. The concentrator can then use
1330
+ * source routing to send outbound APS unicasts. (A source routed message is one
1331
+ * in which the entire route is listed in the network layer header.) This allows
1332
+ * the concentrator to communicate with thousands of devices without requiring
1333
+ * large route tables on neighboring nodes. This function is only available in
1334
+ * ZigBee Pro (stack profile 2), and cannot be called on end devices. Any router
1335
+ * can be a concentrator (not just the coordinator), and there can be multiple
1336
+ * concentrators on a network. Note that a concentrator does not automatically
1337
+ * obtain routes to all network nodes after calling this function. Remote
1338
+ * applications must first initiate an inbound APS unicast. Many-to-one routes
1339
+ * are not repaired automatically. Instead, the concentrator application must
1340
+ * call this function to rediscover the routes as necessary, for example, upon
1341
+ * failure of a retried APS message. The reason for this is that there is no
1342
+ * scalable one-size-fits-all route repair strategy. A common and recommended
1343
+ * strategy is for the concentrator application to refresh the routes by calling
1344
+ * this function periodically.
1345
+ * @param concentratorType uint16_t Must be either EMBER_HIGH_RAM_CONCENTRATOR or EMBER_LOW_RAM_CONCENTRATOR.
1346
+ * The former is used when the caller has enough memory to store source routes for the whole network.
1347
+ * In that case, remote nodes stop sending route records once the concentrator has successfully received one.
1348
+ * The latter is used when the concentrator has insufficient RAM to store all outbound source routes.
1349
+ * In that case, route records are sent to the concentrator prior to every inbound APS unicast.
1350
+ * @param radius uint8_t The maximum number of hops the route request will be relayed. A radius of zero is converted to EMBER_MAX_HOPS
1351
+ * @returns EMBER_SUCCESS if the route request was successfully submitted to the
1352
+ * transmit queue, and EMBER_ERR_FATAL otherwise.
1353
+ */
1354
+ ezspSendManyToOneRouteRequest(concentratorType: number, radius: number): Promise<EmberStatus>;
1355
+ /**
1356
+ * Periodically request any pending data from our parent. Setting interval to 0
1357
+ * or units to EMBER_EVENT_INACTIVE will generate a single poll.
1358
+ * @param interval uint16_t The time between polls. Note that the timer clock is free running and is not synchronized with this command.
1359
+ * This means that the time will be between interval and (interval - 1). The maximum interval is 32767.
1360
+ * @param units The units for interval.
1361
+ * @param failureLimit uint8_t The number of poll failures that will be tolerated before a pollCompleteHandler callback is generated.
1362
+ * A value of zero will result in a callback for every poll. Any status value apart from EMBER_SUCCESS
1363
+ * and EMBER_MAC_NO_DATA is counted as a failure.
1364
+ * @returns The result of sending the first poll.
1365
+ */
1366
+ ezspPollForData(interval: number, units: EmberEventUnits, failureLimit: number): Promise<EmberStatus>;
1367
+ /**
1368
+ * Callback
1369
+ * Indicates the result of a data poll to the parent of the local node.
1370
+ * @param status An EmberStatus value:
1371
+ * - EMBER_SUCCESS - Data was received in response to the poll.
1372
+ * - EMBER_MAC_NO_DATA - No data was pending.
1373
+ * - EMBER_DELIVERY_FAILED - The poll message could not be sent.
1374
+ * - EMBER_MAC_NO_ACK_RECEIVED - The poll message was sent but not acknowledged by the parent.
1375
+ */
1376
+ ezspPollCompleteHandler(status: EmberStatus): void;
1377
+ /**
1378
+ * Callback
1379
+ * Indicates that the local node received a data poll from a child.
1380
+ * @param childId The node ID of the child that is requesting data.
1381
+ * @param transmitExpected True if transmit is expected, false otherwise.
1382
+ */
1383
+ ezspPollHandler(childId: EmberNodeId, transmitExpected: boolean): void;
1384
+ /**
1385
+ * Callback
1386
+ * A callback indicating a message has been received containing the EUI64 of the
1387
+ * sender. This callback is called immediately before the incomingMessageHandler
1388
+ * callback. It is not called if the incoming message did not contain the EUI64
1389
+ * of the sender.
1390
+ * @param senderEui64 The EUI64 of the sender
1391
+ */
1392
+ ezspIncomingSenderEui64Handler(senderEui64: EmberEUI64): void;
1393
+ /**
1394
+ * Callback
1395
+ * A callback indicating a message has been received.
1396
+ * @param type The type of the incoming message. One of the following: EMBER_INCOMING_UNICAST, EMBER_INCOMING_UNICAST_REPLY,
1397
+ * EMBER_INCOMING_MULTICAST, EMBER_INCOMING_MULTICAST_LOOPBACK, EMBER_INCOMING_BROADCAST, EMBER_INCOMING_BROADCAST_LOOPBACK
1398
+ * @param apsFrame EmberApsFrame * The APS frame from the incoming message.
1399
+ * @param lastHopLqi uint8_t The link quality from the node that last relayed the message.
1400
+ * @param lastHopRssi int8_t The energy level (in units of dBm) observed during the reception.
1401
+ * @param sender The sender of the message.
1402
+ * @param bindingIndex uint8_t The index of a binding that matches the message or 0xFF if there is no matching binding.
1403
+ * @param addressIndex uint8_t The index of the entry in the address table that matches the sender of the message
1404
+ * or 0xFF if there is no matching entry.
1405
+ * @param messageContents uint8_t * The incoming message.
1406
+ */
1407
+ ezspIncomingMessageHandler(type: EmberIncomingMessageType, apsFrame: EmberApsFrame, lastHopLqi: number, lastHopRssi: number, sender: EmberNodeId, bindingIndex: number, addressIndex: number, messageContents: Buffer): void;
1408
+ /**
1409
+ * Sets source route discovery(MTORR) mode to on, off, reschedule
1410
+ * @param mode uint8_t Source route discovery mode: off:0, on:1, reschedule:2
1411
+ * @returns uint32_t Remaining time(ms) until next MTORR broadcast if the mode is on, MAX_INT32U_VALUE if the mode is off
1412
+ */
1413
+ ezspSetSourceRouteDiscoveryMode(mode: EmberSourceRouteDiscoveryMode): Promise<number>;
1414
+ /**
1415
+ * Callback
1416
+ * A callback indicating that a many-to-one route to the concentrator with the given short and long id is available for use.
1417
+ * @param EmberNodeId The short id of the concentrator.
1418
+ * @param longId The EUI64 of the concentrator.
1419
+ * @param cost uint8_t The path cost to the concentrator. The cost may decrease as additional route request packets
1420
+ * for this discovery arrive, but the callback is made only once.
1421
+ */
1422
+ ezspIncomingManyToOneRouteRequestHandler(source: EmberNodeId, longId: EmberEUI64, cost: number): void;
1423
+ /**
1424
+ * Callback
1425
+ * A callback invoked when a route error message is received.
1426
+ * The error indicates that a problem routing to or from the target node was encountered.
1427
+ *
1428
+ * A status of ::EMBER_SOURCE_ROUTE_FAILURE indicates that a source-routed unicast sent from this node encountered a broken link.
1429
+ * Note that this case occurs only if this node is a concentrator using many-to-one routing for inbound messages and source-routing for
1430
+ * outbound messages. The node prior to the broken link generated the route error message and returned it to us along the many-to-one route.
1431
+ *
1432
+ * A status of ::EMBER_MANY_TO_ONE_ROUTE_FAILURE also occurs only if the local device is a concentrator, and indicates that a unicast sent
1433
+ * to the local device along a many-to-one route encountered a broken link. The node prior to the broken link generated the route error
1434
+ * message and forwarded it to the local device via a randomly chosen neighbor, taking advantage of the many-to-one nature of the route.
1435
+ *
1436
+ * A status of ::EMBER_MAC_INDIRECT_TIMEOUT indicates that a message sent to the target end device could not be delivered by the parent
1437
+ * because the indirect transaction timer expired. Upon receipt of the route error, the stack sets the extended timeout for the target node
1438
+ * in the address table, if present. It then calls this handler to indicate receipt of the error.
1439
+ *
1440
+ * Note that if the original unicast data message is sent using the ::EMBER_APS_OPTION_RETRY option, a new route error message is generated
1441
+ * for each failed retry. Therefore, it is not unusual to receive three route error messages in succession for a single failed retried APS
1442
+ * unicast. On the other hand, it is also not guaranteed that any route error messages will be delivered successfully at all.
1443
+ * The only sure way to detect a route failure is to use retried APS messages and to check the status of the ::emberMessageSentHandler().
1444
+ *
1445
+ * @param status ::EMBER_SOURCE_ROUTE_FAILURE, ::EMBER_MANY_TO_ONE_ROUTE_FAILURE, ::EMBER_MAC_INDIRECT_TIMEOUT
1446
+ * @param target The short id of the remote node.
1447
+ */
1448
+ ezspIncomingRouteErrorHandler(status: EmberStatus, target: EmberNodeId): void;
1449
+ /**
1450
+ * Callback
1451
+ * A callback invoked when a network status/route error message is received.
1452
+ * The error indicates that there was a problem sending/receiving messages from the target node.
1453
+ *
1454
+ * Note: Network analyzer may flag this message as "route error" which is the old name for the "network status" command.
1455
+ *
1456
+ * This handler is a superset of ezspIncomingRouteErrorHandler. The old API was only invoking the handler for a couple of the possible
1457
+ * error codes and these were being translated into EmberStatus.
1458
+ *
1459
+ * @param errorCode uint8_t One byte over-the-air error code from network status message
1460
+ * @param target The short ID of the remote node
1461
+ */
1462
+ ezspIncomingNetworkStatusHandler(errorCode: EmberStackError, target: EmberNodeId): void;
1463
+ /**
1464
+ * Callback
1465
+ * Reports the arrival of a route record command frame.
1466
+ * @param EmberNodeId The source of the route record.
1467
+ * @param EmberEUI64 The EUI64 of the source.
1468
+ * @param lastHopLqi uint8_t The link quality from the node that last relayed the route record.
1469
+ * @param lastHopRssi int8_t The energy level (in units of dBm) observed during the reception.
1470
+ * @param uint8_t The number of relays in relayList.
1471
+ * @param relayList uint8_t * The route record. Each relay in the list is an uint16_t node ID.
1472
+ * The list is passed as uint8_t * to avoid alignment problems.
1473
+ */
1474
+ ezspIncomingRouteRecordHandler(source: EmberNodeId, sourceEui: EmberEUI64, lastHopLqi: number, lastHopRssi: number, relayCount: number, relayList: number[]): void;
1475
+ /**
1476
+ * Supply a source route for the next outgoing message.
1477
+ * @param destination The destination of the source route.
1478
+ * @param relayList uint16_t * The source route.
1479
+ * @returns EMBER_SUCCESS if the source route was successfully stored, and
1480
+ * EMBER_NO_BUFFERS otherwise.
1481
+ */
1482
+ ezspSetSourceRoute(destination: EmberNodeId, relayList: number[]): Promise<EmberStatus>;
1483
+ /**
1484
+ * Send the network key to a destination.
1485
+ * @param targetShort The destination node of the key.
1486
+ * @param targetLong The long address of the destination node.
1487
+ * @param parentShortId The parent node of the destination node.
1488
+ * @returns EMBER_SUCCESS if send was successful
1489
+ */
1490
+ ezspUnicastCurrentNetworkKey(targetShort: EmberNodeId, targetLong: EmberEUI64, parentShortId: EmberNodeId): Promise<EmberStatus>;
1491
+ /**
1492
+ * Indicates whether any messages are currently being sent using this address
1493
+ * table entry. Note that this function does not indicate whether the address
1494
+ * table entry is unused. To determine whether an address table entry is unused,
1495
+ * check the remote node ID. The remote node ID will have the value
1496
+ * EMBER_TABLE_ENTRY_UNUSED_NODE_ID when the address table entry is not in use.
1497
+ * @param uint8_tThe index of an address table entry.
1498
+ * @returns True if the address table entry is active, false otherwise.
1499
+ */
1500
+ ezspAddressTableEntryIsActive(addressTableIndex: number): Promise<boolean>;
1501
+ /**
1502
+ * Sets the EUI64 of an address table entry. This function will also check other
1503
+ * address table entries, the child table and the neighbor table to see if the
1504
+ * node ID for the given EUI64 is already known. If known then this function
1505
+ * will also set node ID. If not known it will set the node ID to
1506
+ * EMBER_UNKNOWN_NODE_ID.
1507
+ * @param addressTableIndex uint8_t The index of an address table entry.
1508
+ * @param eui64 The EUI64 to use for the address table entry.
1509
+ * @returns
1510
+ * - EMBER_SUCCESS if the EUI64 was successfully set,
1511
+ * - EMBER_ADDRESS_TABLE_ENTRY_IS_ACTIVE otherwise.
1512
+ */
1513
+ ezspSetAddressTableRemoteEui64(addressTableIndex: number, eui64: EmberEUI64): Promise<EmberStatus>;
1514
+ /**
1515
+ * Sets the short ID of an address table entry. Usually the application will not
1516
+ * need to set the short ID in the address table. Once the remote EUI64 is set
1517
+ * the stack is capable of figuring out the short ID on its own. However, in
1518
+ * cases where the application does set the short ID, the application must set
1519
+ * the remote EUI64 prior to setting the short ID.
1520
+ * @param addressTableIndex uint8_t The index of an address table entry.
1521
+ * @param id The short ID corresponding to the remote node whose EUI64 is stored in the address table at the given index
1522
+ * or EMBER_TABLE_ENTRY_UNUSED_NODE_ID which indicates that the entry stored in the address table at the given index is not in use.
1523
+ */
1524
+ ezspSetAddressTableRemoteNodeId(addressTableIndex: number, id: EmberNodeId): Promise<void>;
1525
+ /**
1526
+ * Gets the EUI64 of an address table entry.
1527
+ * @param addressTableIndex uint8_t The index of an address table entry.
1528
+ * @returns The EUI64 of the address table entry is copied to this location.
1529
+ */
1530
+ ezspGetAddressTableRemoteEui64(addressTableIndex: number): Promise<EmberEUI64>;
1531
+ /**
1532
+ * Gets the short ID of an address table entry.
1533
+ * @param addressTableIndex uint8_t The index of an address table entry.
1534
+ * @returns One of the following: The short ID corresponding to the remote node
1535
+ * whose EUI64 is stored in the address table at the given index.
1536
+ * - EMBER_UNKNOWN_NODE_ID - Indicates that the EUI64 stored in the address table
1537
+ * at the given index is valid but the short ID is currently unknown.
1538
+ * - EMBER_DISCOVERY_ACTIVE_NODE_ID - Indicates that the EUI64 stored in the
1539
+ * address table at the given location is valid and network address discovery is
1540
+ * underway.
1541
+ * - EMBER_TABLE_ENTRY_UNUSED_NODE_ID - Indicates that the entry stored
1542
+ * in the address table at the given index is not in use.
1543
+ */
1544
+ ezspGetAddressTableRemoteNodeId(addressTableIndex: number): Promise<EmberNodeId>;
1545
+ /**
1546
+ * Tells the stack whether or not the normal interval between retransmissions of a retried unicast message should
1547
+ * be increased by EMBER_INDIRECT_TRANSMISSION_TIMEOUT.
1548
+ * The interval needs to be increased when sending to a sleepy node so that the message is not retransmitted until the destination
1549
+ * has had time to wake up and poll its parent.
1550
+ * The stack will automatically extend the timeout:
1551
+ * - For our own sleepy children.
1552
+ * - When an address response is received from a parent on behalf of its child.
1553
+ * - When an indirect transaction expiry route error is received.
1554
+ * - When an end device announcement is received from a sleepy node.
1555
+ * @param remoteEui64 The address of the node for which the timeout is to be set.
1556
+ * @param extendedTimeout true if the retry interval should be increased by EMBER_INDIRECT_TRANSMISSION_TIMEOUT.
1557
+ * false if the normal retry interval should be used.
1558
+ */
1559
+ ezspSetExtendedTimeout(remoteEui64: EmberEUI64, extendedTimeout: boolean): Promise<void>;
1560
+ /**
1561
+ * Indicates whether or not the stack will extend the normal interval between
1562
+ * retransmissions of a retried unicast message by
1563
+ * EMBER_INDIRECT_TRANSMISSION_TIMEOUT.
1564
+ * @param remoteEui64 The address of the node for which the timeout is to be returned.
1565
+ * @returns true if the retry interval will be increased by EMBER_INDIRECT_TRANSMISSION_TIMEOUT
1566
+ * and false if the normal retry interval will be used.
1567
+ */
1568
+ ezspGetExtendedTimeout(remoteEui64: EmberEUI64): Promise<boolean>;
1569
+ /**
1570
+ * Replaces the EUI64, short ID and extended timeout setting of an address table
1571
+ * entry. The previous EUI64, short ID and extended timeout setting are
1572
+ * returned.
1573
+ * @param addressTableIndex uint8_t The index of the address table entry that will be modified.
1574
+ * @param newEui64 The EUI64 to be written to the address table entry.
1575
+ * @param newId One of the following: The short ID corresponding to the new EUI64.
1576
+ * EMBER_UNKNOWN_NODE_ID if the new EUI64 is valid but the short ID is unknown and should be discovered by the stack.
1577
+ * EMBER_TABLE_ENTRY_UNUSED_NODE_ID if the address table entry is now unused.
1578
+ * @param newExtendedTimeout true if the retry interval should be increased by EMBER_INDIRECT_TRANSMISSION_TIMEOUT.
1579
+ * false if the normal retry interval should be used.
1580
+ * @returns EMBER_SUCCESS if the EUI64, short ID and extended timeout setting
1581
+ * were successfully modified, and EMBER_ADDRESS_TABLE_ENTRY_IS_ACTIVE
1582
+ * otherwise.
1583
+ * @returns oldEui64 The EUI64 of the address table entry before it was modified.
1584
+ * @returns oldId EmberNodeId * One of the following: The short ID corresponding to the EUI64 before it was modified.
1585
+ * EMBER_UNKNOWN_NODE_ID if the short ID was unknown. EMBER_DISCOVERY_ACTIVE_NODE_ID if discovery of the short ID was underway.
1586
+ * EMBER_TABLE_ENTRY_UNUSED_NODE_ID if the address table entry was unused.
1587
+ * @returns oldExtendedTimeouttrue bool * if the retry interval was being increased by EMBER_INDIRECT_TRANSMISSION_TIMEOUT.
1588
+ * false if the normal retry interval was being used.
1589
+ */
1590
+ ezspReplaceAddressTableEntry(addressTableIndex: number, newEui64: EmberEUI64, newId: EmberNodeId, newExtendedTimeout: boolean): Promise<[EmberStatus, oldEui64: EmberEUI64, oldId: EmberNodeId, oldExtendedTimeout: boolean]>;
1591
+ /**
1592
+ * Returns the node ID that corresponds to the specified EUI64. The node ID is
1593
+ * found by searching through all stack tables for the specified EUI64.
1594
+ * @param eui64 The EUI64 of the node to look up.
1595
+ * @returns The short ID of the node or EMBER_NULL_NODE_ID if the short ID is not
1596
+ * known.
1597
+ */
1598
+ ezspLookupNodeIdByEui64(eui64: EmberEUI64): Promise<EmberNodeId>;
1599
+ /**
1600
+ * Returns the EUI64 that corresponds to the specified node ID. The EUI64 is
1601
+ * found by searching through all stack tables for the specified node ID.
1602
+ * @param nodeId The short ID of the node to look up.
1603
+ * @returns EMBER_SUCCESS if the EUI64 was found, EMBER_ERR_FATAL if the EUI64 is
1604
+ * not known.
1605
+ * @returns eui64 The EUI64 of the node.
1606
+ */
1607
+ ezspLookupEui64ByNodeId(nodeId: EmberNodeId): Promise<[EmberStatus, eui64: EmberEUI64]>;
1608
+ /**
1609
+ * Gets an entry from the multicast table.
1610
+ * @param uint8_t The index of a multicast table entry.
1611
+ * @returns An EmberStatus value indicating success or the reason for failure.
1612
+ * @returns EmberMulticastTableEntry * The contents of the multicast entry.
1613
+ */
1614
+ ezspGetMulticastTableEntry(index: number): Promise<[EmberStatus, value: EmberMulticastTableEntry]>;
1615
+ /**
1616
+ * Sets an entry in the multicast table.
1617
+ * @param index uint8_t The index of a multicast table entry
1618
+ * @param EmberMulticastTableEntry * The contents of the multicast entry.
1619
+ * @returns An EmberStatus value indicating success or the reason for failure.
1620
+ */
1621
+ ezspSetMulticastTableEntry(index: number, value: EmberMulticastTableEntry): Promise<EmberStatus>;
1622
+ /**
1623
+ * Callback
1624
+ * A callback invoked by the EmberZNet stack when an id conflict is discovered,
1625
+ * that is, two different nodes in the network were found to be using the same
1626
+ * short id. The stack automatically removes the conflicting short id from its
1627
+ * internal tables (address, binding, route, neighbor, and child tables). The
1628
+ * application should discontinue any other use of the id.
1629
+ * @param id The short id for which a conflict was detected
1630
+ */
1631
+ ezspIdConflictHandler(id: EmberNodeId): void;
1632
+ /**
1633
+ * Write the current node Id, PAN ID, or Node type to the tokens
1634
+ * @param erase Erase the node type or not
1635
+ * @returns An EmberStatus value indicating success or the reason for failure.
1636
+ */
1637
+ ezspWriteNodeData(erase: boolean): Promise<EmberStatus>;
1638
+ /**
1639
+ * Transmits the given message without modification. The MAC header is assumed
1640
+ * to be configured in the message at the time this function is called.
1641
+ * @param messageContents uint8_t * The raw message.
1642
+ * @returns An EmberStatus value indicating success or the reason for failure.
1643
+ */
1644
+ ezspSendRawMessage(messageContents: Buffer): Promise<EmberStatus>;
1645
+ /**
1646
+ * Transmits the given message without modification. The MAC header is assumed
1647
+ * to be configured in the message at the time this function is called.
1648
+ * @param messageContents uint8_t * The raw message.
1649
+ * @param priority uint8_t transmit priority.
1650
+ * @param useCca Should we enable CCA or not.
1651
+ * @returns An EmberStatus value indicating success or the reason for failure.
1652
+ */
1653
+ ezspSendRawMessageExtended(messageContents: Buffer, priority: number, useCca: boolean): Promise<EmberStatus>;
1654
+ /**
1655
+ * Callback
1656
+ * A callback invoked by the EmberZNet stack when a MAC passthrough message is
1657
+ * received.
1658
+ * @param messageType The type of MAC passthrough message received.
1659
+ * @param lastHopLqi uint8_t The link quality from the node that last relayed the message.
1660
+ * @param lastHopRssi int8_t The energy level (in units of dBm) observed during reception.
1661
+ * @param messageLength uint8_t The length of the messageContents parameter in bytes.
1662
+ * @param messageContents uint8_t * The raw message that was received.
1663
+ */
1664
+ ezspMacPassthroughMessageHandler(messageType: EmberMacPassthroughType, lastHopLqi: number, lastHopRssi: number, messageContents: Buffer): void;
1665
+ /**
1666
+ * Callback
1667
+ * A callback invoked by the EmberZNet stack when a raw MAC message that has
1668
+ * matched one of the application's configured MAC filters.
1669
+ * @param filterIndexMatch uint8_t The index of the filter that was matched.
1670
+ * @param legacyPassthroughType The type of MAC passthrough message received.
1671
+ * @param lastHopLqi uint8_t The link quality from the node that last relayed the message.
1672
+ * @param lastHopRssi int8_t The energy level (in units of dBm) observed during reception.
1673
+ * @param messageLength uint8_t The length of the messageContents parameter in bytes.
1674
+ * @param messageContents uint8_t * The raw message that was received.
1675
+ */
1676
+ ezspMacFilterMatchMessageHandler(filterIndexMatch: number, legacyPassthroughType: EmberMacPassthroughType, lastHopLqi: number, lastHopRssi: number, messageContents: Buffer): void;
1677
+ /**
1678
+ * Callback
1679
+ * A callback invoked by the EmberZNet stack when the MAC has finished
1680
+ * transmitting a raw message.
1681
+ * @param status EMBER_SUCCESS if the transmission was successful, or EMBER_DELIVERY_FAILED if not
1682
+ */
1683
+ ezspRawTransmitCompleteHandler(status: EmberStatus): void;
1684
+ /**
1685
+ * This function is useful to sleepy end devices. This function will set the
1686
+ * retry interval (in milliseconds) for mac data poll. This interval is the time
1687
+ * in milliseconds the device waits before retrying a data poll when a MAC level
1688
+ * data poll fails for any reason.
1689
+ * @param waitBeforeRetryIntervalMs uint32_t Time in milliseconds the device waits before retrying
1690
+ * a data poll when a MAC level data poll fails for any reason.
1691
+ */
1692
+ ezspSetMacPollFailureWaitTime(waitBeforeRetryIntervalMs: number): Promise<void>;
1693
+ /**
1694
+ * Sets the priority masks and related variables for choosing the best beacon.
1695
+ * @param param EmberBeaconClassificationParams * The beacon prioritization related variable
1696
+ * @returns The attempt to set the pramaters returns EMBER_SUCCESS
1697
+ */
1698
+ ezspSetBeaconClassificationParams(param: EmberBeaconClassificationParams): Promise<EmberStatus>;
1699
+ /**
1700
+ * Gets the priority masks and related variables for choosing the best beacon.
1701
+ * @returns The attempt to get the pramaters returns EMBER_SUCCESS
1702
+ * @returns EmberBeaconClassificationParams * Gets the beacon prioritization related variable
1703
+ */
1704
+ ezspGetBeaconClassificationParams(): Promise<[EmberStatus, param: EmberBeaconClassificationParams]>;
1705
+ /**
1706
+ * Sets the security state that will be used by the device when it forms or
1707
+ * joins the network. This call should not be used when restoring saved network
1708
+ * state via networkInit as this will result in a loss of security data and will
1709
+ * cause communication problems when the device re-enters the network.
1710
+ * @param state EmberInitialSecurityState * The security configuration to be set.
1711
+ * @returns The success or failure code of the operation.
1712
+ */
1713
+ ezspSetInitialSecurityState(state: EmberInitialSecurityState): Promise<EmberStatus>;
1714
+ /**
1715
+ * Gets the current security state that is being used by a device that is joined
1716
+ * in the network.
1717
+ * @returns The success or failure code of the operation.
1718
+ * @returns EmberCurrentSecurityState * The security configuration in use by the stack.
1719
+ */
1720
+ ezspGetCurrentSecurityState(): Promise<[EmberStatus, state: EmberCurrentSecurityState]>;
1721
+ /**
1722
+ * Exports a key from security manager based on passed context.
1723
+ * @param context sl_zb_sec_man_context_t * Metadata to identify the requested key.
1724
+ * @returns sl_zb_sec_man_key_t * Data to store the exported key in.
1725
+ * @returns sl_status_t * The success or failure code of the operation.
1726
+ */
1727
+ ezspExportKey(context: SecManContext): Promise<[key: SecManKey, status: SLStatus]>;
1728
+ /**
1729
+ * Imports a key into security manager based on passed context.
1730
+ * @param context sl_zb_sec_man_context_t * Metadata to identify where the imported key should be stored.
1731
+ * @param key sl_zb_sec_man_key_t * The key to be imported.
1732
+ * @returns The success or failure code of the operation.
1733
+ */
1734
+ ezspImportKey(context: SecManContext, key: SecManKey): Promise<SLStatus>;
1735
+ /**
1736
+ * Callback
1737
+ * A callback to inform the application that the Network Key has been updated
1738
+ * and the node has been switched over to use the new key. The actual key being
1739
+ * used is not passed up, but the sequence number is.
1740
+ * @param sequenceNumber uint8_t The sequence number of the new network key.
1741
+ */
1742
+ ezspSwitchNetworkKeyHandler(sequenceNumber: number): void;
1743
+ /**
1744
+ * This function searches through the Key Table and tries to find the entry that
1745
+ * matches the passed search criteria.
1746
+ * @param address The address to search for. Alternatively, all zeros may be passed in to search for the first empty entry.
1747
+ * @param linkKey This indicates whether to search for an entry that contains a link key or a master key.
1748
+ * true means to search for an entry with a Link Key.
1749
+ * @returns uint8_t This indicates the index of the entry that matches the search
1750
+ * criteria. A value of 0xFF is returned if not matching entry is found.
1751
+ */
1752
+ ezspFindKeyTableEntry(address: EmberEUI64, linkKey: boolean): Promise<number>;
1753
+ /**
1754
+ * This function sends an APS TransportKey command containing the current trust
1755
+ * center link key. The node to which the command is sent is specified via the
1756
+ * short and long address arguments.
1757
+ * @param destinationNodeId The short address of the node to which this command will be sent
1758
+ * @param destinationEui64 The long address of the node to which this command will be sent
1759
+ * @returns An EmberStatus value indicating success of failure of the operation
1760
+ */
1761
+ ezspSendTrustCenterLinkKey(destinationNodeId: EmberNodeId, destinationEui64: EmberEUI64): Promise<EmberStatus>;
1762
+ /**
1763
+ * This function erases the data in the key table entry at the specified index.
1764
+ * If the index is invalid, false is returned.
1765
+ * @param index uint8_t This indicates the index of entry to erase.
1766
+ * @returns ::EMBER_SUCCESS if the index is valid and the key data was erased.
1767
+ * ::EMBER_KEY_INVALID if the index is out of range for the size of the key table.
1768
+ */
1769
+ ezspEraseKeyTableEntry(index: number): Promise<EmberStatus>;
1770
+ /**
1771
+ * This function clears the key table of the current network.
1772
+ * @returns ::EMBER_SUCCESS if the key table was successfully cleared.
1773
+ * ::EMBER_INVALID_CALL otherwise.
1774
+ */
1775
+ ezspClearKeyTable(): Promise<EmberStatus>;
1776
+ /**
1777
+ * A function to request a Link Key from the Trust Center with another device on
1778
+ * the Network (which could be the Trust Center). A Link Key with the Trust
1779
+ * Center is possible but the requesting device cannot be the Trust Center. Link
1780
+ * Keys are optional in ZigBee Standard Security and thus the stack cannot know
1781
+ * whether the other device supports them. If EMBER_REQUEST_KEY_TIMEOUT is
1782
+ * non-zero on the Trust Center and the partner device is not the Trust Center,
1783
+ * both devices must request keys with their partner device within the time
1784
+ * period. The Trust Center only supports one outstanding key request at a time
1785
+ * and therefore will ignore other requests. If the timeout is zero then the
1786
+ * Trust Center will immediately respond and not wait for the second request.
1787
+ * The Trust Center will always immediately respond to requests for a Link Key
1788
+ * with it. Sleepy devices should poll at a higher rate until a response is
1789
+ * received or the request times out. The success or failure of the request is
1790
+ * returned via ezspZigbeeKeyEstablishmentHandler(...)
1791
+ * @param partner This is the IEEE address of the partner device that will share the link key.
1792
+ * @returns The success or failure of sending the request.
1793
+ * This is not the final result of the attempt. ezspZigbeeKeyEstablishmentHandler(...) will return that.
1794
+ */
1795
+ ezspRequestLinkKey(partner: EmberEUI64): Promise<EmberStatus>;
1796
+ /**
1797
+ * Requests a new link key from the Trust Center. This function starts by
1798
+ * sending a Node Descriptor request to the Trust Center to verify its R21+
1799
+ * stack version compliance. A Request Key message will then be sent, followed
1800
+ * by a Verify Key Confirm message.
1801
+ * @param maxAttempts uint8_t The maximum number of attempts a node should make when sending the Node Descriptor,
1802
+ * Request Key, and Verify Key Confirm messages. The number of attempts resets for each message type sent
1803
+ * (e.g., if maxAttempts is 3, up to 3 Node Descriptors are sent, up to 3 Request Keys, and up to 3 Verify Key Confirm messages are sent).
1804
+ * @returns The success or failure of sending the request.
1805
+ * If the Node Descriptor is successfully transmitted, ezspZigbeeKeyEstablishmentHandler(...)
1806
+ * will be called at a later time with a final status result.
1807
+ */
1808
+ ezspUpdateTcLinkKey(maxAttempts: number): Promise<EmberStatus>;
1809
+ /**
1810
+ * Callback
1811
+ * This is a callback that indicates the success or failure of an attempt to establish a key with a partner device.
1812
+ * @param partner This is the IEEE address of the partner that the device successfully established a key with.
1813
+ * This value is all zeros on a failure.
1814
+ * @param status This is the status indicating what was established or why the key establishment failed.
1815
+ */
1816
+ ezspZigbeeKeyEstablishmentHandler(partner: EmberEUI64, status: EmberKeyStatus): void;
1817
+ /**
1818
+ * Clear all of the transient link keys from RAM.
1819
+ */
1820
+ ezspClearTransientLinkKeys(): Promise<void>;
1821
+ /**
1822
+ * Retrieve information about the current and alternate network key, excluding their contents.
1823
+ * @returns Success or failure of retrieving network key info.
1824
+ * @returns sl_zb_sec_man_network_key_info_t * Information about current and alternate network keys.
1825
+ */
1826
+ ezspGetNetworkKeyInfo(): Promise<[SLStatus, networkKeyInfo: SecManNetworkKeyInfo]>;
1827
+ /**
1828
+ * Retrieve metadata about an APS link key. Does not retrieve contents.
1829
+ * @param context_in sl_zb_sec_man_context_t * Context used to input information about key.
1830
+ * @returns EUI64 associated with this APS link key
1831
+ * @returns sl_zb_sec_man_aps_key_metadata_t * Metadata about the referenced key.
1832
+ * @returns sl_status_t * Status of metadata retrieval operation.
1833
+ */
1834
+ ezspGetApsKeyInfo(context_in: SecManContext): Promise<[eui: EmberEUI64, key_data: SecManAPSKeyMetadata, status: SLStatus]>;
1835
+ /**
1836
+ * Import an application link key into the key table.
1837
+ * @param index uint8_t Index where this key is to be imported to.
1838
+ * @param address EUI64 this key is associated with.
1839
+ * @param plaintextKey sl_zb_sec_man_key_t * The key data to be imported.
1840
+ * @returns Status of key import operation.
1841
+ */
1842
+ ezspImportLinkKey(index: number, address: EmberEUI64, plaintextKey: SecManKey): Promise<SLStatus>;
1843
+ /**
1844
+ * Export the link key at given index from the key table.
1845
+ * @param uint8_t Index of key to export.
1846
+ * @returns EUI64 associated with the exported key.
1847
+ * @returns sl_zb_sec_man_key_t * The exported key.
1848
+ * @returns sl_zb_sec_man_aps_key_metadata_t * Metadata about the key.
1849
+ * @returns sl_status_t * Status of key export operation.
1850
+ */
1851
+ ezspExportLinkKeyByIndex(index: number): Promise<[eui: EmberEUI64, plaintextKey: SecManKey, keyData: SecManAPSKeyMetadata, status: SLStatus]>;
1852
+ /**
1853
+ * Export the link key associated with the given EUI from the key table.
1854
+ * @param eui EUI64 associated with the key to export.
1855
+ * @returns sl_zb_sec_man_key_t * The exported key.
1856
+ * @returns uint8_t * Key index of the exported key.
1857
+ * @returns sl_zb_sec_man_aps_key_metadata_t * Metadata about the key.
1858
+ * @returns sl_status_t * Status of key export operation.
1859
+ */
1860
+ ezspExportLinkKeyByEui(eui: EmberEUI64): Promise<[plaintextKey: SecManKey, index: number, keyData: SecManAPSKeyMetadata, status: SLStatus]>;
1861
+ /**
1862
+ * Check whether a key context can be used to load a valid key.
1863
+ * @param context sl_zb_sec_man_context_t * Context struct to check the validity of.
1864
+ * @returns Validity of the checked context.
1865
+ */
1866
+ ezspCheckKeyContext(context: SecManContext): Promise<SLStatus>;
1867
+ /**
1868
+ * Import a transient link key.
1869
+ * @param eui64 EUI64 associated with this transient key.
1870
+ * @param plaintextKey sl_zb_sec_man_key_t * The key to import.
1871
+ * @param sl_zigbee_sec_man_flags_t Flags associated with this transient key.
1872
+ * @returns Status of key import operation.
1873
+ */
1874
+ ezspImportTransientKey(eui64: EmberEUI64, plaintextKey: SecManKey, flags: SecManFlag): Promise<SLStatus>;
1875
+ /**
1876
+ * Export a transient link key from a given table index.
1877
+ * @param uint8_t Index to export from.
1878
+ * @returns sl_zb_sec_man_context_t * Context struct for export operation.
1879
+ * @returns sl_zb_sec_man_key_t * The exported key.
1880
+ * @returns sl_zb_sec_man_aps_key_metadata_t * Metadata about the key.
1881
+ * @returns sl_status_t * Status of key export operation.
1882
+ */
1883
+ ezspExportTransientKeyByIndex(index: number): Promise<[context: SecManContext, plaintextKey: SecManKey, key_data: SecManAPSKeyMetadata, status: SLStatus]>;
1884
+ /**
1885
+ * Export a transient link key associated with a given EUI64
1886
+ * @param eui Index to export from.
1887
+ * @returns sl_zb_sec_man_context_t * Context struct for export operation.
1888
+ * @returns sl_zb_sec_man_key_t * The exported key.
1889
+ * @returns sl_zb_sec_man_aps_key_metadata_t * Metadata about the key.
1890
+ * @returns sl_status_t * Status of key export operation.
1891
+ */
1892
+ ezspExportTransientKeyByEui(eui: EmberEUI64): Promise<[context: SecManContext, plaintextKey: SecManKey, key_data: SecManAPSKeyMetadata, status: SLStatus]>;
1893
+ /**
1894
+ * Callback
1895
+ * The NCP used the trust center behavior policy to decide whether to allow a
1896
+ * new node to join the network. The Host cannot change the current decision,
1897
+ * but it can change the policy for future decisions using the setPolicy
1898
+ * command.
1899
+ * @param newNodeId The Node Id of the node whose status changed
1900
+ * @param newNodeEui64 The EUI64 of the node whose status changed.
1901
+ * @param status The status of the node: Secure Join/Rejoin, Unsecure Join/Rejoin, Device left.
1902
+ * @param policyDecision An EmberJoinDecision reflecting the decision made.
1903
+ * @param parentOfNewNodeId The parent of the node whose status has changed.
1904
+ */
1905
+ ezspTrustCenterJoinHandler(newNodeId: EmberNodeId, newNodeEui64: EmberEUI64, status: EmberDeviceUpdate, policyDecision: EmberJoinDecision, parentOfNewNodeId: EmberNodeId): void;
1906
+ /**
1907
+ * This function broadcasts a new encryption key, but does not tell the nodes in
1908
+ * the network to start using it. To tell nodes to switch to the new key, use
1909
+ * ezspBroadcastNetworkKeySwitch(). This is only valid for the Trust
1910
+ * Center/Coordinator. It is up to the application to determine how quickly to
1911
+ * send the Switch Key after sending the alternate encryption key.
1912
+ * @param key EmberKeyData * An optional pointer to a 16-byte encryption key (EMBER_ENCRYPTION_KEY_SIZE).
1913
+ * An all zero key may be passed in, which will cause the stack to randomly generate a new key.
1914
+ * @returns EmberStatus value that indicates the success or failure of the command.
1915
+ */
1916
+ ezspBroadcastNextNetworkKey(key: EmberKeyData): Promise<EmberStatus>;
1917
+ /**
1918
+ * This function broadcasts a switch key message to tell all nodes to change to
1919
+ * the sequence number of the previously sent Alternate Encryption Key.
1920
+ * @returns EmberStatus value that indicates the success or failure of the
1921
+ * command.
1922
+ */
1923
+ ezspBroadcastNetworkKeySwitch(): Promise<EmberStatus>;
1924
+ /**
1925
+ * This routine processes the passed chunk of data and updates the hash context
1926
+ * based on it. If the 'finalize' parameter is not set, then the length of the
1927
+ * data passed in must be a multiple of 16. If the 'finalize' parameter is set
1928
+ * then the length can be any value up 1-16, and the final hash value will be
1929
+ * calculated.
1930
+ * @param context EmberAesMmoHashContext * The hash context to update.
1931
+ * @param finalize This indicates whether the final hash value should be calculated
1932
+ * @param data uint8_t * The data to hash.
1933
+ * @returns The result of the operation
1934
+ * @returns EmberAesMmoHashContext * The updated hash context.
1935
+ */
1936
+ ezspAesMmoHash(context: EmberAesMmoHashContext, finalize: boolean, data: Buffer): Promise<[EmberStatus, returnContext: EmberAesMmoHashContext]>;
1937
+ /**
1938
+ * This command sends an APS remove device using APS encryption to the
1939
+ * destination indicating either to remove itself from the network, or one of
1940
+ * its children.
1941
+ * @param destShort The node ID of the device that will receive the message
1942
+ * @param destLong The long address (EUI64) of the device that will receive the message.
1943
+ * @param targetLong The long address (EUI64) of the device to be removed.
1944
+ * @returns An EmberStatus value indicating success, or the reason for failure
1945
+ */
1946
+ ezspRemoveDevice(destShort: EmberNodeId, destLong: EmberEUI64, targetLong: EmberEUI64): Promise<EmberStatus>;
1947
+ /**
1948
+ * This command will send a unicast transport key message with a new NWK key to
1949
+ * the specified device. APS encryption using the device's existing link key
1950
+ * will be used.
1951
+ * @param destShort The node ID of the device that will receive the message
1952
+ * @param destLong The long address (EUI64) of the device that will receive the message.
1953
+ * @param key EmberKeyData * The NWK key to send to the new device.
1954
+ * @returns An EmberStatus value indicating success, or the reason for failure
1955
+ */
1956
+ ezspUnicastNwkKeyUpdate(destShort: EmberNodeId, destLong: EmberEUI64, key: EmberKeyData): Promise<EmberStatus>;
1957
+ /**
1958
+ * This call starts the generation of the ECC Ephemeral Public/Private key pair.
1959
+ * When complete it stores the private key. The results are returned via
1960
+ * ezspGenerateCbkeKeysHandler().
1961
+ */
1962
+ ezspGenerateCbkeKeys(): Promise<EmberStatus>;
1963
+ /**
1964
+ * Callback
1965
+ * A callback by the Crypto Engine indicating that a new ephemeral
1966
+ * public/private key pair has been generated. The public/private key pair is
1967
+ * stored on the NCP, but only the associated public key is returned to the
1968
+ * host. The node's associated certificate is also returned.
1969
+ * @param status The result of the CBKE operation.
1970
+ * @param ephemeralPublicKey EmberPublicKeyData * The generated ephemeral public key.
1971
+ */
1972
+ ezspGenerateCbkeKeysHandler(status: EmberStatus, ephemeralPublicKey: EmberPublicKeyData): void;
1973
+ /**
1974
+ * Calculates the SMAC verification keys for both the initiator and responder
1975
+ * roles of CBKE using the passed parameters and the stored public/private key
1976
+ * pair previously generated with ezspGenerateKeysRetrieveCert(). It also stores
1977
+ * the unverified link key data in temporary storage on the NCP until the key
1978
+ * establishment is complete.
1979
+ * @param amInitiator The role of this device in the Key Establishment protocol.
1980
+ * @param partnerCertificate EmberCertificateData * The key establishment partner's implicit certificate.
1981
+ * @param partnerEphemeralPublicKey EmberPublicKeyData * The key establishment partner's ephemeral public key
1982
+ */
1983
+ ezspCalculateSmacs(amInitiator: boolean, partnerCertificate: EmberCertificateData, partnerEphemeralPublicKey: EmberPublicKeyData): Promise<EmberStatus>;
1984
+ /**
1985
+ * Callback
1986
+ * A callback to indicate that the NCP has finished calculating the Secure
1987
+ * Message Authentication Codes (SMAC) for both the initiator and responder. The
1988
+ * associated link key is kept in temporary storage until the host tells the NCP
1989
+ * to store or discard the key via emberClearTemporaryDataMaybeStoreLinkKey().
1990
+ * @param status The Result of the CBKE operation.
1991
+ * @param initiatorSmac EmberSmacData * The calculated value of the initiator's SMAC
1992
+ * @param responderSmac EmberSmacData * The calculated value of the responder's SMAC
1993
+ */
1994
+ ezspCalculateSmacsHandler(status: EmberStatus, initiatorSmac: EmberSmacData, responderSmac: EmberSmacData): void;
1995
+ /**
1996
+ * This call starts the generation of the ECC 283k1 curve Ephemeral
1997
+ * Public/Private key pair. When complete it stores the private key. The results
1998
+ * are returned via ezspGenerateCbkeKeysHandler283k1().
1999
+ */
2000
+ ezspGenerateCbkeKeys283k1(): Promise<EmberStatus>;
2001
+ /**
2002
+ * Callback
2003
+ * A callback by the Crypto Engine indicating that a new 283k1 ephemeral
2004
+ * public/private key pair has been generated. The public/private key pair is
2005
+ * stored on the NCP, but only the associated public key is returned to the
2006
+ * host. The node's associated certificate is also returned.
2007
+ * @param status The result of the CBKE operation.
2008
+ * @param ephemeralPublicKey EmberPublicKey283k1Data * The generated ephemeral public key.
2009
+ */
2010
+ ezspGenerateCbkeKeysHandler283k1(status: EmberStatus, ephemeralPublicKey: EmberPublicKey283k1Data): void;
2011
+ /**
2012
+ * Calculates the SMAC verification keys for both the initiator and responder
2013
+ * roles of CBKE for the 283k1 ECC curve using the passed parameters and the
2014
+ * stored public/private key pair previously generated with
2015
+ * ezspGenerateKeysRetrieveCert283k1(). It also stores the unverified link key
2016
+ * data in temporary storage on the NCP until the key establishment is complete.
2017
+ * @param amInitiator The role of this device in the Key Establishment protocol.
2018
+ * @param partnerCertificate EmberCertificate283k1Data * The key establishment partner's implicit certificate.
2019
+ * @param partnerEphemeralPublicKey EmberPublicKey283k1Data * The key establishment partner's ephemeral public key
2020
+ */
2021
+ ezspCalculateSmacs283k1(amInitiator: boolean, partnerCertificate: EmberCertificate283k1Data, partnerEphemeralPublicKey: EmberPublicKey283k1Data): Promise<EmberStatus>;
2022
+ /**
2023
+ * Callback
2024
+ * A callback to indicate that the NCP has finished calculating the Secure
2025
+ * Message Authentication Codes (SMAC) for both the initiator and responder for
2026
+ * the CBKE 283k1 Library. The associated link key is kept in temporary storage
2027
+ * until the host tells the NCP to store or discard the key via
2028
+ * emberClearTemporaryDataMaybeStoreLinkKey().
2029
+ * @param status The Result of the CBKE operation.
2030
+ * @param initiatorSmac EmberSmacData * The calculated value of the initiator's SMAC
2031
+ * @param responderSmac EmberSmacData * The calculated value of the responder's SMAC
2032
+ */
2033
+ ezspCalculateSmacsHandler283k1(status: EmberStatus, initiatorSmac: EmberSmacData, responderSmac: EmberSmacData): void;
2034
+ /**
2035
+ * Clears the temporary data associated with CBKE and the key establishment,
2036
+ * most notably the ephemeral public/private key pair. If storeLinKey is true it
2037
+ * moves the unverified link key stored in temporary storage into the link key
2038
+ * table. Otherwise it discards the key.
2039
+ * @param storeLinkKey A bool indicating whether to store (true) or discard (false) the unverified link
2040
+ * key derived when ezspCalculateSmacs() was previously called.
2041
+ */
2042
+ ezspClearTemporaryDataMaybeStoreLinkKey(storeLinkKey: boolean): Promise<EmberStatus>;
2043
+ /**
2044
+ * Clears the temporary data associated with CBKE and the key establishment,
2045
+ * most notably the ephemeral public/private key pair. If storeLinKey is true it
2046
+ * moves the unverified link key stored in temporary storage into the link key
2047
+ * table. Otherwise it discards the key.
2048
+ * @param storeLinkKey A bool indicating whether to store (true) or discard (false) the unverified link
2049
+ * key derived when ezspCalculateSmacs() was previously called.
2050
+ */
2051
+ ezspClearTemporaryDataMaybeStoreLinkKey283k1(storeLinkKey: boolean): Promise<EmberStatus>;
2052
+ /**
2053
+ * Retrieves the certificate installed on the NCP.
2054
+ * @returns EmberCertificateData * The locally installed certificate.
2055
+ */
2056
+ ezspGetCertificate(): Promise<[EmberStatus, localCert: EmberCertificateData]>;
2057
+ /**
2058
+ * Retrieves the 283k certificate installed on the NCP.
2059
+ * @returns EmberCertificate283k1Data * The locally installed certificate.
2060
+ */
2061
+ ezspGetCertificate283k1(): Promise<[EmberStatus, localCert: EmberCertificate283k1Data]>;
2062
+ /**
2063
+ * LEGACY FUNCTION: This functionality has been replaced by a single bit in the
2064
+ * EmberApsFrame, EMBER_APS_OPTION_DSA_SIGN. Devices wishing to send signed
2065
+ * messages should use that as it requires fewer function calls and message
2066
+ * buffering. The dsaSignHandler response is still called when
2067
+ * EMBER_APS_OPTION_DSA_SIGN is used. However, this function is still supported.
2068
+ * This function begins the process of signing the passed message contained
2069
+ * within the messageContents array. If no other ECC operation is going on, it
2070
+ * will immediately return with EMBER_OPERATION_IN_PROGRESS to indicate the
2071
+ * start of ECC operation. It will delay a period of time to let APS retries
2072
+ * take place, but then it will shut down the radio and consume the CPU
2073
+ * processing until the signing is complete. This may take up to 1 second. The
2074
+ * signed message will be returned in the dsaSignHandler response. Note that the
2075
+ * last byte of the messageContents passed to this function has special
2076
+ * significance. As the typical use case for DSA signing is to sign the ZCL
2077
+ * payload of a DRLC Report Event Status message in SE 1.0, there is often both
2078
+ * a signed portion (ZCL payload) and an unsigned portion (ZCL header). The last
2079
+ * byte in the content of messageToSign is therefore used as a special indicator
2080
+ * to signify how many bytes of leading data in the array should be excluded
2081
+ * from consideration during the signing process. If the signature needs to
2082
+ * cover the entire array (all bytes except last one), the caller should ensure
2083
+ * that the last byte of messageContents is 0x00. When the signature operation
2084
+ * is complete, this final byte will be replaced by the signature type indicator
2085
+ * (0x01 for ECDSA signatures), and the actual signature will be appended to the
2086
+ * original contents after this byte.
2087
+ * @param messageLength uint8_t The length of the messageContents parameter in bytes.
2088
+ * @param messageContents uint8_t * The message contents for which to create a signature.
2089
+ * Per above notes, this may include a leading portion of data not included in the signature,
2090
+ * in which case the last byte of this array should be set to the index of the first byte
2091
+ * to be considered for signing. Otherwise, the last byte of messageContents should be 0x00
2092
+ * to indicate that a signature should occur across the entire contents.
2093
+ * @returns EMBER_OPERATION_IN_PROGRESS if the stack has queued up the operation
2094
+ * for execution. EMBER_INVALID_CALL if the operation can't be performed in this
2095
+ * context, possibly because another ECC operation is pending.
2096
+ */
2097
+ ezspDsaSign(messageContents: Buffer): Promise<EmberStatus>;
2098
+ /**
2099
+ * Callback
2100
+ * The handler that returns the results of the signing operation. On success,
2101
+ * the signature will be appended to the original message (including the
2102
+ * signature type indicator that replaced the startIndex field for the signing)
2103
+ * and both are returned via this callback.
2104
+ * @param status The result of the DSA signing operation.
2105
+ * @param messageLength uint8_t The length of the messageContents parameter in bytes.
2106
+ * @param messageContents uint8_t *The message and attached which includes the original message and the appended signature.
2107
+ */
2108
+ ezspDsaSignHandler(status: EmberStatus, messageContents: Buffer): void;
2109
+ /**
2110
+ * Verify that signature of the associated message digest was signed by the
2111
+ * private key of the associated certificate.
2112
+ * @param digest EmberMessageDigest * The AES-MMO message digest of the signed data.
2113
+ * If dsaSign command was used to generate the signature for this data, the final byte (replaced by signature type of 0x01)
2114
+ * in the messageContents array passed to dsaSign is included in the hash context used for the digest calculation.
2115
+ * @param signerCertificate EmberCertificateData * The certificate of the signer. Note that the signer's certificate and the verifier's
2116
+ * certificate must both be issued by the same Certificate Authority, so they should share the same CA Public Key.
2117
+ * @param receivedSig EmberSignatureData * The signature of the signed data.
2118
+ */
2119
+ ezspDsaVerify(digest: EmberMessageDigest, signerCertificate: EmberCertificateData, receivedSig: EmberSignatureData): Promise<EmberStatus>;
2120
+ /**
2121
+ * Callback
2122
+ * This callback is executed by the stack when the DSA verification has
2123
+ * completed and has a result. If the result is EMBER_SUCCESS, the signature is
2124
+ * valid. If the result is EMBER_SIGNATURE_VERIFY_FAILURE then the signature is
2125
+ * invalid. If the result is anything else then the signature verify operation
2126
+ * failed and the validity is unknown.
2127
+ * @param status The result of the DSA verification operation.
2128
+ */
2129
+ ezspDsaVerifyHandler(status: EmberStatus): void;
2130
+ /**
2131
+ * Verify that signature of the associated message digest was signed by the
2132
+ * private key of the associated certificate.
2133
+ * @param digest EmberMessageDigest * The AES-MMO message digest of the signed data.
2134
+ * If dsaSign command was used to generate the signature for this data, the final byte (replaced by signature type of 0x01)
2135
+ * in the messageContents array passed to dsaSign is included in the hash context used for the digest calculation.
2136
+ * @param signerCertificate EmberCertificate283k1Data * The certificate of the signer. Note that the signer's certificate and the verifier's
2137
+ * certificate must both be issued by the same Certificate Authority, so they should share the same CA Public Key.
2138
+ * @param receivedSig EmberSignature283k1Data * The signature of the signed data.
2139
+ */
2140
+ ezspDsaVerify283k1(digest: EmberMessageDigest, signerCertificate: EmberCertificate283k1Data, receivedSig: EmberSignature283k1Data): Promise<EmberStatus>;
2141
+ /**
2142
+ * Sets the device's CA public key, local certificate, and static private key on
2143
+ * the NCP associated with this node.
2144
+ * @param caPublic EmberPublicKeyData * The Certificate Authority's public key.
2145
+ * @param myCert EmberCertificateData * The node's new certificate signed by the CA.
2146
+ * @param myKey EmberPrivateKeyData *The node's new static private key.
2147
+ */
2148
+ ezspSetPreinstalledCbkeData(caPublic: EmberPublicKeyData, myCert: EmberCertificateData, myKey: EmberPrivateKeyData): Promise<EmberStatus>;
2149
+ /**
2150
+ * Sets the device's 283k1 curve CA public key, local certificate, and static
2151
+ * private key on the NCP associated with this node.
2152
+ * @returns Status of operation
2153
+ */
2154
+ ezspSavePreinstalledCbkeData283k1(): Promise<EmberStatus>;
2155
+ /**
2156
+ * Activate use of mfglib test routines and enables the radio receiver to report
2157
+ * packets it receives to the mfgLibRxHandler() callback. These packets will not
2158
+ * be passed up with a CRC failure. All other mfglib functions will return an
2159
+ * error until the mfglibStart() has been called
2160
+ * @param rxCallback true to generate a mfglibRxHandler callback when a packet is received.
2161
+ * @returns An EmberStatus value indicating success or the reason for failure.
2162
+ */
2163
+ ezspMfglibStart(rxCallback: boolean): Promise<EmberStatus>;
2164
+ /**
2165
+ * Deactivate use of mfglib test routines; restores the hardware to the state it
2166
+ * was in prior to mfglibStart() and stops receiving packets started by
2167
+ * mfglibStart() at the same time.
2168
+ * @returns An EmberStatus value indicating success or the reason for failure.
2169
+ */
2170
+ mfglibEnd(): Promise<EmberStatus>;
2171
+ /**
2172
+ * Starts transmitting an unmodulated tone on the currently set channel and
2173
+ * power level. Upon successful return, the tone will be transmitting. To stop
2174
+ * transmitting tone, application must call mfglibStopTone(), allowing it the
2175
+ * flexibility to determine its own criteria for tone duration (time, event,
2176
+ * etc.)
2177
+ * @returns An EmberStatus value indicating success or the reason for failure.
2178
+ */
2179
+ mfglibStartTone(): Promise<EmberStatus>;
2180
+ /**
2181
+ * Stops transmitting tone started by mfglibStartTone().
2182
+ * @returns An EmberStatus value indicating success or the reason for failure.
2183
+ */
2184
+ mfglibStopTone(): Promise<EmberStatus>;
2185
+ /**
2186
+ * Starts transmitting a random stream of characters. This is so that the radio
2187
+ * modulation can be measured.
2188
+ * @returns An EmberStatus value indicating success or the reason for failure.
2189
+ */
2190
+ mfglibStartStream(): Promise<EmberStatus>;
2191
+ /**
2192
+ * Stops transmitting a random stream of characters started by
2193
+ * mfglibStartStream().
2194
+ * @returns An EmberStatus value indicating success or the reason for failure.
2195
+ */
2196
+ mfglibStopStream(): Promise<EmberStatus>;
2197
+ /**
2198
+ * Sends a single packet consisting of the following bytes: packetLength,
2199
+ * packetContents[0], ... , packetContents[packetLength - 3], CRC[0], CRC[1].
2200
+ * The total number of bytes sent is packetLength + 1. The radio replaces the
2201
+ * last two bytes of packetContents[] with the 16-bit CRC for the packet.
2202
+ * @param packetLength uint8_t The length of the packetContents parameter in bytes. Must be greater than 3 and less than 123.
2203
+ * @param packetContents uint8_t * The packet to send. The last two bytes will be replaced with the 16-bit CRC.
2204
+ * @returns An EmberStatus value indicating success or the reason for failure.
2205
+ */
2206
+ mfglibSendPacket(packetContents: Buffer): Promise<EmberStatus>;
2207
+ /**
2208
+ * Sets the radio channel. Calibration occurs if this is the first time the
2209
+ * channel has been used.
2210
+ * @param channel uint8_t The channel to switch to. Valid values are 11 - 26.
2211
+ * @returns An EmberStatus value indicating success or the reason for failure.
2212
+ */
2213
+ mfglibSetChannel(channel: number): Promise<EmberStatus>;
2214
+ /**
2215
+ * Returns the current radio channel, as previously set via mfglibSetChannel().
2216
+ * @returns uint8_t The current channel.
2217
+ */
2218
+ mfglibGetChannel(): Promise<number>;
2219
+ /**
2220
+ * First select the transmit power mode, and then include a method for selecting
2221
+ * the radio transmit power. The valid power settings depend upon the specific
2222
+ * radio in use. Ember radios have discrete power settings, and then requested
2223
+ * power is rounded to a valid power setting; the actual power output is
2224
+ * available to the caller via mfglibGetPower().
2225
+ * @param txPowerMode uint16_t Power mode. Refer to txPowerModes in stack/include/ember-types.h for possible values.
2226
+ * @param power int8_t Power in units of dBm. Refer to radio data sheet for valid range.
2227
+ * @returns An EmberStatus value indicating success or the reason for failure.
2228
+ */
2229
+ mfglibSetPower(txPowerMode: EmberTXPowerMode, power: number): Promise<EmberStatus>;
2230
+ /**
2231
+ * Returns the current radio power setting, as previously set via mfglibSetPower().
2232
+ * @returns int8_t Power in units of dBm. Refer to radio data sheet for valid range.
2233
+ */
2234
+ mfglibGetPower(): Promise<number>;
2235
+ /**
2236
+ * Callback
2237
+ * A callback indicating a packet with a valid CRC has been received.
2238
+ * @param linkQuality uint8_t The link quality observed during the reception
2239
+ * @param rssi int8_t The energy level (in units of dBm) observed during the reception.
2240
+ * @param packetLength uint8_t The length of the packetContents parameter in bytes. Will be greater than 3 and less than 123.
2241
+ * @param packetContents uint8_t * The received packet (last 2 bytes are not FCS / CRC and may be discarded)
2242
+ */
2243
+ ezspMfglibRxHandler(linkQuality: number, rssi: number, packetLength: number, packetContents: number[]): void;
2244
+ /**
2245
+ * Quits the current application and launches the standalone bootloader (if
2246
+ * installed) The function returns an error if the standalone bootloader is not
2247
+ * present
2248
+ * @param mode uint8_t Controls the mode in which the standalone bootloader will run. See the app. note for full details.
2249
+ * Options are: STANDALONE_BOOTLOADER_NORMAL_MODE: Will listen for an over-the-air image transfer on the current
2250
+ * channel with current power settings. STANDALONE_BOOTLOADER_RECOVERY_MODE: Will listen for an over-the-air image
2251
+ * transfer on the default channel with default power settings. Both modes also allow an image transfer to begin
2252
+ * with XMODEM over the serial protocol's Bootloader Frame.
2253
+ * @returns An EmberStatus value indicating success or the reason for failure.
2254
+ */
2255
+ ezspLaunchStandaloneBootloader(mode: number): Promise<EmberStatus>;
2256
+ /**
2257
+ * Transmits the given bootload message to a neighboring node using a specific
2258
+ * 802.15.4 header that allows the EmberZNet stack as well as the bootloader to
2259
+ * recognize the message, but will not interfere with other ZigBee stacks.
2260
+ * @param broadcast If true, the destination address and pan id are both set to the broadcast address.
2261
+ * @param destEui64 The EUI64 of the target node. Ignored if the broadcast field is set to true.
2262
+ * @param messageLength uint8_t The length of the messageContents parameter in bytes.
2263
+ * @param messageContents uint8_t * The multicast message.
2264
+ * @returns An EmberStatus value indicating success or the reason for failure.
2265
+ */
2266
+ ezspSendBootloadMessage(broadcast: boolean, destEui64: EmberEUI64, messageContents: Buffer): Promise<EmberStatus>;
2267
+ /**
2268
+ * Detects if the standalone bootloader is installed, and if so returns the
2269
+ * installed version. If not return 0xffff. A returned version of 0x1234 would
2270
+ * indicate version 1.2 build 34. Also return the node's version of PLAT, MICRO
2271
+ * and PHY.
2272
+ * @returns uint16_t BOOTLOADER_INVALID_VERSION if the standalone bootloader is not present,
2273
+ * or the version of the installed standalone bootloader.
2274
+ * @returns uint8_t * The value of PLAT on the node
2275
+ * @returns uint8_t * The value of MICRO on the node
2276
+ * @returns uint8_t * The value of PHY on the node
2277
+ */
2278
+ ezspGetStandaloneBootloaderVersionPlatMicroPhy(): Promise<[number, nodePlat: number, nodeMicro: number, nodePhy: number]>;
2279
+ /**
2280
+ * Callback
2281
+ * A callback invoked by the EmberZNet stack when a bootload message is
2282
+ * received.
2283
+ * @param longId The EUI64 of the sending node.
2284
+ * @param lastHopLqi uint8_t The link quality from the node that last relayed the message.
2285
+ * @param lastHopRssi int8_t The energy level (in units of dBm) observed during the reception.
2286
+ * @param messageLength uint8_t The length of the messageContents parameter in bytes.
2287
+ * @param messageContents uint8_t *The bootload message that was sent.
2288
+ */
2289
+ ezspIncomingBootloadMessageHandler(longId: EmberEUI64, lastHopLqi: number, lastHopRssi: number, messageContents: Buffer): void;
2290
+ /**
2291
+ * Callback
2292
+ * A callback invoked by the EmberZNet stack when the MAC has finished
2293
+ * transmitting a bootload message.
2294
+ * @param status An EmberStatus value of EMBER_SUCCESS if an ACK was received from the destination
2295
+ * or EMBER_DELIVERY_FAILED if no ACK was received.
2296
+ * @param messageLength uint8_t The length of the messageContents parameter in bytes.
2297
+ * @param messageContents uint8_t * The message that was sent.
2298
+ */
2299
+ ezspBootloadTransmitCompleteHandler(status: EmberStatus, messageContents: Buffer): void;
2300
+ /**
2301
+ * Perform AES encryption on plaintext using key.
2302
+ * @param uint8_t * 16 bytes of plaintext.
2303
+ * @param uint8_t * The 16-byte encryption key to use.
2304
+ * @returns uint8_t * 16 bytes of ciphertext.
2305
+ */
2306
+ ezspAesEncrypt(plaintext: number[], key: number[]): Promise<number[]>;
2307
+ /**
2308
+ * A consolidation of ZLL network operations with similar signatures;
2309
+ * specifically, forming and joining networks or touch-linking.
2310
+ * @param networkInfo EmberZllNetwork * Information about the network.
2311
+ * @param op Operation indicator.
2312
+ * @param radioTxPower int8_t Radio transmission power.
2313
+ * @returns An EmberStatus value indicating success or the reason for failure.
2314
+ */
2315
+ ezspZllNetworkOps(networkInfo: EmberZllNetwork, op: EzspZllNetworkOperation, radioTxPower: number): Promise<EmberStatus>;
2316
+ /**
2317
+ * This call will cause the device to setup the security information used in its
2318
+ * network. It must be called prior to forming, starting, or joining a network.
2319
+ * @param networkKey EmberKeyData * ZLL Network key.
2320
+ * @param securityState EmberZllInitialSecurityState * Initial security state of the network.
2321
+ * @returns An EmberStatus value indicating success or the reason for failure.
2322
+ */
2323
+ ezspZllSetInitialSecurityState(networkKey: EmberKeyData, securityState: EmberZllInitialSecurityState): Promise<EmberStatus>;
2324
+ /**
2325
+ * This call will update ZLL security token information. Unlike
2326
+ * emberZllSetInitialSecurityState, this can be called while a network is
2327
+ * already established.
2328
+ * @param securityState EmberZllInitialSecurityState * Security state of the network.
2329
+ * @returns An EmberStatus value indicating success or the reason for failure.
2330
+ */
2331
+ ezspZllSetSecurityStateWithoutKey(securityState: EmberZllInitialSecurityState): Promise<EmberStatus>;
2332
+ /**
2333
+ * This call will initiate a ZLL network scan on all the specified channels.
2334
+ * @param channelMask uint32_t The range of channels to scan.
2335
+ * @param radioPowerForScan int8_t The radio output power used for the scan requests.
2336
+ * @param nodeType The node type of the local device.
2337
+ * @returns An EmberStatus value indicating success or the reason for failure.
2338
+ */
2339
+ ezspZllStartScan(channelMask: number, radioPowerForScan: number, nodeType: EmberNodeType): Promise<EmberStatus>;
2340
+ /**
2341
+ * This call will change the mode of the radio so that the receiver is on for a
2342
+ * specified amount of time when the device is idle.
2343
+ * @param durationMs uint32_t The duration in milliseconds to leave the radio on.
2344
+ * @returns An EmberStatus value indicating success or the reason for failure.
2345
+ */
2346
+ ezspZllSetRxOnWhenIdle(durationMs: number): Promise<EmberStatus>;
2347
+ /**
2348
+ * Callback
2349
+ * This call is fired when a ZLL network scan finds a ZLL network.
2350
+ * @param networkInfo EmberZllNetwork * Information about the network.
2351
+ * @param isDeviceInfoNull Used to interpret deviceInfo field.
2352
+ * @param deviceInfo EmberZllDeviceInfoRecord * Device specific information.
2353
+ * @param lastHopLqi uint8_t The link quality from the node that last relayed the message.
2354
+ * @param lastHopRssi int8_t The energy level (in units of dBm) observed during reception.
2355
+ */
2356
+ ezspZllNetworkFoundHandler(networkInfo: EmberZllNetwork, isDeviceInfoNull: boolean, deviceInfo: EmberZllDeviceInfoRecord, lastHopLqi: number, lastHopRssi: number): void;
2357
+ /**
2358
+ * Callback
2359
+ * This call is fired when a ZLL network scan is complete.
2360
+ * @param status Status of the operation.
2361
+ */
2362
+ ezspZllScanCompleteHandler(status: EmberStatus): void;
2363
+ /**
2364
+ * Callback
2365
+ * This call is fired when network and group addresses are assigned to a remote
2366
+ * mode in a network start or network join request.
2367
+ * @param addressInfo EmberZllAddressAssignment * Address assignment information.
2368
+ * @param lastHopLqi uint8_t The link quality from the node that last relayed the message.
2369
+ * @param lastHopRssi int8_t The energy level (in units of dBm) observed during reception.
2370
+ */
2371
+ ezspZllAddressAssignmentHandler(addressInfo: EmberZllAddressAssignment, lastHopLqi: number, lastHopRssi: number): void;
2372
+ /**
2373
+ * Callback
2374
+ * This call is fired when the device is a target of a touch link.
2375
+ * @param networkInfo EmberZllNetwork * Information about the network.
2376
+ */
2377
+ ezspZllTouchLinkTargetHandler(networkInfo: EmberZllNetwork): void;
2378
+ /**
2379
+ * Get the ZLL tokens.
2380
+ * @returns EmberTokTypeStackZllData * Data token return value.
2381
+ * @returns EmberTokTypeStackZllSecurity * Security token return value.
2382
+ */
2383
+ ezspZllGetTokens(): Promise<[data: EmberTokTypeStackZllData, security: EmberTokTypeStackZllSecurity]>;
2384
+ /**
2385
+ * Set the ZLL data token.
2386
+ * @param data EmberTokTypeStackZllData * Data token to be set.
2387
+ */
2388
+ ezspZllSetDataToken(data: EmberTokTypeStackZllData): Promise<void>;
2389
+ /**
2390
+ * Set the ZLL data token bitmask to reflect the ZLL network state.
2391
+ */
2392
+ ezspZllSetNonZllNetwork(): Promise<void>;
2393
+ /**
2394
+ * Is this a ZLL network?
2395
+ * @returns ZLL network?
2396
+ */
2397
+ ezspIsZllNetwork(): Promise<boolean>;
2398
+ /**
2399
+ * This call sets the radio's default idle power mode.
2400
+ * @param mode The power mode to be set.
2401
+ */
2402
+ ezspZllSetRadioIdleMode(mode: number): Promise<void>;
2403
+ /**
2404
+ * This call gets the radio's default idle power mode.
2405
+ * @returns uint8_t The current power mode.
2406
+ */
2407
+ ezspZllGetRadioIdleMode(): Promise<number>;
2408
+ /**
2409
+ * This call sets the default node type for a factory new ZLL device.
2410
+ * @param nodeType The node type to be set.
2411
+ */
2412
+ ezspSetZllNodeType(nodeType: EmberNodeType): Promise<void>;
2413
+ /**
2414
+ * This call sets additional capability bits in the ZLL state.
2415
+ * @param uint16_t A mask with the bits to be set or cleared.
2416
+ */
2417
+ ezspSetZllAdditionalState(state: number): Promise<void>;
2418
+ /**
2419
+ * Is there a ZLL (Touchlink) operation in progress?
2420
+ * @returns ZLL operation in progress? false on error
2421
+ */
2422
+ ezspZllOperationInProgress(): Promise<boolean>;
2423
+ /**
2424
+ * Is the ZLL radio on when idle mode is active?
2425
+ * @returns ZLL radio on when idle mode is active? false on error
2426
+ */
2427
+ ezspZllRxOnWhenIdleGetActive(): Promise<boolean>;
2428
+ /**
2429
+ * Informs the ZLL API that application scanning is complete
2430
+ */
2431
+ ezspZllScanningComplete(): Promise<void>;
2432
+ /**
2433
+ * Get the primary ZLL (touchlink) channel mask.
2434
+ * @returns uint32_t The primary ZLL channel mask
2435
+ */
2436
+ ezspGetZllPrimaryChannelMask(): Promise<number>;
2437
+ /**
2438
+ * Get the secondary ZLL (touchlink) channel mask.
2439
+ * @returns uint32_t The secondary ZLL channel mask
2440
+ */
2441
+ ezspGetZllSecondaryChannelMask(): Promise<number>;
2442
+ /**
2443
+ * Set the primary ZLL (touchlink) channel mask
2444
+ * @param uint32_t The primary ZLL channel mask
2445
+ */
2446
+ ezspSetZllPrimaryChannelMask(zllPrimaryChannelMask: number): Promise<void>;
2447
+ /**
2448
+ * Set the secondary ZLL (touchlink) channel mask.
2449
+ * @param uint32_t The secondary ZLL channel mask
2450
+ */
2451
+ ezspSetZllSecondaryChannelMask(zllSecondaryChannelMask: number): Promise<void>;
2452
+ /**
2453
+ * Clear ZLL stack tokens.
2454
+ */
2455
+ ezspZllClearTokens(): Promise<void>;
2456
+ /**
2457
+ * Sets whether to use parent classification when processing beacons during a
2458
+ * join or rejoin. Parent classification considers whether a received beacon
2459
+ * indicates trust center connectivity and long uptime on the network
2460
+ * @param enabled Enable or disable parent classification
2461
+ */
2462
+ ezspSetParentClassificationEnabled(enabled: boolean): Promise<void>;
2463
+ /**
2464
+ * Gets whether to use parent classification when processing beacons during a
2465
+ * join or rejoin. Parent classification considers whether a received beacon
2466
+ * indicates trust center connectivity and long uptime on the network
2467
+ * @returns Enable or disable parent classification
2468
+ */
2469
+ ezspGetParentClassificationEnabled(): Promise<boolean>;
2470
+ /**
2471
+ * sets the device uptime to be long or short
2472
+ * @param hasLongUpTime if the uptime is long or not
2473
+ */
2474
+ ezspSetLongUpTime(hasLongUpTime: boolean): Promise<void>;
2475
+ /**
2476
+ * sets the hub connectivity to be true or false
2477
+ * @param connected if the hub is connected or not
2478
+ */
2479
+ ezspSetHubConnectivity(connected: boolean): Promise<void>;
2480
+ /**
2481
+ * checks if the device uptime is long or short
2482
+ * @returns if the uptime is long or not
2483
+ */
2484
+ ezspIsUpTimeLong(): Promise<boolean>;
2485
+ /**
2486
+ * checks if the hub is connected or not
2487
+ * @returns if the hub is connected or not
2488
+ */
2489
+ ezspIsHubConnected(): Promise<boolean>;
2490
+ /**
2491
+ * Update the GP Proxy table based on a GP pairing.
2492
+ * @param options uint32_t The options field of the GP Pairing command.
2493
+ * @param addr EmberGpAddress * The target GPD.
2494
+ * @param commMode uint8_t The communication mode of the GP Sink.
2495
+ * @param sinkNetworkAddress uint16_t The network address of the GP Sink.
2496
+ * @param sinkGroupId uint16_t The group ID of the GP Sink.
2497
+ * @param assignedAlias uint16_t The alias assigned to the GPD.
2498
+ * @param sinkIeeeAddress uint8_t * The IEEE address of the GP Sink.
2499
+ * @param gpdKey EmberKeyData * The key to use for the target GPD.
2500
+ * @param gpdSecurityFrameCounter uint32_t The GPD security frame counter.
2501
+ * @param forwardingRadius uint8_t The forwarding radius.
2502
+ * @returns Whether a GP Pairing has been created or not.
2503
+ */
2504
+ ezspGpProxyTableProcessGpPairing(options: number, addr: EmberGpAddress, commMode: number, sinkNetworkAddress: number, sinkGroupId: number, assignedAlias: number, sinkIeeeAddress: EmberEUI64, gpdKey: EmberKeyData, gpdSecurityFrameCounter: number, forwardingRadius: number): Promise<boolean>;
2505
+ /**
2506
+ * Adds/removes an entry from the GP Tx Queue.
2507
+ * @param action The action to perform on the GP TX queue (true to add, false to remove).
2508
+ * @param useCca Whether to use ClearChannelAssessment when transmitting the GPDF.
2509
+ * @param addr EmberGpAddress * The Address of the destination GPD.
2510
+ * @param gpdCommandId uint8_t The GPD command ID to send.
2511
+ * @param gpdAsdu uint8_t * The GP command payload.
2512
+ * @param gpepHandle uint8_t The handle to refer to the GPDF.
2513
+ * @param gpTxQueueEntryLifetimeMs uint16_t How long to keep the GPDF in the TX Queue.
2514
+ * @returns An EmberStatus value indicating success or the reason for failure.
2515
+ */
2516
+ ezspDGpSend(action: boolean, useCca: boolean, addr: EmberGpAddress, gpdCommandId: number, gpdAsdu: Buffer, gpepHandle: number, gpTxQueueEntryLifetimeMs: number): Promise<EmberStatus>;
2517
+ /**
2518
+ * Callback
2519
+ * A callback to the GP endpoint to indicate the result of the GPDF
2520
+ * transmission.
2521
+ * @param status An EmberStatus value indicating success or the reason for failure.
2522
+ * @param gpepHandle uint8_t The handle of the GPDF.
2523
+ */
2524
+ ezspDGpSentHandler(status: EmberStatus, gpepHandle: number): void;
2525
+ /**
2526
+ * Callback
2527
+ * A callback invoked by the ZigBee GP stack when a GPDF is received.
2528
+ * @param status The status of the GPDF receive.
2529
+ * @param gpdLink uint8_t The gpdLink value of the received GPDF.
2530
+ * @param sequenceNumber uint8_t The GPDF sequence number.
2531
+ * @param addr EmberGpAddress *The address of the source GPD.
2532
+ * @param gpdfSecurityLevel The security level of the received GPDF.
2533
+ * @param gpdfSecurityKeyType The securityKeyType used to decrypt/authenticate the incoming GPDF.
2534
+ * @param autoCommissioning Whether the incoming GPDF had the auto-commissioning bit set.
2535
+ * @param bidirectionalInfo uint8_t Bidirectional information represented in bitfields,
2536
+ * where bit0 holds the rxAfterTx of incoming gpdf and bit1 holds if tx queue is available for outgoing gpdf.
2537
+ * @param gpdSecurityFrameCounter uint32_t The security frame counter of the incoming GDPF.
2538
+ * @param gpdCommandId uint8_t The gpdCommandId of the incoming GPDF.
2539
+ * @param mic uint32_t The received MIC of the GPDF.
2540
+ * @param proxyTableIndex uint8_tThe proxy table index of the corresponding proxy table entry to the incoming GPDF.
2541
+ * @param gpdCommandPayload uint8_t * The GPD command payload.
2542
+ */
2543
+ ezspGpepIncomingMessageHandler(status: EmberStatus, gpdLink: number, sequenceNumber: number, addr: EmberGpAddress, gpdfSecurityLevel: EmberGpSecurityLevel, gpdfSecurityKeyType: EmberGpKeyType, autoCommissioning: boolean, bidirectionalInfo: number, gpdSecurityFrameCounter: number, gpdCommandId: number, mic: number, proxyTableIndex: number, gpdCommandPayload: Buffer): void;
2544
+ /**
2545
+ * Retrieves the proxy table entry stored at the passed index.
2546
+ * @param proxyIndex uint8_t The index of the requested proxy table entry.
2547
+ * @returns An EmberStatus value indicating success or the reason for failure.
2548
+ * @returns EmberGpProxyTableEntry * An EmberGpProxyTableEntry struct containing a copy of the requested proxy entry.
2549
+ */
2550
+ ezspGpProxyTableGetEntry(proxyIndex: number): Promise<[EmberStatus, entry: EmberGpProxyTableEntry]>;
2551
+ /**
2552
+ * Finds the index of the passed address in the gp table.
2553
+ * @param addr EmberGpAddress * The address to search for
2554
+ * @returns uint8_t The index, or 0xFF for not found
2555
+ */
2556
+ ezspGpProxyTableLookup(addr: EmberGpAddress): Promise<number>;
2557
+ /**
2558
+ * Retrieves the sink table entry stored at the passed index.
2559
+ * @param sinkIndex uint8_t The index of the requested sink table entry.
2560
+ * @returns An EmberStatus value indicating success or the reason for failure.
2561
+ * @returns EmberGpSinkTableEntry * An EmberGpSinkTableEntry struct containing a copy of the requested sink entry.
2562
+ */
2563
+ ezspGpSinkTableGetEntry(sinkIndex: number): Promise<[EmberStatus, entry: EmberGpSinkTableEntry]>;
2564
+ /**
2565
+ * Finds the index of the passed address in the gp table.
2566
+ * @param addr EmberGpAddress *The address to search for.
2567
+ * @returns uint8_t The index, or 0xFF for not found
2568
+ */
2569
+ ezspGpSinkTableLookup(addr: EmberGpAddress): Promise<number>;
2570
+ /**
2571
+ * Retrieves the sink table entry stored at the passed index.
2572
+ * @param sinkIndex uint8_t The index of the requested sink table entry.
2573
+ * @param entry EmberGpSinkTableEntry * An EmberGpSinkTableEntry struct containing a copy of the sink entry to be updated.
2574
+ * @returns An EmberStatus value indicating success or the reason for failure.
2575
+ */
2576
+ ezspGpSinkTableSetEntry(sinkIndex: number, entry: EmberGpSinkTableEntry): Promise<EmberStatus>;
2577
+ /**
2578
+ * Removes the sink table entry stored at the passed index.
2579
+ * @param uint8_t The index of the requested sink table entry.
2580
+ */
2581
+ ezspGpSinkTableRemoveEntry(sinkIndex: number): Promise<void>;
2582
+ /**
2583
+ * Finds or allocates a sink entry
2584
+ * @param addr EmberGpAddress * An EmberGpAddress struct containing a copy of the gpd address to be found.
2585
+ * @returns uint8_t An index of found or allocated sink or 0xFF if failed.
2586
+ */
2587
+ ezspGpSinkTableFindOrAllocateEntry(addr: EmberGpAddress): Promise<number>;
2588
+ /**
2589
+ * Clear the entire sink table
2590
+ */
2591
+ ezspGpSinkTableClearAll(): Promise<void>;
2592
+ /**
2593
+ * Iniitializes Sink Table
2594
+ */
2595
+ ezspGpSinkTableInit(): Promise<void>;
2596
+ /**
2597
+ * Sets security framecounter in the sink table
2598
+ * @param index uint8_t Index to the Sink table
2599
+ * @param sfc uint32_t Security Frame Counter
2600
+ */
2601
+ ezspGpSinkTableSetSecurityFrameCounter(index: number, sfc: number): Promise<void>;
2602
+ /**
2603
+ * Puts the GPS in commissioning mode.
2604
+ * @param uint8_t commissioning options
2605
+ * @param uint16_t gpm address for security.
2606
+ * @param uint16_t gpm address for pairing.
2607
+ * @param uint8_t sink endpoint.
2608
+ * @returns An EmberStatus value indicating success or the reason for failure.
2609
+ */
2610
+ ezspGpSinkCommission(options: number, gpmAddrForSecurity: number, gpmAddrForPairing: number, sinkEndpoint: number): Promise<EmberStatus>;
2611
+ /**
2612
+ * Clears all entries within the translation table.
2613
+ */
2614
+ ezspGpTranslationTableClear(): Promise<void>;
2615
+ /**
2616
+ * Return number of active entries in sink table.
2617
+ * @returns uint8_t Number of active entries in sink table. 0 if error.
2618
+ */
2619
+ ezspGpSinkTableGetNumberOfActiveEntries(): Promise<number>;
2620
+ /**
2621
+ * Gets the total number of tokens.
2622
+ * @returns uint8_t Total number of tokens.
2623
+ */
2624
+ ezspGetTokenCount(): Promise<number>;
2625
+ /**
2626
+ * Gets the token information for a single token at provided index
2627
+ * @param index uint8_t Index of the token in the token table for which information is needed.
2628
+ * @returns An EmberStatus value indicating success or the reason for failure.
2629
+ * @returns EmberTokenInfo * Token information.
2630
+ */
2631
+ ezspGetTokenInfo(index: number): Promise<[EmberStatus, tokenInfo: EmberTokenInfo]>;
2632
+ /**
2633
+ * Gets the token data for a single token with provided key
2634
+ * @param token uint32_t Key of the token in the token table for which data is needed.
2635
+ * @param index uint32_t Index in case of the indexed token.
2636
+ * @returns An EmberStatus value indicating success or the reason for failure.
2637
+ * @returns EmberTokenData * Token Data
2638
+ */
2639
+ ezspGetTokenData(token: number, index: number): Promise<[EmberStatus, tokenData: EmberTokenData]>;
2640
+ /**
2641
+ * Sets the token data for a single token with provided key
2642
+ * @param token uint32_t Key of the token in the token table for which data is to be set.
2643
+ * @param index uint32_t Index in case of the indexed token.
2644
+ * @param EmberTokenData * Token Data
2645
+ * @returns An EmberStatus value indicating success or the reason for failure.
2646
+ */
2647
+ ezspSetTokenData(token: number, index: number, tokenData: EmberTokenData): Promise<EmberStatus>;
2648
+ /**
2649
+ * Reset the node by calling halReboot.
2650
+ */
2651
+ ezspResetNode(): Promise<void>;
2652
+ /**
2653
+ * Run GP security test vectors.
2654
+ * @returns An EmberStatus value indicating success or the reason for failure.
2655
+ */
2656
+ ezspGpSecurityTestVectors(): Promise<EmberStatus>;
2657
+ /**
2658
+ * Factory reset all configured zigbee tokens
2659
+ * @param excludeOutgoingFC Exclude network and APS outgoing frame counter tokens.
2660
+ * @param excludeBootCounter Exclude stack boot counter token.
2661
+ */
2662
+ ezspTokenFactoryReset(excludeOutgoingFC: boolean, excludeBootCounter: boolean): Promise<void>;
2663
+ }
2664
+ //# sourceMappingURL=ezsp.d.ts.map