wiliot-certificate 1.4.0a1__py3-none-any.whl → 1.5.0a1__py3-none-any.whl

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 (77) hide show
  1. brg_certificate/ag/energous_v0_defines.py +12 -12
  2. brg_certificate/ag/energous_v1_defines.py +12 -12
  3. brg_certificate/ag/energous_v2_defines.py +12 -12
  4. brg_certificate/ag/energous_v3_defines.py +12 -12
  5. brg_certificate/ag/energous_v4_defines.py +12 -12
  6. brg_certificate/ag/fanstel_lan_v0_defines.py +12 -12
  7. brg_certificate/ag/fanstel_lte_v0_defines.py +12 -12
  8. brg_certificate/ag/fanstel_wifi_v0_defines.py +12 -12
  9. brg_certificate/ag/minew_lte_v0_defines.py +12 -12
  10. brg_certificate/ag/wlt_cmd_if.html +1 -1
  11. brg_certificate/ag/wlt_types.html +3 -3
  12. brg_certificate/ag/wlt_types_ag.py +12 -12
  13. brg_certificate/brg_certificate.py +9 -6
  14. brg_certificate/cert_common.py +21 -13
  15. brg_certificate/cert_config.py +1 -1
  16. brg_certificate/cert_defines.py +21 -3
  17. brg_certificate/cert_gw_sim.py +6 -4
  18. brg_certificate/cert_mqtt.py +8 -2
  19. brg_certificate/cert_prints.py +7 -5
  20. brg_certificate/cert_protobuf.py +5 -1
  21. brg_certificate/cert_results.py +99 -69
  22. brg_certificate/cert_utils.py +10 -14
  23. brg_certificate/restore_brg.py +2 -0
  24. brg_certificate/tests/calibration/interval_test/interval_test.py +1 -1
  25. brg_certificate/tests/calibration/output_power_test/output_power_test.py +1 -1
  26. brg_certificate/tests/calibration/pattern_test/pattern_test.py +1 -1
  27. brg_certificate/tests/datapath/adaptive_pacer_algo_test/adaptive_pacer_algo_test.py +4 -4
  28. brg_certificate/tests/datapath/num_of_tags_test/num_of_tags_test.py +2 -2
  29. brg_certificate/tests/datapath/output_power_test/output_power_test.py +1 -1
  30. brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +1 -1
  31. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.py +2 -2
  32. brg_certificate/tests/datapath/pacer_interval_test/pacer_interval_test.py +1 -1
  33. brg_certificate/tests/datapath/pattern_test/pattern_test.py +1 -1
  34. brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +1 -1
  35. brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.py +1 -1
  36. brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.py +1 -1
  37. brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.py +1 -1
  38. brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.py +1 -1
  39. brg_certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +1 -1
  40. brg_certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.py +1 -1
  41. brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.py +2 -2
  42. brg_certificate/tests/datapath/stress_test/stress_test.py +2 -2
  43. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.py +1 -1
  44. brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.py +1 -1
  45. brg_certificate/tests/edge_mgmt/actions_test/actions_test.py +4 -4
  46. brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.py +1 -1
  47. brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.py +1 -1
  48. brg_certificate/tests/edge_mgmt/leds_test/leds_test.py +1 -1
  49. brg_certificate/tests/edge_mgmt/ota_test/ota_test.py +1 -1
  50. brg_certificate/tests/edge_mgmt/stat_test/stat_test.py +1 -1
  51. brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.py +1 -1
  52. brg_certificate/tests/energy2400/output_power_test/output_power_test.py +1 -1
  53. brg_certificate/tests/energy2400/pattern_test/pattern_test.py +1 -1
  54. brg_certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.py +1 -1
  55. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.py +1 -1
  56. brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.py +1 -1
  57. brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.py +1 -1
  58. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.py +1 -1
  59. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.py +1 -1
  60. brg_certificate/wltPb_pb2.py +50 -38
  61. brg_certificate/wltPb_pb2.pyi +32 -32
  62. brg_certificate/wlt_types.py +4 -6
  63. common/wlt_logo.png +0 -0
  64. gw_certificate/ag/ut_defines.py +4 -1
  65. gw_certificate/cert_results.py +138 -0
  66. gw_certificate/gw_certificate.py +20 -6
  67. gw_certificate/interface/mqtt.py +1 -0
  68. gw_certificate/interface/uart_if.py +1 -1
  69. gw_certificate/tests/actions.py +0 -1
  70. gw_certificate/tests/connection.py +1 -1
  71. gw_certificate/tests/generic.py +43 -17
  72. {wiliot_certificate-1.4.0a1.dist-info → wiliot_certificate-1.5.0a1.dist-info}/METADATA +6 -4
  73. {wiliot_certificate-1.4.0a1.dist-info → wiliot_certificate-1.5.0a1.dist-info}/RECORD +77 -75
  74. {wiliot_certificate-1.4.0a1.dist-info → wiliot_certificate-1.5.0a1.dist-info}/top_level.txt +1 -0
  75. {wiliot_certificate-1.4.0a1.dist-info → wiliot_certificate-1.5.0a1.dist-info}/LICENSE +0 -0
  76. {wiliot_certificate-1.4.0a1.dist-info → wiliot_certificate-1.5.0a1.dist-info}/WHEEL +0 -0
  77. {wiliot_certificate-1.4.0a1.dist-info → wiliot_certificate-1.5.0a1.dist-info}/entry_points.txt +0 -0
@@ -832,21 +832,21 @@ class ModuleExtSensorsV11():
832
832
  self.unused = d[7]
833
833
 
834
834
  class ModuleCustomV12():
835
- def __init__(self, raw='', module_type=MODULE_CUSTOM, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, state_threshold=LIS2DW12_DEFAULTS_STATE_THRESHOLD, wake_up_duration=LIS2DW12_DEFAULTS_WAKE_UP_DURATION, sleep_duration=LIS2DW12_DEFAULTS_SLEEP_DURATION, unused1=0):
835
+ def __init__(self, raw='', module_type=MODULE_CUSTOM, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, motion_sensitivity_threshold=LIS2DW12_DEFAULTS_STATE_THRESHOLD, s2d_transition_time=LIS2DW12_DEFAULTS_WAKE_UP_DURATION, d2s_transition_time=LIS2DW12_DEFAULTS_SLEEP_DURATION, unused1=0):
836
836
  self.module_type = module_type
837
837
  self.msg_type = msg_type
838
838
  self.api_version = api_version
839
839
  self.seq_id = seq_id
840
840
  self.brg_mac = brg_mac
841
- self.state_threshold = state_threshold # 31 [mg] resolution
842
- self.wake_up_duration = wake_up_duration # 3 [sec] resolution
843
- self.sleep_duration = sleep_duration # 5 [sec] resolution
841
+ self.motion_sensitivity_threshold = motion_sensitivity_threshold # 31 [mg] resolution
842
+ self.s2d_transition_time = s2d_transition_time # 3 [sec] resolution
843
+ self.d2s_transition_time = d2s_transition_time # 5 [sec] resolution
844
844
  self.unused1 = unused1
