wiliot-certificate 1.5.1a1__py3-none-any.whl → 1.5.2a1__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 (98) hide show
  1. brg_certificate/ag/wlt_cmd_if.html +3 -2
  2. brg_certificate/brg_certificate_cli.py +18 -3
  3. brg_certificate/cert_common.py +82 -26
  4. brg_certificate/cert_data_sim.py +22 -4
  5. brg_certificate/cert_defines.py +10 -5
  6. brg_certificate/cert_gw_sim.py +4 -2
  7. brg_certificate/cert_mqtt.py +7 -6
  8. brg_certificate/cert_prints.py +14 -1
  9. brg_certificate/cert_protobuf.py +7 -7
  10. brg_certificate/cert_results.py +91 -64
  11. brg_certificate/cert_utils.py +9 -4
  12. brg_certificate/certificate_bcc_sanity_test_list.txt +10 -5
  13. brg_certificate/certificate_bcc_test_list.txt +14 -9
  14. brg_certificate/certificate_sanity_test_list.txt +10 -4
  15. brg_certificate/certificate_test_list.txt +13 -9
  16. brg_certificate/tests/calibration/interval_test/interval_test.json +2 -2
  17. brg_certificate/tests/calibration/output_power_test/output_power_test.json +3 -2
  18. brg_certificate/tests/calibration/pattern_test/pattern_test.json +2 -2
  19. brg_certificate/tests/calibration/pattern_test/pattern_test.py +25 -26
  20. brg_certificate/tests/datapath/aging_test/aging_test.json +4 -5
  21. brg_certificate/tests/datapath/aging_test/aging_test.py +39 -32
  22. brg_certificate/tests/datapath/num_of_tags_test/num_of_tags_test.json +2 -2
  23. brg_certificate/tests/datapath/num_of_tags_test/num_of_tags_test.py +12 -11
  24. brg_certificate/tests/datapath/output_power_test/output_power_test.json +2 -2
  25. brg_certificate/tests/datapath/output_power_test/output_power_test.py +2 -1
  26. brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.json +3 -3
  27. brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +6 -3
  28. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.json +2 -2
  29. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.py +6 -3
  30. brg_certificate/tests/datapath/pacer_interval_test/pacer_interval_test.json +2 -2
  31. brg_certificate/tests/datapath/pacer_interval_test/pacer_interval_test.py +4 -2
  32. brg_certificate/tests/datapath/pattern_test/pattern_test.json +2 -2
  33. brg_certificate/tests/datapath/pattern_test/pattern_test.py +2 -1
  34. brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.json +3 -3
  35. brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +12 -5
  36. brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.json +2 -2
  37. brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.py +11 -6
  38. brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.json +2 -2
  39. brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.py +11 -7
  40. brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.json +3 -3
  41. brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.py +7 -5
  42. brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.json +2 -2
  43. brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.py +7 -3
  44. brg_certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.json +3 -3
  45. brg_certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +107 -73
  46. brg_certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.json +3 -3
  47. brg_certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.py +128 -118
  48. brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.json +8 -8
  49. brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.py +102 -101
  50. brg_certificate/tests/datapath/stress_test/stress_test.json +14 -15
  51. brg_certificate/tests/datapath/stress_test/stress_test.py +102 -101
  52. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.json +2 -2
  53. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.py +7 -2
  54. brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.json +2 -2
  55. brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.py +8 -6
  56. brg_certificate/tests/edge_mgmt/actions_test/actions_test.json +2 -2
  57. brg_certificate/tests/edge_mgmt/actions_test/actions_test.py +2 -18
  58. brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.json +14 -8
  59. brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.json +13 -8
  60. brg_certificate/tests/edge_mgmt/leds_test/leds_test.json +2 -2
  61. brg_certificate/tests/edge_mgmt/leds_test/leds_test.py +22 -9
  62. brg_certificate/tests/edge_mgmt/ota_test/ota_test.json +2 -2
  63. brg_certificate/tests/edge_mgmt/ota_test/ota_test.py +6 -5
  64. brg_certificate/tests/edge_mgmt/{stat_test/stat_test.json → periodic_msgs_test/periodic_msgs_test.json} +3 -3
  65. brg_certificate/tests/edge_mgmt/{stat_test/stat_test.py → periodic_msgs_test/periodic_msgs_test.py} +4 -4
  66. brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.json +3 -3
  67. brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.py +2 -1
  68. brg_certificate/tests/energy2400/output_power_test/output_power_test.json +4 -3
  69. brg_certificate/tests/energy2400/output_power_test/output_power_test.py +2 -1
  70. brg_certificate/tests/energy2400/pattern_test/pattern_test.json +3 -3
  71. brg_certificate/tests/energy2400/pattern_test/pattern_test.py +2 -1
  72. brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.json +5 -5
  73. brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.py +109 -112
  74. brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.json +5 -5
  75. brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.py +111 -114
  76. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.json +12 -6
  77. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.py +45 -57
  78. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +4 -4
  79. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +158 -172
  80. brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.json +2 -2
  81. brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.py +2 -1
  82. brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.json +4 -3
  83. brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.py +2 -1
  84. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.json +13 -7
  85. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.py +117 -124
  86. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.json +2 -2
  87. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.py +2 -1
  88. brg_certificate/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.json +18 -0
  89. brg_certificate/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.py +84 -0
  90. brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.json +21 -0
  91. brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +306 -0
  92. brg_certificate/wlt_types.py +2 -1
  93. {wiliot_certificate-1.5.1a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/METADATA +40 -40
  94. {wiliot_certificate-1.5.1a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/RECORD +98 -94
  95. {wiliot_certificate-1.5.1a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/WHEEL +1 -1
  96. {wiliot_certificate-1.5.1a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/entry_points.txt +0 -0
  97. {wiliot_certificate-1.5.1a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/licenses/LICENSE +0 -0
  98. {wiliot_certificate-1.5.1a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/top_level.txt +0 -0
@@ -3,60 +3,32 @@ from brg_certificate.cert_defines import *
3
3
  from brg_certificate.wlt_types import *
4
4
  import brg_certificate.cert_common as cert_common
5
5
  import brg_certificate.cert_config as cert_config
6
- import random
7
6
 
8
7
  # Test Description:
9
8
  # This test is to verify the functionality of both signal indicator tx (tx_brg) and rx (rx_brg) at BRG level.
10
9
  # rssi_threshold = phase 0 , check the if rssi value is between 0 to -25.
11
- # brg0_rx_brg1_tx = phase 1+2
12
- # phase 1 - One BRG will be configured as signal indicator tx, and the other as signal indicator rx, and we expect to see signal indicator packets only from the rx BRG according to the tx params (repetition and cycle params).
10
+ # brg0_rx_brg1_tx = phase 1+2
11
+ # phase 1 - One BRG will be configured as signal indicator tx, and the other as signal indicator rx,
12
+ # and we expect to see signal indicator packets only from the rx BRG according to the tx params (repetition and cycle params).
13
13
  # phase 2 - Same as phase 1, but with different tx params configured.
14
- # brg0_none_brg1_rx = phase 3 - One rx BRG without any tx BRG. We don't expect to see any signal indicator packets. This phase is to verify the brg module logic is working properly, and no tag packet is accidentally being treated as signal indicator packet.
15
- # brg0_rxtx_brg1_rxtx = phase 4 - Both BRG's will be configured to be transmitters and receivers, with different tx params for each one. we expect
16
- # to see signal indicator packets from both BRG's, according to the tx params.
17
- # brg0_tx_brg1_none = phase 5 - One BRG will be configured as signal indicator tx, but no rx, so we don't expect to receive signal indicatopr packets.
14
+ # brg0_none_brg1_rx = phase 3 - One rx BRG without any tx BRG. We don't expect to see any signal indicator packets.
15
+ # This phase is to verify the brg module logic is working properly,
16
+ # and no tag packet is accidentally being treated as signal indicator packet.
17
+ # brg0_rxtx_brg1_rxtx = phase 4 - Both BRG's will be configured to be transmitters and receivers, with different tx params for each one.
18
+ # we expect to see signal indicator packets from both BRG's, according to the tx params.
19
+ # brg0_tx_brg1_none = phase 5 - One BRG will be configured as signal indicator tx,
20
+ # but no rx, so we don't expect to receive signal indicator packets.
18
21
  # that way we can assure the logic within the receiver is not confused by the signal indicator uuid as external sensor.
19
22
 
20
23
  # Test MACROS #
21
- DEFAULT_HDR = ag.Hdr(group_id=ag.GROUP_ID_GW2BRG)
22
- NUM_OF_SCANNING_tx_signal_ind_cycle = 2
24
+ NUM_OF_TX_CYCLES = 2
23
25
  DEFAULT_SCAN_TIME = 60
24
26
  SCAN_DELAY_TIME = 5
25
- BOARD_TYPES_2_POLARIZATION_ANT_LIST = [ag.BOARD_TYPE_MINEW_SINGLE_BAND_V0, ag.BOARD_TYPE_MINEW_DUAL_BAND_V0, ag.BOARD_TYPE_ENERGOUS_V2, ag.BOARD_TYPE_ERM_V0, ag.BOARD_TYPE_ERM_V1]
26
27
  BLE4_LISTEN_PERIOD = 15
27
28
  BLE4_BROADCAST_DURATION = BLE4_LISTEN_PERIOD + 1
28
29
 
29
- # Test functions #
30
- def mqtt_scan_n_create_log_file(test, duration, phase):
31
- test.mqttc.flush_pkts()
32
- mqtt_scan_wait(test, duration=duration)
33
- generate_log_file(test, f"{phase}")
34
-
35
- def get_all_signal_ind_pkt(test=None, rx_brg=None, tx_brg=None):
36
- if rx_brg == test.brg1:
37
- all_sensor_packets = cert_mqtt.get_all_brg1_ext_sensor_pkts(mqttc=test.mqttc, test=test)
38
- elif rx_brg == test.brg0:
39
- all_sensor_packets = cert_mqtt.get_all_sensor_pkts(mqttc=test.mqttc, test=test)
40
- signal_ind_pkts = []
41
- for p in all_sensor_packets:
42
- if p[SENSOR_UUID] == "{:06X}".format(ag.SENSOR_SERVICE_ID_SIGNAL_INDICATOR) and p[BRIDGE_ID] == rx_brg.id_str and (p[SENSOR_ID] == tx_brg.id_alias or hex_str2int(p[SENSOR_ID]) == tx_brg.id_str):
43
- signal_ind_pkts.append(p)
44
- return signal_ind_pkts
45
-
46
- def expected_signal_ind_pkts_calc(tx_brg, rx_brg):
47
- if (tx_brg.board_type in BOARD_TYPES_2_POLARIZATION_ANT_LIST):
48
- tx_brg_ant_polarization_num = 2
49
- else:
50
- tx_brg_ant_polarization_num = 1
51
- if (rx_brg.board_type in BOARD_TYPES_2_POLARIZATION_ANT_LIST):
52
- rx_brg_ant_polarization_num = 2
53
- result = [(NUM_OF_SCANNING_tx_signal_ind_cycle * tx_brg_ant_polarization_num * rx_brg_ant_polarization_num) - 1,
54
- NUM_OF_SCANNING_tx_signal_ind_cycle * tx_brg_ant_polarization_num * rx_brg_ant_polarization_num]
55
- else:
56
- rx_brg_ant_polarization_num = 1
57
- result = [NUM_OF_SCANNING_tx_signal_ind_cycle * tx_brg_ant_polarization_num * rx_brg_ant_polarization_num]
58
- return result
59
30
 
31
+ # Test functions #
60
32
  def terminate_test(test, phase, revert_rx_brg=False, revert_tx_brg=False, modules=[]):
61
33
  # Temp solution for internal_brg test because test_epilog doesn't support both internal brg and test.brgs
62
34
  utPrint(f"Terminating test (phase={phase})!!!!!!!!\n", "BLUE")
@@ -68,7 +40,7 @@ def terminate_test(test, phase, revert_rx_brg=False, revert_tx_brg=False, module
68
40
  if response == NO_RESPONSE and test.exit_on_param_failure:
69
41
  test.rc = TEST_FAILED
70
42
  test.add_reason(f"BRG {test.brg1.id_str} didn't revert modules "
71
- f"{restore_modules} to default configuration!")
43
+ f"{restore_modules} to default configuration!")
72
44
 
73
45
  if revert_tx_brg:
74
46
  restore_modules = [modules[0]] if (test.internal_brg or phase != 4) else modules
@@ -78,40 +50,42 @@ def terminate_test(test, phase, revert_rx_brg=False, revert_tx_brg=False, module
78
50
  if response == NO_RESPONSE and test.exit_on_param_failure:
79
51
  test.rc = TEST_FAILED
80
52
  test.add_reason(f"BRG {test.brg0.id_str} didn't revert modules"
81
- f"{restore_modules} to default configuration!")
53
+ f"{restore_modules} to default configuration!")
82
54
  return cert_common.test_epilog(test)
83
55
 
56
+
84
57
  def brg0_tx_brg1_none(test, energy2400_module, ext_sensors_module, tx_brg_, rx_brg_, modules):
85
58
  datapath_module = eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}')
86
59
 
87
60
  # Phase 5 - Tx BRG without rx. just waiting for packets to be sent from the transmitter and verify
88
61
  # The receiver isn't receiving any signal indicator packets.
89
- phase = "brg0_tx_brg1_none"
62
+ phase = "brg0_tx_brg1_none"
90
63
  tx_signal_ind_cycle = 15
91
- tx_signal_ind_rep = 1
64
+ tx_signal_ind_rep = 1
92
65
  utPrint(f"TX BRG without RX - cycle = {tx_signal_ind_cycle}, repetition = {tx_signal_ind_rep}\n", "BLUE")
93
66
  # restore default configuration for receiver #
94
67
  utPrint(f"Configuring BRG {rx_brg_.id_str} to default", "BOLD")
95
68
  restore_modules = [modules[1]] if (test.internal_brg) else modules
96
69
  test = cert_config.config_brg1_defaults(test, modules=restore_modules, ble5=True)[0]
97
- print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
70
+ print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
98
71
  if test.rc == TEST_FAILED and test.exit_on_param_failure:
99
72
  test.add_reason(f"BRG {rx_brg_.id_str}: didn't revert to default configuration!")
100
73
 
101
74
  # configuring transmitter #
102
75
  utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
103
- test = cert_config.brg1_configure(test=test, module=energy2400_module, fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP], values=[tx_signal_ind_cycle, tx_signal_ind_rep], ble5=True)[0]
76
+ test = cert_config.brg1_configure(test=test, module=energy2400_module, fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP],
77
+ values=[tx_signal_ind_cycle, tx_signal_ind_rep], ble5=True)[0]
104
78
  if test.rc == TEST_FAILED:
105
79
  test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
106
80
 
107
- print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
81
+ print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
108
82
  utPrint(f"BRG {tx_brg_.id_str} configured to be transmitter - cycle = {tx_signal_ind_cycle},"
109
83
  f"repetition = {tx_signal_ind_rep}", "BOLD")
110
84
 
111
85
  # phase analysis #
112
- mqtt_scan_n_create_log_file(test, (NUM_OF_SCANNING_tx_signal_ind_cycle*tx_signal_ind_cycle) + SCAN_DELAY_TIME, phase)
86
+ mqtt_scan_n_create_log_file(test, (NUM_OF_TX_CYCLES * tx_signal_ind_cycle) + SCAN_DELAY_TIME, phase)
113
87
  expected_signal_ind_pkts = [0]
114
- received_signal_ind_pkts = get_all_signal_ind_pkt(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
88
+ received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
115
89
  if len(received_signal_ind_pkts) not in expected_signal_ind_pkts:
116
90
  test.rc = TEST_FAILED
117
91
  test.add_reason(f"Phase {phase} failed - received signal indicator packet from BRG {rx_brg_.id_str}")
@@ -132,59 +106,69 @@ def brg0_tx_brg1_none(test, energy2400_module, ext_sensors_module, tx_brg_, rx_b
132
106
  # Test epilog
133
107
  return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
134
108
 
109
+
135
110
  def brg0_rxtx_brg1_rxtx(test, energy2400_module, ext_sensors_module, tx_brg_, rx_brg_, modules):
136
111
  phase = "brg0_rxtx_brg1_rxtx"
137
112
 
138
113
  if not test.internal_brg:
139
114
  # Phase 4 - Both BRG's will be configured to be transmitters and receivers, with different tx params for each one.
140
115
  # expecting to see signal indicator packets from both BRG's, according to the tx params.
141
- utPrint(f"Both BRG's are transmitter and receivers, with different values\n", "BLUE")
116
+ utPrint("Both BRG's are transmitter and receivers, with different values\n", "BLUE")
142
117
 
143
118
  # configuring first BRG (tx_brg_) #
144
119
  tx_brg_signal_indicator_cycle = 15
145
120
  tx_brg_signal_indicator_rep = 3
146
121
  # configuring first brg (tx_brg_) as receiver
147
122
  utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Receiver", "BOLD")
148
- cert_config.brg_configure_ble5(test=test, module=ext_sensors_module, fields=[BRG_SENSOR0], values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR], wait=False)
149
- print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
123
+ cert_config.brg_configure_ble5(test=test, module=ext_sensors_module, fields=[BRG_SENSOR0],
124
+ values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR], wait=False)
125
+ print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
150
126
  utPrint(f"BRG {tx_brg_.id_str} successfully configured as Signal Indicator Receiver\n", "BOLD")
151
-
127
+
152
128
  # configuring transmitter #
153
129
  utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
154
- test = cert_config.brg_configure(test=test, module=energy2400_module, fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP], values=[tx_brg_signal_indicator_cycle, tx_brg_signal_indicator_rep])[0]
130
+ test = cert_config.brg_configure(test=test, module=energy2400_module,
131
+ fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP],
132
+ values=[tx_brg_signal_indicator_cycle, tx_brg_signal_indicator_rep])[0]
155
133
  if test.rc == TEST_FAILED:
156
134
  test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
157
135
 
158
- print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
136
+ print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
159
137
  utPrint(f"BRG {tx_brg_.id_str} configured to be transmitter - cycle = {tx_brg_signal_indicator_cycle},"
160
138
  f"repetition = {tx_brg_signal_indicator_rep}", "BOLD")
161
139
 
162
140
  # configuring second brg (rx_brg_) as receiver
163
141
  utPrint(f"Configuring BRG {rx_brg_.id_str} as Signal Indicator Receiver", "BOLD")
164
- test = cert_config.brg1_configure(test=test, module=ext_sensors_module, fields=[BRG_SENSOR0], values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR], ble5=True)[0]
165
- print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
142
+ test = cert_config.brg1_configure(test=test, module=ext_sensors_module,
143
+ fields=[BRG_SENSOR0], values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR], ble5=True)[0]
144
+ print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
166
145
  utPrint(f"BRG {rx_brg_.id_str} successfully configured as Signal Indicator Receiver\n", "BOLD")
