@willieee802/zigbee-herdsman 0.19.21 → 0.36.0

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