845
845
  if raw:
846
846
  self.set(raw)
847
847
 
848
848
  def __repr__(self) -> str:
849
- return "\n==> Packet module_custom_v12 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X} ({self.module_type})"],['msg_type', f"0x{self.msg_type:X} ({self.msg_type})"],['api_version', f"0x{self.api_version:X} ({self.api_version})"],['seq_id', f"0x{self.seq_id:X} ({self.seq_id})"],['brg_mac', f"0x{self.brg_mac:X} ({self.brg_mac})"],['state_threshold', f"0x{self.state_threshold:X} ({self.state_threshold})"],['wake_up_duration', f"0x{self.wake_up_duration:X} ({self.wake_up_duration})"],['sleep_duration', f"0x{self.sleep_duration:X} ({self.sleep_duration})"]], tablefmt="texttable")
849
+ return "\n==> Packet module_custom_v12 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X} ({self.module_type})"],['msg_type', f"0x{self.msg_type:X} ({self.msg_type})"],['api_version', f"0x{self.api_version:X} ({self.api_version})"],['seq_id', f"0x{self.seq_id:X} ({self.seq_id})"],['brg_mac', f"0x{self.brg_mac:X} ({self.brg_mac})"],['motion_sensitivity_threshold', f"0x{self.motion_sensitivity_threshold:X} ({self.motion_sensitivity_threshold})"],['s2d_transition_time', f"0x{self.s2d_transition_time:X} ({self.s2d_transition_time})"],['d2s_transition_time', f"0x{self.d2s_transition_time:X} ({self.d2s_transition_time})"]], tablefmt="texttable")
850
850
 
851
851
  def __eq__(self, other):
852
852
  if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
@@ -855,14 +855,14 @@ class ModuleCustomV12():
855
855
  self.msg_type == other.msg_type and
856
856
  self.api_version == other.api_version and
857
857
  self.brg_mac == other.brg_mac and
858
- self.state_threshold == other.state_threshold and
859
- self.wake_up_duration == other.wake_up_duration and
860
- self.sleep_duration == other.sleep_duration
858
+ self.motion_sensitivity_threshold == other.motion_sensitivity_threshold and
859
+ self.s2d_transition_time == other.s2d_transition_time and
860
+ self.d2s_transition_time == other.d2s_transition_time
861
861
  )
862
862
  return False
863
863
 
864
864
  def dump(self):
865
- string = bitstruct.pack("u4u4u8u8u48u8u8u8u96", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, ((self.state_threshold-0)//31), ((self.wake_up_duration-0)//3), ((self.sleep_duration-0)//5), self.unused1)
865
+ string = bitstruct.pack("u4u4u8u8u48u8u8u8u96", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, ((self.motion_sensitivity_threshold-0)//31), ((self.s2d_transition_time-0)//3), ((self.d2s_transition_time-0)//5), self.unused1)
866
866
  return string.hex().upper()
867
867
 
868
868
  def set(self, string):
@@ -872,9 +872,9 @@ class ModuleCustomV12():
872
872
  self.api_version = d[2]
873
873
  self.seq_id = d[3]
874
874
  self.brg_mac = d[4]
875
- self.state_threshold = ((d[5]*31)+0)
876
- self.wake_up_duration = ((d[6]*3)+0)
877
- self.sleep_duration = ((d[7]*5)+0)
875
+ self.motion_sensitivity_threshold = ((d[5]*31)+0)
876
+ self.s2d_transition_time = ((d[6]*3)+0)
877
+ self.d2s_transition_time = ((d[7]*5)+0)
878
878
  self.unused1 = d[8]
879
879
 
880
880
  class ModuleCustomV11():
@@ -838,21 +838,21 @@ class ModuleExtSensorsV11():
838
838
  self.unused = d[7]
839
839
 
840
840
  class ModuleCustomV12():
841
- def __init__(self, raw='', module_type=MODULE_CUSTOM, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, state_threshold=LIS2DW12_DEFAULTS_STATE_THRESHOLD, wake_up_duration=LIS2DW12_DEFAULTS_WAKE_UP_DURATION, sleep_duration=LIS2DW12_DEFAULTS_SLEEP_DURATION, unused1=0):
841
+ def __init__(self, raw='', module_type=MODULE_CUSTOM, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, motion_sensitivity_threshold=LIS2DW12_DEFAULTS_STATE_THRESHOLD, s2d_transition_time=LIS2DW12_DEFAULTS_WAKE_UP_DURATION, d2s_transition_time=LIS2DW12_DEFAULTS_SLEEP_DURATION, unused1=0):
842
842
  self.module_type = module_type
843
843
  self.msg_type = msg_type
844
844
  self.api_version = api_version
845
845
  self.seq_id = seq_id
846
846
  self.brg_mac = brg_mac
847
- self.state_threshold = state_threshold # 31 [mg] resolution
848
- self.wake_up_duration = wake_up_duration # 3 [sec] resolution
849
- self.sleep_duration = sleep_duration # 5 [sec] resolution
847
+ self.motion_sensitivity_threshold = motion_sensitivity_threshold # 31 [mg] resolution
848
+ self.s2d_transition_time = s2d_transition_time # 3 [sec] resolution
849
+ self.d2s_transition_time = d2s_transition_time # 5 [sec] resolution
850
850
  self.unused1 = unused1
851
851
  if raw:
852
852
  self.set(raw)
853
853
 
854
854
  def __repr__(self) -> str:
855
- return "\n==> Packet module_custom_v12 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X} ({self.module_type})"],['msg_type', f"0x{self.msg_type:X} ({self.msg_type})"],['api_version', f"0x{self.api_version:X} ({self.api_version})"],['seq_id', f"0x{self.seq_id:X} ({self.seq_id})"],['brg_mac', f"0x{self.brg_mac:X} ({self.brg_mac})"],['state_threshold', f"0x{self.state_threshold:X} ({self.state_threshold})"],['wake_up_duration', f"0x{self.wake_up_duration:X} ({self.wake_up_duration})"],['sleep_duration', f"0x{self.sleep_duration:X} ({self.sleep_duration})"]], tablefmt="texttable")
855
+ return "\n==> Packet module_custom_v12 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X} ({self.module_type})"],['msg_type', f"0x{self.msg_type:X} ({self.msg_type})"],['api_version', f"0x{self.api_version:X} ({self.api_version})"],['seq_id', f"0x{self.seq_id:X} ({self.seq_id})"],['brg_mac', f"0x{self.brg_mac:X} ({self.brg_mac})"],['motion_sensitivity_threshold', f"0x{self.motion_sensitivity_threshold:X} ({self.motion_sensitivity_threshold})"],['s2d_transition_time', f"0x{self.s2d_transition_time:X} ({self.s2d_transition_time})"],['d2s_transition_time', f"0x{self.d2s_transition_time:X} ({self.d2s_transition_time})"]], tablefmt="texttable")
856
856
 