167
-
146
+
168
147
  # configuring second brg (rx_brg_) as transmitter
169
148
  utPrint(f"Configuring BRG {rx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
170
- rx_brg_signal_indicator_cycle = 15
149
+ rx_brg_signal_indicator_cycle = 15
171
150
  rx_brg_signal_indicator_rep = 4
172
- test = cert_config.brg1_configure(test=test, module=energy2400_module, fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP], values=[rx_brg_signal_indicator_cycle, rx_brg_signal_indicator_rep], ble5=True)[0]
173
- print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
151
+ test = cert_config.brg1_configure(test=test, module=energy2400_module,
152
+ fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP],
153
+ values=[rx_brg_signal_indicator_cycle, rx_brg_signal_indicator_rep], ble5=True)[0]
154
+ print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
174
155
  if test.rc == TEST_FAILED:
175
156
  test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
176
157
  utPrint(f"BRG {tx_brg_.id_str} configured to be transmitter - cycle = {rx_brg_signal_indicator_cycle},"
177
158
  f"repetition = {rx_brg_signal_indicator_rep}")
178
-
159
+
179
160
  # phase analysis #
180
- mqtt_scan_n_create_log_file(test, NUM_OF_SCANNING_tx_signal_ind_cycle * max(tx_brg_signal_indicator_cycle, rx_brg_signal_indicator_cycle) + SCAN_DELAY_TIME, phase)
181
-
161
+ mqtt_scan_n_create_log_file(test,
162
+ NUM_OF_TX_CYCLES * max(tx_brg_signal_indicator_cycle, rx_brg_signal_indicator_cycle) + SCAN_DELAY_TIME,
163
+ phase)
164
+
182
165
  # Analyzing tx_brg_ performance as receiver
