zigbee-herdsman 4.1.2 → 4.2.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 (42) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/CHANGELOG.md +13 -0
  3. package/dist/adapter/deconz/adapter/deconzAdapter.d.ts +5 -2
  4. package/dist/adapter/deconz/adapter/deconzAdapter.d.ts.map +1 -1
  5. package/dist/adapter/deconz/adapter/deconzAdapter.js +374 -328
  6. package/dist/adapter/deconz/adapter/deconzAdapter.js.map +1 -1
  7. package/dist/adapter/deconz/driver/constants.d.ts +121 -63
  8. package/dist/adapter/deconz/driver/constants.d.ts.map +1 -1
  9. package/dist/adapter/deconz/driver/constants.js +122 -40
  10. package/dist/adapter/deconz/driver/constants.js.map +1 -1
  11. package/dist/adapter/deconz/driver/driver.d.ts +66 -38
  12. package/dist/adapter/deconz/driver/driver.d.ts.map +1 -1
  13. package/dist/adapter/deconz/driver/driver.js +982 -434
  14. package/dist/adapter/deconz/driver/driver.js.map +1 -1
  15. package/dist/adapter/deconz/driver/frameParser.d.ts.map +1 -1
  16. package/dist/adapter/deconz/driver/frameParser.js +333 -266
  17. package/dist/adapter/deconz/driver/frameParser.js.map +1 -1
  18. package/dist/adapter/ember/enums.d.ts +21 -370
  19. package/dist/adapter/ember/enums.d.ts.map +1 -1
  20. package/dist/adapter/ember/enums.js +20 -383
  21. package/dist/adapter/ember/enums.js.map +1 -1
  22. package/dist/adapter/ember/ezsp/consts.d.ts +1 -1
  23. package/dist/adapter/ember/ezsp/consts.js +1 -1
  24. package/dist/adapter/ember/ezsp/enums.d.ts +29 -3
  25. package/dist/adapter/ember/ezsp/enums.d.ts.map +1 -1
  26. package/dist/adapter/ember/ezsp/enums.js +29 -2
  27. package/dist/adapter/ember/ezsp/enums.js.map +1 -1
  28. package/dist/adapter/ember/ezsp/ezsp.d.ts +29 -4
  29. package/dist/adapter/ember/ezsp/ezsp.d.ts.map +1 -1
  30. package/dist/adapter/ember/ezsp/ezsp.js +66 -3
  31. package/dist/adapter/ember/ezsp/ezsp.js.map +1 -1
  32. package/dist/adapter/ember/uart/ash.js +1 -1
  33. package/package.json +2 -2
  34. package/src/adapter/deconz/adapter/deconzAdapter.ts +444 -367
  35. package/src/adapter/deconz/driver/constants.ts +147 -82
  36. package/src/adapter/deconz/driver/driver.ts +1091 -501
  37. package/src/adapter/deconz/driver/frameParser.ts +351 -272
  38. package/src/adapter/ember/enums.ts +20 -397
  39. package/src/adapter/ember/ezsp/consts.ts +1 -1
  40. package/src/adapter/ember/ezsp/enums.ts +31 -4
  41. package/src/adapter/ember/ezsp/ezsp.ts +79 -3
  42. package/src/adapter/ember/uart/ash.ts +1 -1