857
857
  def __eq__(self, other):
858
858
  if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
@@ -861,14 +861,14 @@ class ModuleCustomV12():
861
861
  self.msg_type == other.msg_type and
862
862
  self.api_version == other.api_version and
863
863
  self.brg_mac == other.brg_mac and
864
- self.state_threshold == other.state_threshold and
865
- self.wake_up_duration == other.wake_up_duration and
866
- self.sleep_duration == other.sleep_duration
864
+ self.motion_sensitivity_threshold == other.motion_sensitivity_threshold and
865
+ self.s2d_transition_time == other.s2d_transition_time and
866
+ self.d2s_transition_time == other.d2s_transition_time
867
867
  )
868
868
  return False
869
869
 
870
870
  def dump(self):
871
- string = bitstruct.pack("u4u4u8u8u48u8u8u8u96", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, ((self.state_threshold-0)//31), ((self.wake_up_duration-0)//3), ((self.sleep_duration-0)//5), self.unused1)
871
+ string = bitstruct.pack("u4u4u8u8u48u8u8u8u96", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, ((self.motion_sensitivity_threshold-0)//31), ((self.s2d_transition_time-0)//3), ((self.d2s_transition_time-0)//5), self.unused1)
872
872
  return string.hex().upper()
873
873
 
874
874
  def set(self, string):
@@ -878,9 +878,9 @@ class ModuleCustomV12():
878
878
  self.api_version = d[2]
879
879
  self.seq_id = d[3]
880
880
  self.brg_mac = d[4]
881
- self.state_threshold = ((d[5]*31)+0)
882
- self.wake_up_duration = ((d[6]*3)+0)
883
- self.sleep_duration = ((d[7]*5)+0)
881
+ self.motion_sensitivity_threshold = ((d[5]*31)+0)
882
+ self.s2d_transition_time = ((d[6]*3)+0)
883
+ self.d2s_transition_time = ((d[7]*5)+0)
884
884
  self.unused1 = d[8]
885
885
 
886
886
  class ModuleCustomV11():
@@ -832,21 +832,21 @@ class ModuleExtSensorsV11():
832
832
  self.unused = d[7]
833
833
 
834
834
  class ModuleCustomV12():
835
- def __init__(self, raw='', module_type=MODULE_CUSTOM, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, state_threshold=LIS2DW12_DEFAULTS_STATE_THRESHOLD, wake_up_duration=LIS2DW12_DEFAULTS_WAKE_UP_DURATION, sleep_duration=LIS2DW12_DEFAULTS_SLEEP_DURATION, unused1=0):
835
+ def __init__(self, raw='', module_type=MODULE_CUSTOM, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, motion_sensitivity_threshold=LIS2DW12_DEFAULTS_STATE_THRESHOLD, s2d_transition_time=LIS2DW12_DEFAULTS_WAKE_UP_DURATION, d2s_transition_time=LIS2DW12_DEFAULTS_SLEEP_DURATION, unused1=0):
836
836
  self.module_type = module_type
837
837
  self.msg_type = msg_type
838
838
  self.api_version = api_version
839
839
  self.seq_id = seq_id
840
840
  self.brg_mac = brg_mac
841
- self.state_threshold = state_threshold # 31 [mg] resolution
842
- self.wake_up_duration = wake_up_duration # 3 [sec] resolution
843
- self.sleep_duration = sleep_duration # 5 [sec] resolution
841
+ self.motion_sensitivity_threshold = motion_sensitivity_threshold # 31 [mg] resolution
842
+ self.s2d_transition_time = s2d_transition_time # 3 [sec] resolution
843
+ self.d2s_transition_time = d2s_transition_time # 5 [sec] resolution
844
844
  self.unused1 = unused1
845
845
  if raw:
846
846
  self.set(raw)
847
847
 
848
848
  def __repr__(self) -> str:
849
- return "\n==> Packet module_custom_v12 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X} ({self.module_type})"],['msg_type', f"0x{self.msg_type:X} ({self.msg_type})"],['api_version', f"0x{self.api_version:X} ({self.api_version})"],['seq_id', f"0x{self.seq_id:X} ({self.seq_id})"],['brg_mac', f"0x{self.brg_mac:X} ({self.brg_mac})"],['state_threshold', f"0x{self.state_threshold:X} ({self.state_threshold})"],['wake_up_duration', f"0x{self.wake_up_duration:X} ({self.wake_up_duration})"],['sleep_duration', f"0x{self.sleep_duration:X} ({self.sleep_duration})"]], tablefmt="texttable")
849
+ return "\n==> Packet module_custom_v12 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X} ({self.module_type})"],['msg_type', f"0x{self.msg_type:X} ({self.msg_type})"],['api_version', f"0x{self.api_version:X} ({self.api_version})"],['seq_id', f"0x{self.seq_id:X} ({self.seq_id})"],['brg_mac', f"0x{self.brg_mac:X} ({self.brg_mac})"],['motion_sensitivity_threshold', f"0x{self.motion_sensitivity_threshold:X} ({self.motion_sensitivity_threshold})"],['s2d_transition_time', f"0x{self.s2d_transition_time:X} ({self.s2d_transition_time})"],['d2s_transition_time', f"0x{self.d2s_transition_time:X} ({self.d2s_transition_time})"]], tablefmt="texttable")
850
850
 
851
851
  def __eq__(self, other):
852
852
  if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
@@ -855,14 +855,14 @@ class ModuleCustomV12():
855
855
  self.msg_type == other.msg_type and
856
856
  self.api_version == other.api_version and
857
857
  self.brg_mac == other.brg_mac and
858
- self.state_threshold == other.state_threshold and
859
- self.wake_up_duration == other.wake_up_duration and
860
- self.sleep_duration == other.sleep_duration
858
+ self.motion_sensitivity_threshold == other.motion_sensitivity_threshold and
859
+ self.s2d_transition_time == other.s2d_transition_time and
860
+ self.d2s_transition_time == other.d2s_transition_time
861
861
  )
862
862
  return False
863
863
 
864
864
  def dump(self):