183
166
  utPrint(f"Analyzing tx_brg {tx_brg_.id_str} performance as a Receiver\n", "BOLD")
184
167
  rx_brg_tx_cycles = max(tx_brg_signal_indicator_cycle, rx_brg_signal_indicator_cycle) / rx_brg_signal_indicator_cycle
185
- expected_signal_ind_pkts = [int(x * rx_brg_tx_cycles) for x in expected_signal_ind_pkts_calc(rx_brg_, tx_brg_)]
186
- received_signal_ind_pkts = get_all_signal_ind_pkt(test=test, rx_brg=tx_brg_, tx_brg=rx_brg_)
187
- txt = f"""Phase {phase} - BRG {tx_brg_.id_str} signal indicator packets: received {len(received_signal_ind_pkts)} packets, expected {expected_signal_ind_pkts} packets"""
168
+ expected_signal_ind_pkts = [int(x * rx_brg_tx_cycles) for x in cert_common.exp_sig_ind_pkts(rx_brg_, tx_brg_, NUM_OF_TX_CYCLES)]
169
+ received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=tx_brg_, tx_brg=rx_brg_)
170
+ txt = f"""Phase {phase} - BRG {tx_brg_.id_str} signal indicator packets: received {len(received_signal_ind_pkts)} packets,"
171
+ " expected {expected_signal_ind_pkts} packets"""
188
172
  print(txt)