@@ -250,403 +250,6 @@ export enum SLStatus {
250
250
  /** The initialization was aborted as the NVM3 instance was already opened with other parameters */
251
251
  NVM3_OPENED_WITH_OTHER_PARAMETERS = 0x005d,
252
252
 
253
- // -----------------------------------------------------------------------------
254
- // Bluetooth status codes
255
-
256
- /** Bonding procedure can't be started because device has no space left for bond. */
257
- BT_OUT_OF_BONDS = 0x0402,
258
- /** Unspecified error */
259
- BT_UNSPECIFIED = 0x0403,
260
- /** Hardware failure */
261
- BT_HARDWARE = 0x0404,
262
- /** The bonding does not exist. */
263
- BT_NO_BONDING = 0x0406,
264
- /** Error using crypto functions */
265
- BT_CRYPTO = 0x0407,
266
- /** Data was corrupted. */
267
- BT_DATA_CORRUPTED = 0x0408,
268
- /** Invalid periodic advertising sync handle */
269
- BT_INVALID_SYNC_HANDLE = 0x040a,
270
- /** Bluetooth cannot be used on this hardware */
271
- BT_INVALID_MODULE_ACTION = 0x040b,
272
- /** Error received from radio */
273
- BT_RADIO = 0x040c,
274
- /** Returned when remote disconnects the connection-oriented channel by sending disconnection request. */
275
- BT_L2CAP_REMOTE_DISCONNECTED = 0x040d,
276
- /** Returned when local host disconnect the connection-oriented channel by sending disconnection request. */
277
- BT_L2CAP_LOCAL_DISCONNECTED = 0x040e,
278
- /** Returned when local host did not find a connection-oriented channel with given destination CID. */
279
- BT_L2CAP_CID_NOT_EXIST = 0x040f,
280
- /** Returned when connection-oriented channel disconnected due to LE connection is dropped. */
281
- BT_L2CAP_LE_DISCONNECTED = 0x0410,
282
- /** Returned when connection-oriented channel disconnected due to remote end send data even without credit. */
283
- BT_L2CAP_FLOW_CONTROL_VIOLATED = 0x0412,
284
- /** Returned when connection-oriented channel disconnected due to remote end send flow control credits exceed 65535. */
285
- BT_L2CAP_FLOW_CONTROL_CREDIT_OVERFLOWED = 0x0413,
286
- /** Returned when connection-oriented channel has run out of flow control credit and local application still trying to send data. */
287
- BT_L2CAP_NO_FLOW_CONTROL_CREDIT = 0x0414,
288
- /** Returned when connection-oriented channel has not received connection response message within maximum timeout. */
289
- BT_L2CAP_CONNECTION_REQUEST_TIMEOUT = 0x0415,
290
- /** Returned when local host received a connection-oriented channel connection response with an invalid destination CID. */
291
- BT_L2CAP_INVALID_CID = 0x0416,
292
- /** Returned when local host application tries to send a command which is not suitable for L2CAP channel's current state. */
293
- BT_L2CAP_WRONG_STATE = 0x0417,
294
- /** Flash reserved for PS store is full */
295
- BT_PS_STORE_FULL = 0x041b,
296
- /** PS key not found */
297
- BT_PS_KEY_NOT_FOUND = 0x041c,
298
- /** Mismatched or insufficient security level */
299
- BT_APPLICATION_MISMATCHED_OR_INSUFFICIENT_SECURITY = 0x041d,
300
- /** Encryption/decryption operation failed. */
301
- BT_APPLICATION_ENCRYPTION_DECRYPTION_ERROR = 0x041e,
302
-
303
- // -----------------------------------------------------------------------------
304
- // Bluetooth controller status codes
305
-
306
- /** Connection does not exist, or connection open request was cancelled. */
307
- BT_CTRL_UNKNOWN_CONNECTION_IDENTIFIER = 0x1002,
308
- /**
309
- * Pairing or authentication failed due to incorrect results in the pairing or authentication procedure.
310
- * This could be due to an incorrect PIN or Link Key
311
- */
312
- BT_CTRL_AUTHENTICATION_FAILURE = 0x1005,
313
- /** Pairing failed because of missing PIN, or authentication failed because of missing Key */
314
- BT_CTRL_PIN_OR_KEY_MISSING = 0x1006,
315
- /** Controller is out of memory. */
316
- BT_CTRL_MEMORY_CAPACITY_EXCEEDED = 0x1007,
317
- /** Link supervision timeout has expired. */
318
- BT_CTRL_CONNECTION_TIMEOUT = 0x1008,
319
- /** Controller is at limit of connections it can support. */
320
- BT_CTRL_CONNECTION_LIMIT_EXCEEDED = 0x1009,
321
- /**
322
- * The Synchronous Connection Limit to a Device Exceeded error code indicates that the Controller has reached
323
- * the limit to the number of synchronous connections that can be achieved to a device.
324
- */
325
- BT_CTRL_SYNCHRONOUS_CONNECTION_LIMIT_EXCEEDED = 0x100a,
326
- /**
327
- * The ACL Connection Already Exists error code indicates that an attempt to create a new ACL Connection
328
- * to a device when there is already a connection to this device.
329
- */
330
- BT_CTRL_ACL_CONNECTION_ALREADY_EXISTS = 0x100b,
331
- /** Command requested cannot be executed because the Controller is in a state where it cannot process this command at this time. */
332
- BT_CTRL_COMMAND_DISALLOWED = 0x100c,
333
- /** The Connection Rejected Due To Limited Resources error code indicates that an incoming connection was rejected due to limited resources. */
334
- BT_CTRL_CONNECTION_REJECTED_DUE_TO_LIMITED_RESOURCES = 0x100d,
335
- /**
336
- * The Connection Rejected Due To Security Reasons error code indicates that a connection was rejected due
337
- * to security requirements not being fulfilled, like authentication or pairing.
338
- */
339
- BT_CTRL_CONNECTION_REJECTED_DUE_TO_SECURITY_REASONS = 0x100e,
340
- /**
341
- * The Connection was rejected because this device does not accept the BD_ADDR.
342
- * This may be because the device will only accept connections from specific BD_ADDRs.
343
- */
344
- BT_CTRL_CONNECTION_REJECTED_DUE_TO_UNACCEPTABLE_BD_ADDR = 0x100f,
345
- /** The Connection Accept Timeout has been exceeded for this connection attempt. */
346
- BT_CTRL_CONNECTION_ACCEPT_TIMEOUT_EXCEEDED = 0x1010,
347
- /** A feature or parameter value in the HCI command is not supported. */
348
- BT_CTRL_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE = 0x1011,
349
- /** Command contained invalid parameters. */
350
- BT_CTRL_INVALID_COMMAND_PARAMETERS = 0x1012,
351
- /** User on the remote device terminated the connection. */
352
- BT_CTRL_REMOTE_USER_TERMINATED = 0x1013,
353
- /** The remote device terminated the connection because of low resources */
354
- BT_CTRL_REMOTE_DEVICE_TERMINATED_CONNECTION_DUE_TO_LOW_RESOURCES = 0x1014,
355
- /** Remote Device Terminated Connection due to Power Off */
356
- BT_CTRL_REMOTE_POWERING_OFF = 0x1015,
357
- /** Local device terminated the connection. */
358
- BT_CTRL_CONNECTION_TERMINATED_BY_LOCAL_HOST = 0x1016,
359
- /**
360
- * The Controller is disallowing an authentication or pairing procedure because too little time has elapsed
361
- * since the last authentication or pairing attempt failed.
362
- */
363
- BT_CTRL_REPEATED_ATTEMPTS = 0x1017,
364
- /**
365
- * The device does not allow pairing. This can be for example, when a device only allows pairing during
366
- * a certain time window after some user input allows pairing
367
- */
368
- BT_CTRL_PAIRING_NOT_ALLOWED = 0x1018,
369
- /** The remote device does not support the feature associated with the issued command. */
370
- BT_CTRL_UNSUPPORTED_REMOTE_FEATURE = 0x101a,
371
- /** No other error code specified is appropriate to use. */
372
- BT_CTRL_UNSPECIFIED_ERROR = 0x101f,
373
- /** Connection terminated due to link-layer procedure timeout. */
374
- BT_CTRL_LL_RESPONSE_TIMEOUT = 0x1022,
375
- /** LL procedure has collided with the same transaction or procedure that is already in progress. */
376
- BT_CTRL_LL_PROCEDURE_COLLISION = 0x1023,
377
- /** The requested encryption mode is not acceptable at this time. */
378
- BT_CTRL_ENCRYPTION_MODE_NOT_ACCEPTABLE = 0x1025,
379
- /** Link key cannot be changed because a fixed unit key is being used. */
380
- BT_CTRL_LINK_KEY_CANNOT_BE_CHANGED = 0x1026,
381
- /** LMP PDU or LL PDU that includes an instant cannot be performed because the instant when this would have occurred has passed. */
382
- BT_CTRL_INSTANT_PASSED = 0x1028,
383
- /** It was not possible to pair as a unit key was requested and it is not supported. */
384
- BT_CTRL_PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED = 0x1029,
385
- /** LMP transaction was started that collides with an ongoing transaction. */
386
- BT_CTRL_DIFFERENT_TRANSACTION_COLLISION = 0x102a,
387
- /** The Controller cannot perform channel assessment because it is not supported. */
388
- BT_CTRL_CHANNEL_ASSESSMENT_NOT_SUPPORTED = 0x102e,
389
- /** The HCI command or LMP PDU sent is only possible on an encrypted link. */
390
- BT_CTRL_INSUFFICIENT_SECURITY = 0x102f,
391
- /** A parameter value requested is outside the mandatory range of parameters for the given HCI command or LMP PDU. */
392
- BT_CTRL_PARAMETER_OUT_OF_MANDATORY_RANGE = 0x1030,
393
- /**
394
- * The IO capabilities request or response was rejected because the sending Host does not support
395
- * Secure Simple Pairing even though the receiving Link Manager does.
396
- */
397
- BT_CTRL_SIMPLE_PAIRING_NOT_SUPPORTED_BY_HOST = 0x1037,
398
- /**
399
- * The Host is busy with another pairing operation and unable to support the requested pairing.
400
- * The receiving device should retry pairing again later.
401
- */
402
- BT_CTRL_HOST_BUSY_PAIRING = 0x1038,
403
- /** The Controller could not calculate an appropriate value for the Channel selection operation. */
404
- BT_CTRL_CONNECTION_REJECTED_DUE_TO_NO_SUITABLE_CHANNEL_FOUND = 0x1039,
405
- /** Operation was rejected because the controller is busy and unable to process the request. */
406
- BT_CTRL_CONTROLLER_BUSY = 0x103a,
407
- /** Remote device terminated the connection because of an unacceptable connection interval. */
408
- BT_CTRL_UNACCEPTABLE_CONNECTION_INTERVAL = 0x103b,
409
- /** Advertising for a fixed duration completed or, for directed advertising, that advertising completed without a connection being created. */
410
- BT_CTRL_ADVERTISING_TIMEOUT = 0x103c,
411
- /** Connection was terminated because the Message Integrity Check (MIC) failed on a received packet. */
412
- BT_CTRL_CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE = 0x103d,
413
- /** LL initiated a connection but the connection has failed to be established. Controller did not receive any packets from remote end. */
414
- BT_CTRL_CONNECTION_FAILED_TO_BE_ESTABLISHED = 0x103e,
415
- /** The MAC of the 802.11 AMP was requested to connect to a peer, but the connection failed. */
416
- BT_CTRL_MAC_CONNECTION_FAILED = 0x103f,
417
- /**
418
- * The master, at this time, is unable to make a coarse adjustment to the piconet clock, using the supplied parameters.
419
- * Instead the master will attempt to move the clock using clock dragging.
420
- */
421
- BT_CTRL_COARSE_CLOCK_ADJUSTMENT_REJECTED_BUT_WILL_TRY_TO_ADJUST_USING_CLOCK_DRAGGING = 0x1040,
422
- /** A command was sent from the Host that should identify an Advertising or Sync handle, but the Advertising or Sync handle does not exist. */
423
- BT_CTRL_UNKNOWN_ADVERTISING_IDENTIFIER = 0x1042,
424
- /** Number of operations requested has been reached and has indicated the completion of the activity (e.g., advertising or scanning). */
425
- BT_CTRL_LIMIT_REACHED = 0x1043,
426
- /** A request to the Controller issued by the Host and still pending was successfully canceled. */
427
- BT_CTRL_OPERATION_CANCELLED_BY_HOST = 0x1044,
428
- /** An attempt was made to send or receive a packet that exceeds the maximum allowed packet l */
429
- BT_CTRL_PACKET_TOO_LONG = 0x1045,
430
-
431
- // -----------------------------------------------------------------------------
432
- // Bluetooth attribute status codes
433
-
434
- /** The attribute handle given was not valid on this server */
435
- BT_ATT_INVALID_HANDLE = 0x1101,
436
- /** The attribute cannot be read */
437
- BT_ATT_READ_NOT_PERMITTED = 0x1102,
438
- /** The attribute cannot be written */
439
- BT_ATT_WRITE_NOT_PERMITTED = 0x1103,
440
- /** The attribute PDU was invalid */
441
- BT_ATT_INVALID_PDU = 0x1104,
442
- /** The attribute requires authentication before it can be read or written. */
443
- BT_ATT_INSUFFICIENT_AUTHENTICATION = 0x1105,
444
- /** Attribute Server does not support the request received from the client. */
445
- BT_ATT_REQUEST_NOT_SUPPORTED = 0x1106,
446
- /** Offset specified was past the end of the attribute */
447
- BT_ATT_INVALID_OFFSET = 0x1107,
448
- /** The attribute requires authorization before it can be read or written. */
449
- BT_ATT_INSUFFICIENT_AUTHORIZATION = 0x1108,
450
- /** Too many prepare writes have been queued */
451
- BT_ATT_PREPARE_QUEUE_FULL = 0x1109,
452
- /** No attribute found within the given attribute handle range. */
453
- BT_ATT_ATT_NOT_FOUND = 0x110a,
454
- /** The attribute cannot be read or written using the Read Blob Request */
455
- BT_ATT_ATT_NOT_LONG = 0x110b,
456
- /** The Encryption Key Size used for encrypting this link is insufficient. */
457
- BT_ATT_INSUFFICIENT_ENC_KEY_SIZE = 0x110c,
458
- /** The attribute value length is invalid for the operation */
459
- BT_ATT_INVALID_ATT_LENGTH = 0x110d,
460
- /** The attribute request that was requested has encountered an error that was unlikely, and therefore could not be completed as requested. */
461
- BT_ATT_UNLIKELY_ERROR = 0x110e,
462
- /** The attribute requires encryption before it can be read or written. */
463
- BT_ATT_INSUFFICIENT_ENCRYPTION = 0x110f,
464
- /** The attribute type is not a supported grouping attribute as defined by a higher layer specification. */
465
- BT_ATT_UNSUPPORTED_GROUP_TYPE = 0x1110,
466
- /** Insufficient Resources to complete the request */
467
- BT_ATT_INSUFFICIENT_RESOURCES = 0x1111,
468
- /** The server requests the client to rediscover the database. */
469
- BT_ATT_OUT_OF_SYNC = 0x1112,
470
- /** The attribute parameter value was not allowed. */
471
- BT_ATT_VALUE_NOT_ALLOWED = 0x1113,
472
- /** When this is returned in a BGAPI response, the application tried to read or write the value of a user attribute from the GATT database. */
473
- BT_ATT_APPLICATION = 0x1180,
474
- /** The requested write operation cannot be fulfilled for reasons other than permissions. */
475
- BT_ATT_WRITE_REQUEST_REJECTED = 0x11fc,
476
- /** The Client Characteristic Configuration descriptor is not configured according to the requirements of the profile or service. */
477
- BT_ATT_CLIENT_CHARACTERISTIC_CONFIGURATION_DESCRIPTOR_IMPROPERLY_CONFIGURED = 0x11fd,
478
- /** The profile or service request cannot be serviced because an operation that has been previously triggered is still in progress. */
479
- BT_ATT_PROCEDURE_ALREADY_IN_PROGRESS = 0x11fe,
480
- /** The attribute value is out of range as defined by a profile or service specification. */
481
- BT_ATT_OUT_OF_RANGE = 0x11ff,
482
-
483
- // -----------------------------------------------------------------------------
484
- // Bluetooth Security Manager Protocol status codes
485
-
486
- /** The user input of passkey failed, for example, the user cancelled the operation */
487
- BT_SMP_PASSKEY_ENTRY_FAILED = 0x1201,
488
- /** Out of Band data is not available for authentication */
489
- BT_SMP_OOB_NOT_AVAILABLE = 0x1202,
490
- /** The pairing procedure cannot be performed as authentication requirements cannot be met due to IO capabilities of one or both devices */
491
- BT_SMP_AUTHENTICATION_REQUIREMENTS = 0x1203,
492
- /** The confirm value does not match the calculated compare value */
493
- BT_SMP_CONFIRM_VALUE_FAILED = 0x1204,
494
- /** Pairing is not supported by the device */
495
- BT_SMP_PAIRING_NOT_SUPPORTED = 0x1205,
496
- /** The resultant encryption key size is insufficient for the security requirements of this device */
497
- BT_SMP_ENCRYPTION_KEY_SIZE = 0x1206,
498
- /** The SMP command received is not supported on this device */
499
- BT_SMP_COMMAND_NOT_SUPPORTED = 0x1207,
500
- /** Pairing failed due to an unspecified reason */
501
- BT_SMP_UNSPECIFIED_REASON = 0x1208,
502
- /** Pairing or authentication procedure is disallowed because too little time has elapsed since last pairing request or security request */
503
- BT_SMP_REPEATED_ATTEMPTS = 0x1209,
504
- /** The Invalid Parameters error code indicates: the command length is invalid or a parameter is outside of the specified range. */
505
- BT_SMP_INVALID_PARAMETERS = 0x120a,
506
- /** Indicates to the remote device that the DHKey Check value received doesn't match the one calculated by the local device. */
507
- BT_SMP_DHKEY_CHECK_FAILED = 0x120b,
508
- /** Indicates that the confirm values in the numeric comparison protocol do not match. */
509
- BT_SMP_NUMERIC_COMPARISON_FAILED = 0x120c,
510
- /** Indicates that the pairing over the LE transport failed due to a Pairing Request sent over the BR/EDR transport in process. */
511
- BT_SMP_BREDR_PAIRING_IN_PROGRESS = 0x120d,
512
- /** Indicates that the BR/EDR Link Key generated on the BR/EDR transport cannot be used to derive and distribute keys for the LE transport. */
513
- BT_SMP_CROSS_TRANSPORT_KEY_DERIVATION_GENERATION_NOT_ALLOWED = 0x120e,
514
- /** Indicates that the device chose not to accept a distributed key. */
515
- BT_SMP_KEY_REJECTED = 0x120f,
516
-
517
- // -----------------------------------------------------------------------------
518
- // Bluetooth Mesh status codes
519
-
520
- /** Returned when trying to add a key or some other unique resource with an ID which already exists */
521
- BT_MESH_ALREADY_EXISTS = 0x0501,
522
- /** Returned when trying to manipulate a key or some other resource with an ID which does not exist */
523
- BT_MESH_DOES_NOT_EXIST = 0x0502,
524
- /**
525
- * Returned when an operation cannot be executed because a pre-configured limit for keys, key bindings,
526
- * elements, models, virtual addresses, provisioned devices, or provisioning sessions is reached
527
- */
528
- BT_MESH_LIMIT_REACHED = 0x0503,
529
- /** Returned when trying to use a reserved address or add a "pre-provisioned" device using an address already used by some other device */
530
- BT_MESH_INVALID_ADDRESS = 0x0504,
531
- /** In a BGAPI response, the user supplied malformed data; in a BGAPI event, the remote end responded with malformed or unrecognized data */
532
- BT_MESH_MALFORMED_DATA = 0x0505,
533
- /** An attempt was made to initialize a subsystem that was already initialized. */
534
- BT_MESH_ALREADY_INITIALIZED = 0x0506,
535
- /** An attempt was made to use a subsystem that wasn't initialized yet. Call the subsystem's init function first. */
536
- BT_MESH_NOT_INITIALIZED = 0x0507,
537
- /** Returned when trying to establish a friendship as a Low Power Node, but no acceptable friend offer message was received. */
538
- BT_MESH_NO_FRIEND_OFFER = 0x0508,
539
- /** Provisioning link was unexpectedly closed before provisioning was complete. */
540
- BT_MESH_PROV_LINK_CLOSED = 0x0509,
541
- /**An unrecognized provisioning PDU was received. */
542
- BT_MESH_PROV_INVALID_PDU = 0x050a,
543
- /**A provisioning PDU with wrong length or containing field values that are out of bounds was received. */
544
- BT_MESH_PROV_INVALID_PDU_FORMAT = 0x050b,
545
- /**An unexpected (out of sequence) provisioning PDU was received. */
546
- BT_MESH_PROV_UNEXPECTED_PDU = 0x050c,
547
- /**The computed confirmation value did not match the expected value. */
548
- BT_MESH_PROV_CONFIRMATION_FAILED = 0x050d,
549
- /**Provisioning could not be continued due to insufficient resources. */
550
- BT_MESH_PROV_OUT_OF_RESOURCES = 0x050e,
551
- /**The provisioning data block could not be decrypted. */
552
- BT_MESH_PROV_DECRYPTION_FAILED = 0x050f,
553
- /**An unexpected error happened during provisioning. */
554
- BT_MESH_PROV_UNEXPECTED_ERROR = 0x0510,
555
- /**Device could not assign unicast addresses to all of its elements. */
556
- BT_MESH_PROV_CANNOT_ASSIGN_ADDR = 0x0511,
557
- /**Returned when trying to reuse an address of a previously deleted device before an IV Index Update has been executed. */
558
- BT_MESH_ADDRESS_TEMPORARILY_UNAVAILABLE = 0x0512,
559
- /**Returned when trying to assign an address that is used by one of the devices in the Device Database, or by the Provisioner itself. */
560
- BT_MESH_ADDRESS_ALREADY_USED = 0x0513,
561
- /**Application key or publish address are not set */
562
- BT_MESH_PUBLISH_NOT_CONFIGURED = 0x0514,
563
- /**Application key is not bound to a model */
564
- BT_MESH_APP_KEY_NOT_BOUND = 0x0515,
565
-
566
- // -----------------------------------------------------------------------------
567
- // Bluetooth Mesh foundation status codes
568
-
569
- /** Returned when address in request was not valid */
570
- BT_MESH_FOUNDATION_INVALID_ADDRESS = 0x1301,
571
- /** Returned when model identified is not found for a given element */
572
- BT_MESH_FOUNDATION_INVALID_MODEL = 0x1302,
573
- /** Returned when the key identified by AppKeyIndex is not stored in the node */
574
- BT_MESH_FOUNDATION_INVALID_APP_KEY = 0x1303,
575
- /** Returned when the key identified by NetKeyIndex is not stored in the node */
576
- BT_MESH_FOUNDATION_INVALID_NET_KEY = 0x1304,
577
- /** Returned when The node cannot serve the request due to insufficient resources */
578
- BT_MESH_FOUNDATION_INSUFFICIENT_RESOURCES = 0x1305,
579
- /** Returned when the key identified is already stored in the node and the new NetKey value is different */
580
- BT_MESH_FOUNDATION_KEY_INDEX_EXISTS = 0x1306,
581
- /** Returned when the model does not support the publish mechanism */
582
- BT_MESH_FOUNDATION_INVALID_PUBLISH_PARAMS = 0x1307,
583
- /** Returned when the model does not support the subscribe mechanism */
584
- BT_MESH_FOUNDATION_NOT_SUBSCRIBE_MODEL = 0x1308,
585
- /** Returned when storing of the requested parameters failed */
586
- BT_MESH_FOUNDATION_STORAGE_FAILURE = 0x1309,
587
- /**Returned when requested setting is not supported */
588
- BT_MESH_FOUNDATION_NOT_SUPPORTED = 0x130a,
589
- /**Returned when the requested update operation cannot be performed due to general constraints */
590
- BT_MESH_FOUNDATION_CANNOT_UPDATE = 0x130b,
591
- /**Returned when the requested delete operation cannot be performed due to general constraints */
592
- BT_MESH_FOUNDATION_CANNOT_REMOVE = 0x130c,
593
- /**Returned when the requested bind operation cannot be performed due to general constraints */
594
- BT_MESH_FOUNDATION_CANNOT_BIND = 0x130d,
595
- /**Returned when The node cannot start advertising with Node Identity or Proxy since the maximum number of parallel advertising is reached */
596
- BT_MESH_FOUNDATION_TEMPORARILY_UNABLE = 0x130e,
597
- /**Returned when the requested state cannot be set */
598
- BT_MESH_FOUNDATION_CANNOT_SET = 0x130f,
599
- /**Returned when an unspecified error took place */
600
- BT_MESH_FOUNDATION_UNSPECIFIED = 0x1310,
601
- /**Returned when the NetKeyIndex and AppKeyIndex combination is not valid for a Config AppKey Update */
602
- BT_MESH_FOUNDATION_INVALID_BINDING = 0x1311,
603
-
604
- // -----------------------------------------------------------------------------
605
- // Wi-Fi Errors
606
-
607
- /** Invalid firmware keyset */
608
- WIFI_INVALID_KEY = 0x0b01,
609
- /** The firmware download took too long */
610
- WIFI_FIRMWARE_DOWNLOAD_TIMEOUT = 0x0b02,
611
- /** Unknown request ID or wrong interface ID used */
612
- WIFI_UNSUPPORTED_MESSAGE_ID = 0x0b03,
613
- /** The request is successful but some parameters have been ignored */
614
- WIFI_WARNING = 0x0b04,
615
- /** No Packets waiting to be received */
616
- WIFI_NO_PACKET_TO_RECEIVE = 0x0b05,
617
- /** The sleep mode is granted */
618
- WIFI_SLEEP_GRANTED = 0x0b08,
619
- /** The WFx does not go back to sleep */
620
- WIFI_SLEEP_NOT_GRANTED = 0x0b09,
621
- /** The SecureLink MAC key was not found */
622
- WIFI_SECURE_LINK_MAC_KEY_ERROR = 0x0b10,
623
- /** The SecureLink MAC key is already installed in OTP */
624
- WIFI_SECURE_LINK_MAC_KEY_ALREADY_BURNED = 0x0b11,
625
- /** The SecureLink MAC key cannot be installed in RAM */
626
- WIFI_SECURE_LINK_RAM_MODE_NOT_ALLOWED = 0x0b12,
627
- /** The SecureLink MAC key installation failed */
628
- WIFI_SECURE_LINK_FAILED_UNKNOWN_MODE = 0x0b13,
629
- /** SecureLink key (re)negotiation failed */
630
- WIFI_SECURE_LINK_EXCHANGE_FAILED = 0x0b14,
631
- /** The device is in an inappropriate state to perform the request */
632
- WIFI_WRONG_STATE = 0x0b18,
633
- /** The request failed due to regulatory limitations */
634
- WIFI_CHANNEL_NOT_ALLOWED = 0x0b19,
635
- /** The connection request failed because no suitable AP was found */
636
- WIFI_NO_MATCHING_AP = 0x0b1a,
637
- /** The connection request was aborted by host */
638
- WIFI_CONNECTION_ABORTED = 0x0b1b,
639
- /** The connection request failed because of a timeout */
640
- WIFI_CONNECTION_TIMEOUT = 0x0b1c,
641
- /** The connection request failed because the AP rejected the device */
642
- WIFI_CONNECTION_REJECTED_BY_AP = 0x0b1d,
643
- /** The connection request failed because the WPA handshake did not complete successfully */
644
- WIFI_CONNECTION_AUTH_FAILURE = 0x0b1e,
645
- /** The request failed because the retry limit was exceeded */
646
- WIFI_RETRY_EXCEEDED = 0x0b1f,
647
- /** The request failed because the MSDU life time was exceeded */
648
- WIFI_TX_LIFETIME_EXCEEDED = 0x0b20,
649
-
650
253
  // -----------------------------------------------------------------------------
651
254
  // MVP Driver and MVP Math status codes
652
255
 
@@ -749,6 +352,26 @@ export enum SLStatus {
749
352
  ZIGBEE_PRECONFIGURED_KEY_REQUIRED = 0x0c1d,
750
353
  /** A Zigbee EZSP error has occured. Track the origin and corresponding EzspStatus for more info. */
751
354
  ZIGBEE_EZSP_ERROR = 0x0c1e,
355
+ /** Node ID discovery failed. */
356
+ ZIGBEE_ID_DISCOVERY_FAILED = 0x0c1f,
357
+ /** Message was sent but no APS ACK received. */
358
+ ZIGBEE_NO_APS_ACK = 0x0c20,
359
+ /** APS message was canceled. */
360
+ ZIGBEE_APS_MESSAGE_CANCELED = 0x0c21,
361
+ /** Node ID discovery not enabled. */
362
+ ZIGBEE_ID_DISCOVERY_NOT_ENABLED = 0x0c22,
363
+ /** Message was not sent, Node ID discovery is underway. */
364
+ ZIGBEE_ID_DISCOVERY_UNDERWAY = 0x0c23,
365
+ /** The message was not sent because a route discovery is currently underway. There is no route to the target until the route discovery completes. */
366
+ ZIGBEE_SEND_UNICAST_ROUTE_DISCOVERY_UNDERWAY = 0x0c24,
367
+ /** Radius is 0 or message has been dropped because route request failed or failed to submit message to tx queue. */
368
+ ZIGBEE_SEND_UNICAST_FAILURE = 0x0c25,
369
+ /** No active route to the destination. */
370
+ ZIGBEE_SEND_UNICAST_NO_ROUTE = 0x0c26,
371
+ /** Broadcast message timeout while waiting for sleepy children to poll. */
372
+ ZIGBEE_BROADCAST_TO_SLEEPY_CHILDREN_TIMEOUT = 0x0c27,
373
+ /** Expected a neighbor to relay the message, but none did. */
374
+ ZIGBEE_BROADCAST_RELAY_FAILED = 0x0c28,
752
375
  }
753
376
 
754
377
  /** Status values used by EZSP. */
@@ -3,7 +3,7 @@
3
3
 
4
4
  export const EZSP_MIN_PROTOCOL_VERSION = 0x0d;
5
5
  /** Latest EZSP protocol version */
6
- export const EZSP_PROTOCOL_VERSION = 0x10;
6
+ export const EZSP_PROTOCOL_VERSION = 0x11;
7
7
 
8
8
  /** EZSP max length + Frame Control extra byte + Frame ID extra byte */
9
9
  export const EZSP_MAX_FRAME_LENGTH = 218 + 1 + 1;
@@ -44,6 +44,8 @@ export enum EzspFrameID {
44
44
  READ_AND_CLEAR_COUNTERS = 0x0065,
45
45
  READ_COUNTERS = 0x00f1,
46
46
  COUNTER_ROLLOVER_HANDLER = 0x00f2,
47
+ /** v17+ */
48
+ MUX_INVALID_RX_HANDLER = 0x0062,
47
49
  DELAY_TEST = 0x009d,
48
50
  GET_LIBRARY_STATUS = 0x0001,
49
51
  GET_XNCP_INFO = 0x0013,
@@ -398,6 +400,10 @@ export enum EzspFrameID {
398
400
  GPEP_INCOMING_MESSAGE_HANDLER = 0x00c5,
399
401
  GP_PROXY_TABLE_GET_ENTRY = 0x00c8,
400
402
  GP_PROXY_TABLE_LOOKUP = 0x00c0,
403
+ /** v17+ */
404
+ GP_PROXY_TABLE_REMOVE_ENTRY = 0x005d,
405
+ /** v17+ */
406
+ GP_CLEAR_PROXY_TABLE = 0x005f,
401
407
  GP_SINK_TABLE_GET_ENTRY = 0x00dd,
402
408
  GP_SINK_TABLE_LOOKUP = 0x00de,
403
409
  GP_SINK_TABLE_SET_ENTRY = 0x00df,
@@ -973,25 +979,32 @@ export enum EzspValueId {
973
979
  * Policies for allowing/disallowing rejoins.
974
980
  */
975
981
  REJOIN_MODE = 0x47,
982
+ /**
983
+ * v17+
984
+ * Controls whether devices must use an install code when joining.
985
+ */
986
+ JOIN_USE_INSTALL_CODE_ENABLE = 0x48,
976
987
  }
977
988
 
978
989
  /**
979
990
  * Identifies a value based on specified characteristics.
980
991
  * Each set of characteristics is unique to that value and is specified during the call to get the extended value.
981
992
  *
982
- * uint16_t
993
+ * uint8_t
983
994
  */
984
995
  export enum EzspExtendedValueId {
985
996
  /** The flags field associated with the specified endpoint. Value is uint16_t */
986
- ENDPOINT_FLAGS = 0x0000,
997
+ ENDPOINT_FLAGS = 0x00,
987
998
  /**
988
999
  * This is the reason for the node to leave the network as well as the device that told it to leave.
989
1000
  * The leave reason is the 1st byte of the value while the node ID is the 2nd and 3rd byte.
990
1001
  * If the leave was caused due to an API call rather than an over the air message, the node ID will be EMBER_UNKNOWN_NODE_ID (0xFFFD).
991
1002
  */
992
- LAST_LEAVE_REASON = 0x0001,
1003
+ LAST_LEAVE_REASON = 0x01,
993
1004
  /** This number of bytes of overhead required in the network frame for source routing to a particular destination. */
994
- GET_SOURCE_ROUTE_OVERHEAD = 0x0002,
1005
+ GET_SOURCE_ROUTE_OVERHEAD = 0x02,
1006
+ /** v17+ These values are current or boot-time metrics gathered by the memory manager/buffer manager. */
1007
+ MEMORY_USAGE_DATA = 0x03,
995
1008
  }
996
1009
 
997
1010
  /** Flags associated with the endpoint data configured on the NCP. */
@@ -1085,3 +1098,17 @@ export enum EzspSleepMode {
1085
1098
  /** Reserved */
1086
1099
  RESERVED_SLEEP = 0x03,
1087
1100
  }
1101
+
1102
+ /** v17+ */
1103
+ export enum EzspMemoryUsageData {
1104
+ /** Gets the total available heap size in bytes */
1105
+ TOTAL_HEAP_SIZE = 0x01,
1106
+ /** Gets the used heap size in bytes at the time requested */
1107
+ CURRENT_USED_HEAP_SIZE = 0x02,
1108
+ /** Gets the "high watermark" of the heap (the highest the heap has been) in bytes at the time requested */
1109
+ CURRENT_HEAP_HIGH_WATERMARK = 0x03,
1110
+ /** Gets the used heap size in bytes at the time after sl_system_init */
1111
+ INIT_USED_HEAP_SIZE = 0x04,
1112
+ /** Gets the "high watermark" of the heap (the highest the heap has been) in bytes at the time after sl_system_init */
1113
+ INIT_HEAP_HIGH_WATERMARK = 0x05,
1114
+ }
@@ -148,6 +148,7 @@ import {
148
148
  type EzspEndpointFlag,
149
149
  EzspExtendedValueId,
150
150
  EzspFrameID,
151
+ type EzspMemoryUsageData,
151
152
  EzspMfgTokenId,
152
153
  type EzspPolicyId,
153
154
  EzspSleepMode,
@@ -646,6 +647,14 @@ export class Ezsp extends EventEmitter<EmberEzspEventMap> {
646
647
  this.ezspCounterRolloverHandler(type);
647
648
  break;
648
649
  }
650
+ case EzspFrameID.MUX_INVALID_RX_HANDLER: {
651
+ if (this.version >= 0x11) {
652
+ const newRxChannel = this.callbackBuffalo.readUInt8();
653
+ const oldRxChannel = this.callbackBuffalo.readUInt8();
654
+ this.ezspMuxInvalidRxHandler(newRxChannel, oldRxChannel);
655
+ }
656
+ break;
657
+ }
649
658
  case EzspFrameID.CUSTOM_FRAME_HANDLER: {
650
659
  const payload = this.callbackBuffalo.readPayload();
651
660
  this.ezspCustomFrameHandler(payload);
@@ -1235,7 +1244,7 @@ export class Ezsp extends EventEmitter<EmberEzspEventMap> {
1235
1244
  * Function for manipulating the endpoints flags on the NCP.
1236
1245
  * Wrapper for `ezspGetExtendedValue`.
1237
1246
  * @param endpoint uint8_t
1238
- * @returns EzspStatus
1247
+ * @returns SLStatus
1239
1248
  * @returns flags
1240
1249
  */
1241
1250
  public async ezspGetEndpointFlags(endpoint: number): Promise<[SLStatus, flags: EzspEndpointFlag]> {
@@ -1254,7 +1263,7 @@ export class Ezsp extends EventEmitter<EmberEzspEventMap> {
1254
1263
  * Wrapper for `ezspGetExtendedValue`.
1255
1264
  * @param NodeId
1256
1265
  * @param destination
1257
- * @returns EzspStatus
1266
+ * @returns SLStatus
1258
1267
  * @returns overhead uint8_t
1259
1268
  */
1260
1269
  public async ezspGetSourceRouteOverhead(destination: NodeId): Promise<[SLStatus, overhead: number]> {
@@ -1269,7 +1278,7 @@ export class Ezsp extends EventEmitter<EmberEzspEventMap> {
1269
1278
 
1270
1279
  /**
1271
1280
  * Wrapper for `ezspGetExtendedValue`.
1272
- * @returns EzspStatus
1281
+ * @returns SLStatus
1273
1282
  * @returns reason
1274
1283
  * @returns nodeId NodeId*
1275
1284
  */
@@ -1283,6 +1292,27 @@ export class Ezsp extends EventEmitter<EmberEzspEventMap> {
1283
1292
  return [status, outVal[0], highLowToInt(outVal[2], outVal[1])];
1284
1293
  }
1285
1294
 
1295
+ /**
1296
+ * Gets memory usage data from sl_memory_manager APIs.
1297
+ * Wrapper for `ezspGetExtendedValue`.
1298
+ * @param type Type of memory usage data to be acquired
1299
+ * @returns SLStatus
1300
+ * @returns Data (in bytes) reflecting current or "boot" memory usage
1301
+ */
1302
+ public async ezspGetMemoryUsageData(type: EzspMemoryUsageData): Promise<[SLStatus, memoryUsageValue: number]> {
1303
+ if (this.version < 0x11) {
1304
+ throw new EzspError(EzspStatus.ERROR_INVALID_FRAME_ID);
1305
+ }
1306
+
1307
+ const [status, outValLen, outVal] = await this.ezspGetExtendedValue(EzspExtendedValueId.MEMORY_USAGE_DATA, type, 4);
1308
+
1309
+ if (outValLen < 4) {
1310
+ throw new EzspError(EzspStatus.ERROR_INVALID_VALUE);
1311
+ }
1312
+
1313
+ return [status, outVal[0] + (outVal[1] << 8) + (outVal[2] << 16) + (outVal[3] << 24)];
1314
+ }
1315
+
1286
1316
  /**
1287
1317
  * Wrapper for `ezspGetValue`.
1288
1318
  * @returns EzspStatus
@@ -2289,6 +2319,16 @@ export class Ezsp extends EventEmitter<EmberEzspEventMap> {
2289
2319
  logger.info(`NCP Counter ${EmberCounterType[type]} rolled over.`, NS);
2290
2320
  }
2291
2321
 
2322
+ /**
2323
+ * Callback
2324
+ * This call is fired when mux detects an invalid rx case, which would be different rx channels for different protocol contexts, when fast channel switching is not enabled
2325
+ * @param newRxChannel uint8_t
2326
+ * @param oldRxChannel uint8_t
2327
+ */
2328
+ ezspMuxInvalidRxHandler(newRxChannel: number, oldRxChannel: number) {
2329
+ logger.debug(`ezspMuxInvalidRxHandler: newRxChannel=${newRxChannel} oldRxChannel=${oldRxChannel}`, NS);
2330
+ }
2331
+
2292
2332
  /**
2293
2333
  * Used to test that UART flow control is working correctly.
2294
2334
  * @param delay uint16_t Data will not be read from the host for this many milliseconds.
@@ -8522,6 +8562,7 @@ export class Ezsp extends EventEmitter<EmberEzspEventMap> {
8522
8562
  * @param mic uint32_t The received MIC of the GPDF.
8523
8563
  * @param proxyTableIndex uint8_tThe proxy table index of the corresponding proxy table entry to the incoming GPDF.
8524
8564
  * @param gpdCommandPayload uint8_t * The GPD command payload.
8565
+ * @param packetInfo Rx packet information.
8525
8566
  */
8526
8567
  ezspGpepIncomingMessageHandler(
8527
8568
  status: EmberGPStatus,
@@ -8645,6 +8686,41 @@ export class Ezsp extends EventEmitter<EmberEzspEventMap> {
8645
8686
  return index;
8646
8687
  }
8647
8688
 
8689
+ /**
8690
+ * Removes the proxy table entry stored at the passed index.
8691
+ * @param proxyIndex The index of the requested proxy table entry.
8692
+ */
8693
+ async ezspGpProxyTableRemoveEntry(proxyIndex: number): Promise<void> {
8694
+ if (this.version < 0x11) {
8695
+ throw new EzspError(EzspStatus.ERROR_INVALID_FRAME_ID);
8696
+ }
8697
+
8698
+ const sendBuffalo = this.startCommand(EzspFrameID.GP_PROXY_TABLE_REMOVE_ENTRY);
8699
+ sendBuffalo.writeUInt8(proxyIndex);
8700
+
8701
+ const sendStatus = await this.sendCommand(sendBuffalo);
8702
+
8703
+ if (sendStatus !== EzspStatus.SUCCESS) {
8704
+ throw new EzspError(sendStatus);
8705
+ }
8706
+ }
8707
+
8708
+ /**
8709
+ * Clear the entire proxy table
8710
+ */
8711
+ async ezspGpClearProxyTable(): Promise<void> {
8712
+ if (this.version < 0x11) {
8713
+ throw new EzspError(EzspStatus.ERROR_INVALID_FRAME_ID);
8714
+ }
8715
+
8716
+ const sendBuffalo = this.startCommand(EzspFrameID.GP_CLEAR_PROXY_TABLE);
8717
+ const sendStatus = await this.sendCommand(sendBuffalo);
8718
+
8719
+ if (sendStatus !== EzspStatus.SUCCESS) {
8720
+ throw new EzspError(sendStatus);
8721
+ }
8722
+ }
8723
+
8648
8724
  /**
8649
8725
  * Retrieves the sink table entry stored at the passed index.
8650
8726
  * @param sinkIndex uint8_t The index of the requested sink table entry.
@@ -159,7 +159,7 @@ const CONFIG_ACK_TIME_MIN = 400;
159
159
  /** " " " " " maximum value */
160
160
  const CONFIG_ACK_TIME_MAX = 2400;
161
161
  /** time allowed to receive RSTACK after ncp is reset */
162
- const CONFIG_TIME_RST = 2500;
162
+ const CONFIG_TIME_RST = 5000;
163
163
  /** time between checks for received RSTACK (CONNECTED status) */
164
164
  const CONFIG_TIME_RST_CHECK = 100;
165
165
  /** if free buffers < limit, host receiver isn't ready, will hold off the ncp from sending normal priority frames */