865
- string = bitstruct.pack("u4u4u8u8u48u8u8u8u96", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, ((self.state_threshold-0)//31), ((self.wake_up_duration-0)//3), ((self.sleep_duration-0)//5), self.unused1)
865
+ string = bitstruct.pack("u4u4u8u8u48u8u8u8u96", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, ((self.motion_sensitivity_threshold-0)//31), ((self.s2d_transition_time-0)//3), ((self.d2s_transition_time-0)//5), self.unused1)
866
866
  return string.hex().upper()
867
867
 
868
868
  def set(self, string):
@@ -872,9 +872,9 @@ class ModuleCustomV12():
872
872
  self.api_version = d[2]
873
873
  self.seq_id = d[3]
874
874
  self.brg_mac = d[4]
875
- self.state_threshold = ((d[5]*31)+0)
876
- self.wake_up_duration = ((d[6]*3)+0)
877
- self.sleep_duration = ((d[7]*5)+0)
875
+ self.motion_sensitivity_threshold = ((d[5]*31)+0)
876
+ self.s2d_transition_time = ((d[6]*3)+0)
877
+ self.d2s_transition_time = ((d[7]*5)+0)
878
878
  self.unused1 = d[8]
879
879
 
880
880
  class ModuleCustomV11():
@@ -832,21 +832,21 @@ class ModuleExtSensorsV11():
832
832
  self.unused = d[7]
833
833
 
834
834
  class ModuleCustomV12():
835
- def __init__(self, raw='', module_type=MODULE_CUSTOM, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, state_threshold=LIS2DW12_DEFAULTS_STATE_THRESHOLD, wake_up_duration=LIS2DW12_DEFAULTS_WAKE_UP_DURATION, sleep_duration=LIS2DW12_DEFAULTS_SLEEP_DURATION, unused1=0):
835
+ def __init__(self, raw='', module_type=MODULE_CUSTOM, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, motion_sensitivity_threshold=LIS2DW12_DEFAULTS_STATE_THRESHOLD, s2d_transition_time=LIS2DW12_DEFAULTS_WAKE_UP_DURATION, d2s_transition_time=LIS2DW12_DEFAULTS_SLEEP_DURATION, unused1=0):
836
836
  self.module_type = module_type
837
837
  self.msg_type = msg_type
838
838
  self.api_version = api_version
839
839
  self.seq_id = seq_id
840
840
  self.brg_mac = brg_mac
841
- self.state_threshold = state_threshold # 31 [mg] resolution
842
- self.wake_up_duration = wake_up_duration # 3 [sec] resolution
843
- self.sleep_duration = sleep_duration # 5 [sec] resolution
841
+ self.motion_sensitivity_threshold = motion_sensitivity_threshold # 31 [mg] resolution
842
+ self.s2d_transition_time = s2d_transition_time # 3 [sec] resolution
843
+ self.d2s_transition_time = d2s_transition_time # 5 [sec] resolution
844
844
  self.unused1 = unused1
845
845
  if raw:
846
846
  self.set(raw)
847
847
 
848
848
  def __repr__(self) -> str:
849
- return "\n==> Packet module_custom_v12 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X} ({self.module_type})"],['msg_type', f"0x{self.msg_type:X} ({self.msg_type})"],['api_version', f"0x{self.api_version:X} ({self.api_version})"],['seq_id', f"0x{self.seq_id:X} ({self.seq_id})"],['brg_mac', f"0x{self.brg_mac:X} ({self.brg_mac})"],['state_threshold', f"0x{self.state_threshold:X} ({self.state_threshold})"],['wake_up_duration', f"0x{self.wake_up_duration:X} ({self.wake_up_duration})"],['sleep_duration', f"0x{self.sleep_duration:X} ({self.sleep_duration})"]], tablefmt="texttable")
849
+ return "\n==> Packet module_custom_v12 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X} ({self.module_type})"],['msg_type', f"0x{self.msg_type:X} ({self.msg_type})"],['api_version', f"0x{self.api_version:X} ({self.api_version})"],['seq_id', f"0x{self.seq_id:X} ({self.seq_id})"],['brg_mac', f"0x{self.brg_mac:X} ({self.brg_mac})"],['motion_sensitivity_threshold', f"0x{self.motion_sensitivity_threshold:X} ({self.motion_sensitivity_threshold})"],['s2d_transition_time', f"0x{self.s2d_transition_time:X} ({self.s2d_transition_time})"],['d2s_transition_time', f"0x{self.d2s_transition_time:X} ({self.d2s_transition_time})"]], tablefmt="texttable")
850
850
 
851
851
  def __eq__(self, other):
852
852
  if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
@@ -855,14 +855,14 @@ class ModuleCustomV12():
855
855
  self.msg_type == other.msg_type and
856
856
  self.api_version == other.api_version and
857
857
  self.brg_mac == other.brg_mac and
858
- self.state_threshold == other.state_threshold and
859
- self.wake_up_duration == other.wake_up_duration and
860
- self.sleep_duration == other.sleep_duration
858
+ self.motion_sensitivity_threshold == other.motion_sensitivity_threshold and
859
+ self.s2d_transition_time == other.s2d_transition_time and
860
+ self.d2s_transition_time == other.d2s_transition_time
861
861
  )
862
862
  return False
863
863
 
864
864
  def dump(self):
865
- string = bitstruct.pack("u4u4u8u8u48u8u8u8u96", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, ((self.state_threshold-0)//31), ((self.wake_up_duration-0)//3), ((self.sleep_duration-0)//5), self.unused1)
865
+ string = bitstruct.pack("u4u4u8u8u48u8u8u8u96", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, ((self.motion_sensitivity_threshold-0)//31), ((self.s2d_transition_time-0)//3), ((self.d2s_transition_time-0)//5), self.unused1)
866
866
  return string.hex().upper()
867
867
 
868
868
  def set(self, string):
@@ -872,9 +872,9 @@ class ModuleCustomV12():
872
872
  self.api_version = d[2]
873
873
  self.seq_id = d[3]
874
874
  self.brg_mac = d[4]
875
- self.state_threshold = ((d[5]*31)+0)
876
- self.wake_up_duration = ((d[6]*3)+0)
877
- self.sleep_duration = ((d[7]*5)+0)
875
+ self.motion_sensitivity_threshold = ((d[5]*31)+0)
876
+ self.s2d_transition_time = ((d[6]*3)+0)
877
+ self.d2s_transition_time = ((d[7]*5)+0)
878
878
  self.unused1 = d[8]
879
879
 
880
880
  class ModuleCustomV11():
@@ -832,21 +832,21 @@ class ModuleExtSensorsV11():
832
832
  self.unused = d[7]
833
833
 
834
834
  class ModuleCustomV12():
835
- def __init__(self, raw='', module_type=MODULE_CUSTOM, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, state_threshold=LIS2DW12_DEFAULTS_STATE_THRESHOLD, wake_up_duration=LIS2DW12_DEFAULTS_WAKE_UP_DURATION, sleep_duration=LIS2DW12_DEFAULTS_SLEEP_DURATION, unused1=0):
835
+ def __init__(self, raw='', module_type=MODULE_CUSTOM, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, motion_sensitivity_threshold=LIS2DW12_DEFAULTS_STATE_THRESHOLD, s2d_transition_time=LIS2DW12_DEFAULTS_WAKE_UP_DURATION, d2s_transition_time=LIS2DW12_DEFAULTS_SLEEP_DURATION, unused1=0):
836
836
  self.module_type = module_type
837
837
  self.msg_type = msg_type
838
838
  self.api_version = api_version
839
839
  self.seq_id = seq_id
840
840
  self.brg_mac = brg_mac
841
- self.state_threshold = state_threshold # 31 [mg] resolution
842
- self.wake_up_duration = wake_up_duration # 3 [sec] resolution
843
- self.sleep_duration = sleep_duration # 5 [sec] resolution
841
+ self.motion_sensitivity_threshold = motion_sensitivity_threshold # 31 [mg] resolution
842
+ self.s2d_transition_time = s2d_transition_time # 3 [sec] resolution
843
+ self.d2s_transition_time = d2s_transition_time # 5 [sec] resolution
844
844
  self.unused1 = unused1
845
845
  if raw:
846
846
  self.set(raw)
847
847
 
848
848
  def __repr__(self) -> str:
849
- return "\n==> Packet module_custom_v12 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X} ({self.module_type})"],['msg_type', f"0x{self.msg_type:X} ({self.msg_type})"],['api_version', f"0x{self.api_version:X} ({self.api_version})"],['seq_id', f"0x{self.seq_id:X} ({self.seq_id})"],['brg_mac', f"0x{self.brg_mac:X} ({self.brg_mac})"],['state_threshold', f"0x{self.state_threshold:X} ({self.state_threshold})"],['wake_up_duration', f"0x{self.wake_up_duration:X} ({self.wake_up_duration})"],['sleep_duration', f"0x{self.sleep_duration:X} ({self.sleep_duration})"]], tablefmt="texttable")
849
+ return "\n==> Packet module_custom_v12 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X} ({self.module_type})"],['msg_type', f"0x{self.msg_type:X} ({self.msg_type})"],['api_version', f"0x{self.api_version:X} ({self.api_version})"],['seq_id', f"0x{self.seq_id:X} ({self.seq_id})"],['brg_mac', f"0x{self.brg_mac:X} ({self.brg_mac})"],['motion_sensitivity_threshold', f"0x{self.motion_sensitivity_threshold:X} ({self.motion_sensitivity_threshold})"],['s2d_transition_time', f"0x{self.s2d_transition_time:X} ({self.s2d_transition_time})"],['d2s_transition_time', f"0x{self.d2s_transition_time:X} ({self.d2s_transition_time})"]], tablefmt="texttable")
850
850
 