189
173
  if len(received_signal_ind_pkts) not in expected_signal_ind_pkts:
190
174
  test.rc = TEST_FAILED
@@ -193,16 +177,18 @@ def brg0_rxtx_brg1_rxtx(test, energy2400_module, ext_sensors_module, tx_brg_, rx
193
177
  # Analyzing rx_brg_ performance as receiver
194
178
  utPrint(f"Analyzing rx_brg {rx_brg_.id_str} performance as a Receiver\n", "BOLD")
195
179
  tx_brg_tx_cycles = max(tx_brg_signal_indicator_cycle, rx_brg_signal_indicator_cycle) / tx_brg_signal_indicator_cycle
196
- expected_signal_ind_pkts = [int(x * tx_brg_tx_cycles) for x in expected_signal_ind_pkts_calc(rx_brg_, tx_brg_)]
197
- received_signal_ind_pkts = get_all_signal_ind_pkt(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
198
- txt = f"""Phase {phase} - BRG {rx_brg_.id_str} signal indicator packets: received {len(received_signal_ind_pkts)} packets, expected {expected_signal_ind_pkts} packets"""
180
+ expected_signal_ind_pkts = [int(x * tx_brg_tx_cycles) for x in cert_common.exp_sig_ind_pkts(rx_brg_, tx_brg_)]
181
+ received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
182
+ txt = f"""Phase {phase} - BRG {rx_brg_.id_str} signal indicator packets: received {len(received_signal_ind_pkts)}"
183
+ " packets, expected {expected_signal_ind_pkts} packets"""
199
184
  print(txt)
200
185
  if len(received_signal_ind_pkts) not in expected_signal_ind_pkts:
201
186
  test.rc = TEST_FAILED
202
187
  test.add_reason(txt)
203
188
  else:
204
189
  test.add_reason("skip for internal BRG")
205
- return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
190
+ return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
191
+
206
192
 
207
193
  def brg0_none_brg1_rx(test, energy2400_module, ext_sensors_module, tx_brg_, rx_brg_, modules):
208
194
  phase = "brg0_none_brg1_rx"
@@ -210,102 +196,113 @@ def brg0_none_brg1_rx(test, energy2400_module, ext_sensors_module, tx_brg_, rx_b
210
196
  tx_signal_ind_cycle = ag.BRG_DEFAULT_SIGNAL_INDICATOR_CYCLE
211
197
  tx_signal_ind_rep = ag.BRG_DEFAULT_SIGNAL_INDICATOR_REP
212
198
  utPrint(f"RX BRG without TX- cycle = {tx_signal_ind_cycle}, repetition = {tx_signal_ind_rep}\n", "BLUE")
213
-
199
+
214
200
  # configuring transmitter #
215
201
  utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
216
- test = cert_config.brg1_configure(test=test, module=energy2400_module, fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP], values=[tx_signal_ind_cycle, tx_signal_ind_rep],ble5=True)[0]
217
- print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
202
+ test = cert_config.brg1_configure(test=test, module=energy2400_module, fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP],
203
+ values=[tx_signal_ind_cycle, tx_signal_ind_rep], ble5=True)[0]
204
+ print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
218
205
  if test.rc == TEST_FAILED:
219
- test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
206
+ test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
220
207
  utPrint(f"BRG {tx_brg_.id_str} configured to default!!! cycle = {tx_signal_ind_cycle},"f"repetition = {tx_signal_ind_rep}", "BOLD")
221
-
208
+
222
209
  # phase analysis #
223
210
  mqtt_scan_n_create_log_file(test, DEFAULT_SCAN_TIME, phase)
224
211
  expected_signal_ind_pkts = [0]
225
- received_signal_ind_pkts = get_all_signal_ind_pkt(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
212
+ received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
226
213
  if len(received_signal_ind_pkts) not in expected_signal_ind_pkts:
227
214
  test.rc = TEST_FAILED
228
215
  test.add_reason(f"Phase {phase} failed - received signal indicator packet from BRG"
229
- f"{rx_brg_.id_str}")
216
+ f"{rx_brg_.id_str}")
230
217
  return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
231
218
 
219
+
232
220
  def brg0_rx_brg1_tx(test, energy2400_module, ext_sensors_module, tx_brg_, rx_brg_, modules):
233
221
  phase = "brg0_rx_brg1_tx"
234
- cycle_rep = [(30,3), (60,4)]
222
+ cycle_rep = [(30, 3), (60, 4)]
235
223
  for tx_signal_ind_cycle, tx_signal_ind_rep in cycle_rep:
236
224
 
237
225
  utPrint(f"TX BRG with RX- cycle = {tx_signal_ind_cycle}, repetition = {tx_signal_ind_rep}\n", "BLUE")
238
226
  # configuring receiver #
239
227
  utPrint(f"Configuring BRG {rx_brg_.id_str} as Signal Indicator Receiver", "BOLD")
240
- test = cert_config.brg_configure(test=test, module=energy2400_module, fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP], values=[tx_signal_ind_cycle, tx_signal_ind_rep])[0]
228
+ test = cert_config.brg_configure(test=test, module=energy2400_module,
229
+ fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP],
230
+ values=[tx_signal_ind_cycle, tx_signal_ind_rep])[0]
241
231
  if test.rc == TEST_FAILED:
242
232
  test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
243
233
 
244
234
  # configuring transmitter #
245
235
  utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
246
- test = cert_config.brg1_configure(test=test, module=energy2400_module, fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP], values=[tx_signal_ind_cycle, tx_signal_ind_rep],ble5=True)[0]
247
- print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
236
+ test = cert_config.brg1_configure(test=test, module=energy2400_module,
237
+ fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP],
238
+ values=[tx_signal_ind_cycle, tx_signal_ind_rep], ble5=True)[0]
239
+ print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
248
240
  if test.rc == TEST_FAILED:
249
241
  test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
250
242
 
251
- utPrint(f"BRG {tx_brg_.id_str} configured to be transmitter - cycle = {tx_signal_ind_cycle},"f"repetition = {tx_signal_ind_rep}", "BOLD")
252
-
243
+ utPrint(f"BRG {tx_brg_.id_str} configured to be transmitter - cycle={tx_signal_ind_cycle}, repetition={tx_signal_ind_rep}", "BOLD")
244
+
253
245
  # phase analysis
254
- mqtt_scan_n_create_log_file(test, (NUM_OF_SCANNING_tx_signal_ind_cycle * tx_signal_ind_cycle) + SCAN_DELAY_TIME, phase)
255
- expected_signal_ind_pkts = expected_signal_ind_pkts_calc(tx_brg_, rx_brg_)
256
- received_signal_ind_pkts = get_all_signal_ind_pkt(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
257
- txt = f"""Phase {phase} - BRG {rx_brg_.id_str} signal indicator packets: received {len(received_signal_ind_pkts)} packets, expected {expected_signal_ind_pkts} packets"""
246
+ mqtt_scan_n_create_log_file(test, (NUM_OF_TX_CYCLES * tx_signal_ind_cycle) + SCAN_DELAY_TIME, phase)
247
+ expected_signal_ind_pkts = cert_common.exp_sig_ind_pkts(tx_brg_, rx_brg_, NUM_OF_TX_CYCLES)
248
+ received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
249
+ txt = f"""Phase {phase} - BRG {rx_brg_.id_str} signal indicator packets: received {len(received_signal_ind_pkts)} packets,"
250
+ expected {expected_signal_ind_pkts} packets"""
258
251
  print(txt)
259
- #TODO: change condition
252
+ # TODO: change condition
260
253
  if len(received_signal_ind_pkts) not in expected_signal_ind_pkts:
261
254
  test.rc = TEST_FAILED
262
255
  test.add_reason(txt)
263
- return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
256
+ return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
257
+
264
258
 
265
259
  def rssi_threshold(test, energy2400_module, ext_sensors_module, tx_brg_, rx_brg_, modules):
266
260
  phase = "rssi_threshold"
267
261
  # RSSI Threshold
268
262
  rssi_threshold = -25
269
263
  tx_signal_ind_cycle = 15
270
- tx_signal_ind_rep = 3
264
+ tx_signal_ind_rep = 3
271
265
  utPrint(f"TX BRG with RX- cycle = {tx_signal_ind_cycle}, repetition = {tx_signal_ind_rep}\n", "BLUE")
272
-
266
+
273
267
  # configuring receiver #
274
268
  utPrint(f"Configuring BRG {rx_brg_.id_str} as Signal Indicator Receiver with RSSI Threshold of {rssi_threshold}", "BOLD")
275
- test = cert_config.brg1_configure(test=test, module=ext_sensors_module, fields=[BRG_SENSOR0, BRG_RSSI_THRESHOLD], values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR, rssi_threshold], ble5=True)[0]
276
- print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
269
+ test = cert_config.brg1_configure(test=test, module=ext_sensors_module, fields=[BRG_SENSOR0, BRG_RSSI_THRESHOLD],
270
+ values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR, rssi_threshold], ble5=True)[0]
271
+ print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
277
272
 