851
851
  def __eq__(self, other):
852
852
  if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
@@ -855,14 +855,14 @@ class ModuleCustomV12():
855
855
  self.msg_type == other.msg_type and
856
856
  self.api_version == other.api_version and
857
857
  self.brg_mac == other.brg_mac and
858
- self.state_threshold == other.state_threshold and
859
- self.wake_up_duration == other.wake_up_duration and
860
- self.sleep_duration == other.sleep_duration
858
+ self.motion_sensitivity_threshold == other.motion_sensitivity_threshold and
859
+ self.s2d_transition_time == other.s2d_transition_time and
860
+ self.d2s_transition_time == other.d2s_transition_time
861
861
  )
862
862
  return False
863
863
 
864
864
  def dump(self):
865
- string = bitstruct.pack("u4u4u8u8u48u8u8u8u96", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, ((self.state_threshold-0)//31), ((self.wake_up_duration-0)//3), ((self.sleep_duration-0)//5), self.unused1)
865
+ string = bitstruct.pack("u4u4u8u8u48u8u8u8u96", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, ((self.motion_sensitivity_threshold-0)//31), ((self.s2d_transition_time-0)//3), ((self.d2s_transition_time-0)//5), self.unused1)
866
866
  return string.hex().upper()
867
867
 
868
868
  def set(self, string):
@@ -872,9 +872,9 @@ class ModuleCustomV12():
872
872
  self.api_version = d[2]
873
873
  self.seq_id = d[3]
874
874
  self.brg_mac = d[4]
875
- self.state_threshold = ((d[5]*31)+0)
876
- self.wake_up_duration = ((d[6]*3)+0)
877
- self.sleep_duration = ((d[7]*5)+0)
875
+ self.motion_sensitivity_threshold = ((d[5]*31)+0)
876
+ self.s2d_transition_time = ((d[6]*3)+0)
877
+ self.d2s_transition_time = ((d[7]*5)+0)
878
878
  self.unused1 = d[8]
879
879
 
880
880
  class ModuleCustomV11():
@@ -832,21 +832,21 @@ class ModuleExtSensorsV11():
832
832
  self.unused = d[7]
833
833
 
834
834
  class ModuleCustomV12():
835
- def __init__(self, raw='', module_type=MODULE_CUSTOM, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, state_threshold=LIS2DW12_DEFAULTS_STATE_THRESHOLD, wake_up_duration=LIS2DW12_DEFAULTS_WAKE_UP_DURATION, sleep_duration=LIS2DW12_DEFAULTS_SLEEP_DURATION, unused1=0):
835
+ def __init__(self, raw='', module_type=MODULE_CUSTOM, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, motion_sensitivity_threshold=LIS2DW12_DEFAULTS_STATE_THRESHOLD, s2d_transition_time=LIS2DW12_DEFAULTS_WAKE_UP_DURATION, d2s_transition_time=LIS2DW12_DEFAULTS_SLEEP_DURATION, unused1=0):
836
836
  self.module_type = module_type
837
837
  self.msg_type = msg_type
838
838
  self.api_version = api_version
839
839
  self.seq_id = seq_id
840
840
  self.brg_mac = brg_mac
841
- self.state_threshold = state_threshold # 31 [mg] resolution
842
- self.wake_up_duration = wake_up_duration # 3 [sec] resolution
843
- self.sleep_duration = sleep_duration # 5 [sec] resolution
841
+ self.motion_sensitivity_threshold = motion_sensitivity_threshold # 31 [mg] resolution
842
+ self.s2d_transition_time = s2d_transition_time # 3 [sec] resolution
843
+ self.d2s_transition_time = d2s_transition_time # 5 [sec] resolution
844
844
  self.unused1 = unused1
845
845
  if raw:
846
846
  self.set(raw)
847
847
 
848
848
  def __repr__(self) -> str:
849
- return "\n==> Packet module_custom_v12 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X} ({self.module_type})"],['msg_type', f"0x{self.msg_type:X} ({self.msg_type})"],['api_version', f"0x{self.api_version:X} ({self.api_version})"],['seq_id', f"0x{self.seq_id:X} ({self.seq_id})"],['brg_mac', f"0x{self.brg_mac:X} ({self.brg_mac})"],['state_threshold', f"0x{self.state_threshold:X} ({self.state_threshold})"],['wake_up_duration', f"0x{self.wake_up_duration:X} ({self.wake_up_duration})"],['sleep_duration', f"0x{self.sleep_duration:X} ({self.sleep_duration})"]], tablefmt="texttable")
849
+ return "\n==> Packet module_custom_v12 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X} ({self.module_type})"],['msg_type', f"0x{self.msg_type:X} ({self.msg_type})"],['api_version', f"0x{self.api_version:X} ({self.api_version})"],['seq_id', f"0x{self.seq_id:X} ({self.seq_id})"],['brg_mac', f"0x{self.brg_mac:X} ({self.brg_mac})"],['motion_sensitivity_threshold', f"0x{self.motion_sensitivity_threshold:X} ({self.motion_sensitivity_threshold})"],['s2d_transition_time', f"0x{self.s2d_transition_time:X} ({self.s2d_transition_time})"],['d2s_transition_time', f"0x{self.d2s_transition_time:X} ({self.d2s_transition_time})"]], tablefmt="texttable")
850
850
 