278
273
  if test.rc == TEST_FAILED and test.exit_on_param_failure:
279
274
  test.add_reason(f"BRG {rx_brg_.id_str}: didn't receive signal indicator receiver configuration!")
280
-
275
+
281
276
  # configuring transmitter #
282
277
  utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
283
- test = cert_config.brg1_configure(test=test, module=energy2400_module, fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP], values=[tx_signal_ind_cycle, tx_signal_ind_rep],ble5=True)[0]
284
- print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
278
+ test = cert_config.brg1_configure(test=test, module=energy2400_module, fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP],
279
+ values=[tx_signal_ind_cycle, tx_signal_ind_rep], ble5=True)[0]
280
+ print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
285
281
  if test.rc == TEST_FAILED:
286
282
  test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
287
283
 
288
284
  utPrint(f"BRG {tx_brg_.id_str} configured to be transmitter - cycle = {tx_signal_ind_cycle},"
289
285
  f"repetition = {tx_signal_ind_rep}", "BOLD")
290
286
  # phase analysis #
291
- mqtt_scan_n_create_log_file(test, (NUM_OF_SCANNING_tx_signal_ind_cycle * tx_signal_ind_cycle) + SCAN_DELAY_TIME, phase)
292
- received_signal_ind_pkts = get_all_signal_ind_pkt(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
293
- rssi_threshold_viloation_pkts = [p for p in received_signal_ind_pkts if p[RSSI] >= -1*rssi_threshold]
287
+ mqtt_scan_n_create_log_file(test, (NUM_OF_TX_CYCLES * tx_signal_ind_cycle) + SCAN_DELAY_TIME, phase)
288
+ received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
289
+ rssi_threshold_viloation_pkts = [p for p in received_signal_ind_pkts if p[RSSI] >= -1 * rssi_threshold]
294
290
  if rssi_threshold_viloation_pkts:
295
291
  test.rc = TEST_FAILED
296
- test.add_reason(f"rssi_threshold phase failed - BRG {rx_brg_.id_str} echoed" +
297
- f" {len(rssi_threshold_viloation_pkts)} signal indicator packets\n with RSSI weaker than {rssi_threshold}")
292
+ test.add_reason(f"rssi_threshold phase failed - BRG {rx_brg_.id_str} echoed"
293
+ f" {len(rssi_threshold_viloation_pkts)} signal indicator packets\n with RSSI weaker than {rssi_threshold}")
298
294
  field_functionality_pass_fail_print(test, 'phase', phase)
299
-
300
- return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
295
+
296
+ return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
301
297
 
302
298
 
303
299
  SIGNAL_INDICATOR_TEST_MAP = {
304
- "rssi_threshold" : rssi_threshold, # phase 0
305
- "brg0_rx_brg1_tx": brg0_rx_brg1_tx, # phase 1 + 2
306
- "brg0_none_brg1_rx": brg0_none_brg1_rx, # phase 3
307
- "brg0_rxtx_brg1_rxtx": brg0_rxtx_brg1_rxtx, # phase 4, skip for internal brg
308
- "brg0_tx_brg1_none": brg0_tx_brg1_none} # phase 5
300
+ "rssi_threshold": rssi_threshold, # phase 0
301
+ "brg0_rx_brg1_tx": brg0_rx_brg1_tx, # phase 1 + 2
302
+ "brg0_none_brg1_rx": brg0_none_brg1_rx, # phase 3
303
+ "brg0_rxtx_brg1_rxtx": brg0_rxtx_brg1_rxtx, # phase 4, skip for internal brg
304
+ "brg0_tx_brg1_none": brg0_tx_brg1_none} # phase 5
305
+
309
306
 