851
851
  def __eq__(self, other):
852
852
  if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
@@ -855,14 +855,14 @@ class ModuleCustomV12():
855
855
  self.msg_type == other.msg_type and
856
856
  self.api_version == other.api_version and
857
857
  self.brg_mac == other.brg_mac and
858
- self.state_threshold == other.state_threshold and
859
- self.wake_up_duration == other.wake_up_duration and
860
- self.sleep_duration == other.sleep_duration
858
+ self.motion_sensitivity_threshold == other.motion_sensitivity_threshold and
859
+ self.s2d_transition_time == other.s2d_transition_time and
860
+ self.d2s_transition_time == other.d2s_transition_time
861
861
  )
862
862
  return False
863
863
 
864
864
  def dump(self):
865
- string = bitstruct.pack("u4u4u8u8u48u8u8u8u96", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, ((self.state_threshold-0)//31), ((self.wake_up_duration-0)//3), ((self.sleep_duration-0)//5), self.unused1)
865
+ string = bitstruct.pack("u4u4u8u8u48u8u8u8u96", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, ((self.motion_sensitivity_threshold-0)//31), ((self.s2d_transition_time-0)//3), ((self.d2s_transition_time-0)//5), self.unused1)
866
866
  return string.hex().upper()
867
867
 
868
868
  def set(self, string):
@@ -872,9 +872,9 @@ class ModuleCustomV12():
872
872
  self.api_version = d[2]
873
873
  self.seq_id = d[3]
874
874
  self.brg_mac = d[4]
875
- self.state_threshold = ((d[5]*31)+0)
876
- self.wake_up_duration = ((d[6]*3)+0)
877
- self.sleep_duration = ((d[7]*5)+0)
875
+ self.motion_sensitivity_threshold = ((d[5]*31)+0)
876
+ self.s2d_transition_time = ((d[6]*3)+0)
877
+ self.d2s_transition_time = ((d[7]*5)+0)
878
878
  self.unused1 = d[8]
879
879
 
880
880
  class ModuleCustomV11():
@@ -832,21 +832,21 @@ class ModuleExtSensorsV11():
832
832
  self.unused = d[7]
833
833
 
834
834
  class ModuleCustomV12():
835
- def __init__(self, raw='', module_type=MODULE_CUSTOM, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, state_threshold=LIS2DW12_DEFAULTS_STATE_THRESHOLD, wake_up_duration=LIS2DW12_DEFAULTS_WAKE_UP_DURATION, sleep_duration=LIS2DW12_DEFAULTS_SLEEP_DURATION, unused1=0):
835
+ def __init__(self, raw='', module_type=MODULE_CUSTOM, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, motion_sensitivity_threshold=LIS2DW12_DEFAULTS_STATE_THRESHOLD, s2d_transition_time=LIS2DW12_DEFAULTS_WAKE_UP_DURATION, d2s_transition_time=LIS2DW12_DEFAULTS_SLEEP_DURATION, unused1=0):
836
836
  self.module_type = module_type
837
837
  self.msg_type = msg_type
838
838
  self.api_version = api_version
839
839
  self.seq_id = seq_id
840
840
  self.brg_mac = brg_mac
841
- self.state_threshold = state_threshold # 31 [mg] resolution
842
- self.wake_up_duration = wake_up_duration # 3 [sec] resolution
843
- self.sleep_duration = sleep_duration # 5 [sec] resolution
841
+ self.motion_sensitivity_threshold = motion_sensitivity_threshold # 31 [mg] resolution
842
+ self.s2d_transition_time = s2d_transition_time # 3 [sec] resolution
843
+ self.d2s_transition_time = d2s_transition_time # 5 [sec] resolution
844
844
  self.unused1 = unused1
845
845
  if raw:
846
846
  self.set(raw)
847
847
 
848
848
  def __repr__(self) -> str:
849
- return "\n==> Packet module_custom_v12 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X} ({self.module_type})"],['msg_type', f"0x{self.msg_type:X} ({self.msg_type})"],['api_version', f"0x{self.api_version:X} ({self.api_version})"],['seq_id', f"0x{self.seq_id:X} ({self.seq_id})"],['brg_mac', f"0x{self.brg_mac:X} ({self.brg_mac})"],['state_threshold', f"0x{self.state_threshold:X} ({self.state_threshold})"],['wake_up_duration', f"0x{self.wake_up_duration:X} ({self.wake_up_duration})"],['sleep_duration', f"0x{self.sleep_duration:X} ({self.sleep_duration})"]], tablefmt="texttable")
849
+ return "\n==> Packet module_custom_v12 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X} ({self.module_type})"],['msg_type', f"0x{self.msg_type:X} ({self.msg_type})"],['api_version', f"0x{self.api_version:X} ({self.api_version})"],['seq_id', f"0x{self.seq_id:X} ({self.seq_id})"],['brg_mac', f"0x{self.brg_mac:X} ({self.brg_mac})"],['motion_sensitivity_threshold', f"0x{self.motion_sensitivity_threshold:X} ({self.motion_sensitivity_threshold})"],['s2d_transition_time', f"0x{self.s2d_transition_time:X} ({self.s2d_transition_time})"],['d2s_transition_time', f"0x{self.d2s_transition_time:X} ({self.d2s_transition_time})"]], tablefmt="texttable")
850
850
 
851
851
  def __eq__(self, other):
852
852
  if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
@@ -855,14 +855,14 @@ class ModuleCustomV12():
855
855
  self.msg_type == other.msg_type and
856
856
  self.api_version == other.api_version and
857
857
  self.brg_mac == other.brg_mac and
858
- self.state_threshold == other.state_threshold and
859
- self.wake_up_duration == other.wake_up_duration and
860
- self.sleep_duration == other.sleep_duration
858
+ self.motion_sensitivity_threshold == other.motion_sensitivity_threshold and
859
+ self.s2d_transition_time == other.s2d_transition_time and
860
+ self.d2s_transition_time == other.d2s_transition_time
861
861
  )
862
862
  return False
863
863
 
864
864
  def dump(self):
865
- string = bitstruct.pack("u4u4u8u8u48u8u8u8u96", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, ((self.state_threshold-0)//31), ((self.wake_up_duration-0)//3), ((self.sleep_duration-0)//5), self.unused1)
865
+ string = bitstruct.pack("u4u4u8u8u48u8u8u8u96", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, ((self.motion_sensitivity_threshold-0)//31), ((self.s2d_transition_time-0)//3), ((self.d2s_transition_time-0)//5), self.unused1)
866
866
  return string.hex().upper()
867
867
 
868
868
  def set(self, string):
@@ -872,9 +872,9 @@ class ModuleCustomV12():
872
872
  self.api_version = d[2]
873
873
  self.seq_id = d[3]
874
874
  self.brg_mac = d[4]
875
- self.state_threshold = ((d[5]*31)+0)
876
- self.wake_up_duration = ((d[6]*3)+0)
877
- self.sleep_duration = ((d[7]*5)+0)
875
+ self.motion_sensitivity_threshold = ((d[5]*31)+0)
876
+ self.s2d_transition_time = ((d[6]*3)+0)
877
+ self.d2s_transition_time = ((d[7]*5)+0)
878
878
  self.unused1 = d[8]
879
879
 
880
880
  class ModuleCustomV11():
@@ -832,21 +832,21 @@ class ModuleExtSensorsV11():
832
832
  self.unused = d[7]
833
833
 
834
834
  class ModuleCustomV12():
835
- def __init__(self, raw='', module_type=MODULE_CUSTOM, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, state_threshold=LIS2DW12_DEFAULTS_STATE_THRESHOLD, wake_up_duration=LIS2DW12_DEFAULTS_WAKE_UP_DURATION, sleep_duration=LIS2DW12_DEFAULTS_SLEEP_DURATION, unused1=0):
835
+ def __init__(self, raw='', module_type=MODULE_CUSTOM, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, motion_sensitivity_threshold=LIS2DW12_DEFAULTS_STATE_THRESHOLD, s2d_transition_time=LIS2DW12_DEFAULTS_WAKE_UP_DURATION, d2s_transition_time=LIS2DW12_DEFAULTS_SLEEP_DURATION, unused1=0):
836
836
  self.module_type = module_type
837
837
  self.msg_type = msg_type
838
838
  self.api_version = api_version
839
839
  self.seq_id = seq_id
840
840
  self.brg_mac = brg_mac
841
- self.state_threshold = state_threshold # 31 [mg] resolution
842
- self.wake_up_duration = wake_up_duration # 3 [sec] resolution
843
- self.sleep_duration = sleep_duration # 5 [sec] resolution
841
+ self.motion_sensitivity_threshold = motion_sensitivity_threshold # 31 [mg] resolution
842
+ self.s2d_transition_time = s2d_transition_time # 3 [sec] resolution
843
+ self.d2s_transition_time = d2s_transition_time # 5 [sec] resolution
844
844
  self.unused1 = unused1
845
845
  if raw:
846
846
  self.set(raw)
847
847
 
848
848
  def __repr__(self) -> str:
849
- return "\n==> Packet module_custom_v12 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X} ({self.module_type})"],['msg_type', f"0x{self.msg_type:X} ({self.msg_type})"],['api_version', f"0x{self.api_version:X} ({self.api_version})"],['seq_id', f"0x{self.seq_id:X} ({self.seq_id})"],['brg_mac', f"0x{self.brg_mac:X} ({self.brg_mac})"],['state_threshold', f"0x{self.state_threshold:X} ({self.state_threshold})"],['wake_up_duration', f"0x{self.wake_up_duration:X} ({self.wake_up_duration})"],['sleep_duration', f"0x{self.sleep_duration:X} ({self.sleep_duration})"]], tablefmt="texttable")
849
+ return "\n==> Packet module_custom_v12 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X} ({self.module_type})"],['msg_type', f"0x{self.msg_type:X} ({self.msg_type})"],['api_version', f"0x{self.api_version:X} ({self.api_version})"],['seq_id', f"0x{self.seq_id:X} ({self.seq_id})"],['brg_mac', f"0x{self.brg_mac:X} ({self.brg_mac})"],['motion_sensitivity_threshold', f"0x{self.motion_sensitivity_threshold:X} ({self.motion_sensitivity_threshold})"],['s2d_transition_time', f"0x{self.s2d_transition_time:X} ({self.s2d_transition_time})"],['d2s_transition_time', f"0x{self.d2s_transition_time:X} ({self.d2s_transition_time})"]], tablefmt="texttable")
850
850
 
851
851
  def __eq__(self, other):
852
852
  if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
@@ -855,14 +855,14 @@ class ModuleCustomV12():
855
855
  self.msg_type == other.msg_type and
856
856
  self.api_version == other.api_version and
857
857
  self.brg_mac == other.brg_mac and
858
- self.state_threshold == other.state_threshold and
859
- self.wake_up_duration == other.wake_up_duration and
860
- self.sleep_duration == other.sleep_duration
858
+ self.motion_sensitivity_threshold == other.motion_sensitivity_threshold and
859
+ self.s2d_transition_time == other.s2d_transition_time and
860
+ self.d2s_transition_time == other.d2s_transition_time
861
861
  )
862
862
  return False
863
863
 
864
864
  def dump(self):
865
- string = bitstruct.pack("u4u4u8u8u48u8u8u8u96", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, ((self.state_threshold-0)//31), ((self.wake_up_duration-0)//3), ((self.sleep_duration-0)//5), self.unused1)
865
+ string = bitstruct.pack("u4u4u8u8u48u8u8u8u96", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, ((self.motion_sensitivity_threshold-0)//31), ((self.s2d_transition_time-0)//3), ((self.d2s_transition_time-0)//5), self.unused1)
866
866
  return string.hex().upper()
867
867
 
868
868
  def set(self, string):
@@ -872,9 +872,9 @@ class ModuleCustomV12():
872
872
  self.api_version = d[2]
873
873
  self.seq_id = d[3]
874
874
  self.brg_mac = d[4]
875
- self.state_threshold = ((d[5]*31)+0)
876
- self.wake_up_duration = ((d[6]*3)+0)
877
- self.sleep_duration = ((d[7]*5)+0)
875
+ self.motion_sensitivity_threshold = ((d[5]*31)+0)
876
+ self.s2d_transition_time = ((d[6]*3)+0)
877
+ self.d2s_transition_time = ((d[7]*5)+0)
878
878
  self.unused1 = d[8]
879
879
 
880
880
  class ModuleCustomV11():
@@ -832,21 +832,21 @@ class ModuleExtSensorsV11():
832
832
  self.unused = d[7]
833
833
 
834
834
  class ModuleCustomV12():
835
- def __init__(self, raw='', module_type=MODULE_CUSTOM, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, state_threshold=LIS2DW12_DEFAULTS_STATE_THRESHOLD, wake_up_duration=LIS2DW12_DEFAULTS_WAKE_UP_DURATION, sleep_duration=LIS2DW12_DEFAULTS_SLEEP_DURATION, unused1=0):
835
+ def __init__(self, raw='', module_type=MODULE_CUSTOM, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, motion_sensitivity_threshold=LIS2DW12_DEFAULTS_STATE_THRESHOLD, s2d_transition_time=LIS2DW12_DEFAULTS_WAKE_UP_DURATION, d2s_transition_time=LIS2DW12_DEFAULTS_SLEEP_DURATION, unused1=0):
836
836
  self.module_type = module_type
837
837
  self.msg_type = msg_type
838
838
  self.api_version = api_version
839
839
  self.seq_id = seq_id
840
840
  self.brg_mac = brg_mac
841
- self.state_threshold = state_threshold # 31 [mg] resolution
842
- self.wake_up_duration = wake_up_duration # 3 [sec] resolution
843
- self.sleep_duration = sleep_duration # 5 [sec] resolution
841
+ self.motion_sensitivity_threshold = motion_sensitivity_threshold # 31 [mg] resolution
842
+ self.s2d_transition_time = s2d_transition_time # 3 [sec] resolution
843
+ self.d2s_transition_time = d2s_transition_time # 5 [sec] resolution
844
844
  self.unused1 = unused1
845
845
  if raw:
846
846
  self.set(raw)
847
847
 
848
848
  def __repr__(self) -> str:
849
- return "\n==> Packet module_custom_v12 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X} ({self.module_type})"],['msg_type', f"0x{self.msg_type:X} ({self.msg_type})"],['api_version', f"0x{self.api_version:X} ({self.api_version})"],['seq_id', f"0x{self.seq_id:X} ({self.seq_id})"],['brg_mac', f"0x{self.brg_mac:X} ({self.brg_mac})"],['state_threshold', f"0x{self.state_threshold:X} ({self.state_threshold})"],['wake_up_duration', f"0x{self.wake_up_duration:X} ({self.wake_up_duration})"],['sleep_duration', f"0x{self.sleep_duration:X} ({self.sleep_duration})"]], tablefmt="texttable")
849
+ return "\n==> Packet module_custom_v12 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X} ({self.module_type})"],['msg_type', f"0x{self.msg_type:X} ({self.msg_type})"],['api_version', f"0x{self.api_version:X} ({self.api_version})"],['seq_id', f"0x{self.seq_id:X} ({self.seq_id})"],['brg_mac', f"0x{self.brg_mac:X} ({self.brg_mac})"],['motion_sensitivity_threshold', f"0x{self.motion_sensitivity_threshold:X} ({self.motion_sensitivity_threshold})"],['s2d_transition_time', f"0x{self.s2d_transition_time:X} ({self.s2d_transition_time})"],['d2s_transition_time', f"0x{self.d2s_transition_time:X} ({self.d2s_transition_time})"]], tablefmt="texttable")
850
850
 