310
307
  def run(test):
311
308
 
@@ -330,7 +327,7 @@ def run(test):
330
327
  test = cert_config.brg1_configure(test, fields=[BRG_RX_CHANNEL], values=[ag.RX_CHANNEL_10_250K], module=datapath_module)[0]
331
328
  if test.rc == TEST_FAILED and test.exit_on_param_failure:
332
329
  return terminate_test(test, phase=1, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
333
- for param in test.params:
330
+ for param in test.params:
334
331
  functionality_run_print(param.name)
335
332
  test = SIGNAL_INDICATOR_TEST_MAP[param.value](test, energy2400_module, ext_sensors_module, tx_brg_, rx_brg_, modules)
336
333
  generate_log_file(test, param.name)
@@ -341,6 +338,6 @@ def run(test):
341
338
  break
342
339
  else:
343
340
  test.reset_result()
344
-
341
+
345
342
  return cert_common.test_epilog(test, revert_brgs=True, modules=[energy2400_module, ext_sensors_module],
346
- brg1_modules=[energy2400_module, ext_sensors_module])
343
+ brg1_modules=[energy2400_module, ext_sensors_module])
@@ -1,9 +1,9 @@
1
1
  {
2
- "name": "signal_indicator_functionality_ble5_10_500k_test",
3
- "module": "energy2400",
4
- "purpose": "TODO",
2
+ "name": "Signal Indicator BLE5 E4 Pixels",
3
+ "module": "Energizer 2.4GHz",
4
+ "purpose": "verify Energizer 2.4GHz signal indicator functionality for BLE_5.0 in CHANNEL_10 for E4 pixels modulation",
5
5
  "documentation": "https://community.wiliot.com/customers/s/article/Bridge-to-Bridge-Signal-Indicator",
6
- "initialCondition": "",
6
+ "initialCondition": "Bridge configured to defaults",
7
7
  "procedure": ["Test prolog",
8
8
  "rssi_threshold - check the if rssi value is between 0 to -25.",
9
9
  "brg0_rx_brg1_tx - one brg is transmitter and the second is receiver, we expect to get the same values from the receiver, according to the tx params",
@@ -11,7 +11,7 @@
11
11
  "brg0_rxtx_brg1_rxtx - Both BRG's will be configured to be transmitters and receivers, with different tx params for each one. we expect to see signal indicator packets from both BRG's, according to the tx params.",
12
12
  "brg0_tx_brg1_none - One BRG will be configured as signal indicator tx, but no rx, so we don't expect to receive signal indicator packets.",
13
13
  "Test epilog"],
14
- "expectedOutcome": "",
14
+ "expectedOutcome": "All phases passed successfully!",
15
15
  "mandatory": 0,
16
16
  "multiBridgeTest": 1,
17
17
  "gwOnlyTest": 0,