851
851
  def __eq__(self, other):
852
852
  if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
@@ -855,14 +855,14 @@ class ModuleCustomV12():
855
855
  self.msg_type == other.msg_type and
856
856
  self.api_version == other.api_version and
857
857
  self.brg_mac == other.brg_mac and
858
- self.state_threshold == other.state_threshold and
859
- self.wake_up_duration == other.wake_up_duration and
860
- self.sleep_duration == other.sleep_duration
858
+ self.motion_sensitivity_threshold == other.motion_sensitivity_threshold and
859
+ self.s2d_transition_time == other.s2d_transition_time and
860
+ self.d2s_transition_time == other.d2s_transition_time
861
861
  )
862
862
  return False
863
863
 
864
864
  def dump(self):
865
- string = bitstruct.pack("u4u4u8u8u48u8u8u8u96", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, ((self.state_threshold-0)//31), ((self.wake_up_duration-0)//3), ((self.sleep_duration-0)//5), self.unused1)
865
+ string = bitstruct.pack("u4u4u8u8u48u8u8u8u96", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, ((self.motion_sensitivity_threshold-0)//31), ((self.s2d_transition_time-0)//3), ((self.d2s_transition_time-0)//5), self.unused1)
866
866
  return string.hex().upper()
867
867
 
868
868
  def set(self, string):
@@ -872,9 +872,9 @@ class ModuleCustomV12():
872
872
  self.api_version = d[2]
873
873
  self.seq_id = d[3]
874
874
  self.brg_mac = d[4]
875
- self.state_threshold = ((d[5]*31)+0)
876
- self.wake_up_duration = ((d[6]*3)+0)
877
- self.sleep_duration = ((d[7]*5)+0)
875
+ self.motion_sensitivity_threshold = ((d[5]*31)+0)
876
+ self.s2d_transition_time = ((d[6]*3)+0)
877
+ self.d2s_transition_time = ((d[7]*5)+0)
878
878
  self.unused1 = d[8]
879
879
 
880
880
  class ModuleCustomV11():
@@ -63,7 +63,7 @@ tr:nth-child(odd) {
63
63
  <tr><td>set_interface_id</td><td>sii</td><td>1</td><td></td><td></td></tr>
64
64
  <tr><td>get_interface_id</td><td>gii</td><td>0</td><td></td><td>!get_interface_id</td></tr>
65
65
  <tr><td>set_pkt_filter</td><td>pf</td><td>1</td><td>Sets the packet filter configuration according to the first argument without decode</td><td>!pf 0</td></tr>
66
- <tr><td>set_accel_cfg</td><td>sac</td><td>1, 3</td><td>Sets the lis2dw12 accelerometer configuration - (state_threshold) (wake_up_duration) (sleep_duration)</td><td>!sdw12c 1 30 30</td></tr>
66
+ <tr><td>set_accel_cfg</td><td>sac</td><td>1, 3</td><td>Sets the lis2dw12 accelerometer configuration - (motion_sensitivity_threshold) (s2d_transition_time) (d2s_transition_time)</td><td>!sdw12c 1 30 30</td></tr>
67
67
  <tr><td>get_accel_cfg</td><td>gac</td><td>0</td><td>Request the bridge to provide the embedded lis2dw12 accelerometer configuration</td><td>!gdw12c</td></tr>
68
68
  <tr><td>uart_sim</td><td>us</td><td>4</td><td>BLE chip sends pkts over the UART. Format: (amount of packets) (time interval in MS between packets) (packets origin [p6-pkt, p7-extended_pkt]) (packet data)</td><td>!us 1000 10 p0 1E16...</td></tr>
69
69
  <tr><td>connectivity_status</td><td>cs</td><td>2</td><td>Reports on WiFi (first argument) and MQTT (second argument) connectivity status</td><td>!connectivity_status 1 1</td></tr>
@@ -5790,9 +5790,9 @@ table, th, td {
5790
5790
  </table>
5791
5791
  <table style="width:1600px;">
5792
5792
  <tr><td style="color:navy;">brg mac <span style="color:teal;"></span></td>
5793
- <td style="color:navy;">state threshold <span style="color:teal;">(1953)</span></td>
5794
- <td style="color:navy;">wake up duration <span style="color:teal;">(189)</span></td>
5795
- <td style="color:navy;">sleep duration <span style="color:teal;">(75)</span></td>
5793
+ <td style="color:navy;">motion sensitivity threshold <span style="color:teal;">(1953)</span></td>
5794
+ <td style="color:navy;">s2d transition time <span style="color:teal;">(189)</span></td>
5795
+ <td style="color:navy;">d2s transition time <span style="color:teal;">(75)</span></td>
5796
5796
  <td style="color:navy;">unused1 <span style="color:teal;"></span></td>
5797
5797
  </tr>
5798
5798
  <tr><td style="width:200px;color:blue;">8 bits <span style="color:darkorchid;">(byte 3)</span></td>