wiliot-certificate 1.5.0a1__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 (124) hide show
  1. brg_certificate/ag/energous_v0_defines.py +17 -17
  2. brg_certificate/ag/energous_v1_defines.py +17 -17
  3. brg_certificate/ag/energous_v2_defines.py +17 -17
  4. brg_certificate/ag/energous_v3_defines.py +17 -17
  5. brg_certificate/ag/energous_v4_defines.py +17 -17
  6. brg_certificate/ag/fanstel_lan_v0_defines.py +17 -17
  7. brg_certificate/ag/fanstel_lte_v0_defines.py +17 -17
  8. brg_certificate/ag/fanstel_wifi_v0_defines.py +17 -17
  9. brg_certificate/ag/minew_lte_v0_defines.py +17 -17
  10. brg_certificate/ag/wlt_cmd_if.html +3 -2
  11. brg_certificate/ag/wlt_types.html +0 -1
  12. brg_certificate/ag/wlt_types_ag.py +151 -152
  13. brg_certificate/brg_certificate.py +38 -7
  14. brg_certificate/brg_certificate_cli.py +19 -3
  15. brg_certificate/cert_common.py +92 -55
  16. brg_certificate/cert_config.py +6 -4
  17. brg_certificate/cert_data_sim.py +47 -7
  18. brg_certificate/cert_defines.py +20 -6
  19. brg_certificate/cert_gw_sim.py +10 -6
  20. brg_certificate/cert_mqtt.py +9 -6
  21. brg_certificate/cert_prints.py +14 -1
  22. brg_certificate/cert_protobuf.py +7 -7
  23. brg_certificate/cert_results.py +131 -84
  24. brg_certificate/cert_utils.py +13 -7
  25. brg_certificate/certificate_bcc_sanity_test_list.txt +40 -0
  26. brg_certificate/certificate_bcc_test_list.txt +50 -0
  27. brg_certificate/certificate_sanity_test_list.txt +12 -5
  28. brg_certificate/certificate_test_list.txt +16 -6
  29. brg_certificate/tests/calibration/interval_test/interval_test.json +4 -3
  30. brg_certificate/tests/calibration/output_power_test/output_power_test.json +8 -5
  31. brg_certificate/tests/calibration/pattern_test/pattern_test.json +7 -4
  32. brg_certificate/tests/calibration/pattern_test/pattern_test.py +25 -26
  33. brg_certificate/tests/datapath/aging_test/aging_test.json +19 -0
  34. brg_certificate/tests/datapath/aging_test/aging_test.py +142 -0
  35. brg_certificate/tests/datapath/num_of_tags_test/num_of_tags_test.json +10 -5
  36. brg_certificate/tests/datapath/num_of_tags_test/num_of_tags_test.py +12 -11
  37. brg_certificate/tests/datapath/output_power_test/output_power_test.json +7 -4
  38. brg_certificate/tests/datapath/output_power_test/output_power_test.py +2 -1
  39. brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.json +8 -5
  40. brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +6 -3
  41. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.json +7 -4
  42. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.py +6 -3
  43. brg_certificate/tests/datapath/pacer_interval_test/pacer_interval_test.json +7 -4
  44. brg_certificate/tests/datapath/pacer_interval_test/pacer_interval_test.py +4 -2
  45. brg_certificate/tests/datapath/pattern_test/pattern_test.json +8 -5
  46. brg_certificate/tests/datapath/pattern_test/pattern_test.py +2 -1
  47. brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.json +11 -5
  48. brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +12 -5
  49. brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.json +10 -4
  50. brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.py +11 -6
  51. brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.json +10 -4
  52. brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.py +11 -7
  53. brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.json +8 -4
  54. brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.py +7 -5
  55. brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.json +7 -4
  56. brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.py +7 -3
  57. brg_certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.json +4 -5
  58. brg_certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +107 -73
  59. brg_certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.json +4 -5
  60. brg_certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.py +128 -118
  61. brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.json +15 -23
  62. brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.py +104 -103
  63. brg_certificate/tests/datapath/stress_test/stress_test.json +15 -23
  64. brg_certificate/tests/datapath/stress_test/stress_test.py +104 -110
  65. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.json +8 -4
  66. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.py +7 -2
  67. brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.json +8 -4
  68. brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.py +8 -6
  69. brg_certificate/tests/edge_mgmt/actions_test/actions_test.json +4 -3
  70. brg_certificate/tests/edge_mgmt/actions_test/actions_test.py +2 -38
  71. brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.json +15 -8
  72. brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.json +14 -8
  73. brg_certificate/tests/edge_mgmt/leds_test/leds_test.json +11 -7
  74. brg_certificate/tests/edge_mgmt/leds_test/leds_test.py +25 -12
  75. brg_certificate/tests/edge_mgmt/ota_test/ota_test.json +11 -7
  76. brg_certificate/tests/edge_mgmt/ota_test/ota_test.py +48 -3
  77. brg_certificate/tests/edge_mgmt/{stat_test/stat_test.json → periodic_msgs_test/periodic_msgs_test.json} +5 -4
  78. brg_certificate/tests/edge_mgmt/{stat_test/stat_test.py → periodic_msgs_test/periodic_msgs_test.py} +4 -4
  79. brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.json +8 -5
  80. brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.py +2 -1
  81. brg_certificate/tests/energy2400/output_power_test/output_power_test.json +9 -6
  82. brg_certificate/tests/energy2400/output_power_test/output_power_test.py +2 -1
  83. brg_certificate/tests/energy2400/pattern_test/pattern_test.json +8 -5
  84. brg_certificate/tests/energy2400/pattern_test/pattern_test.py +2 -1
  85. brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.json +20 -0
  86. brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.py +343 -0
  87. brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.json +20 -0
  88. brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.py +343 -0
  89. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.json +14 -7
  90. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.py +45 -57
  91. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +14 -7
  92. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +198 -125
  93. brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.json +7 -4
  94. brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.py +2 -1
  95. brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.json +13 -6
  96. brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.py +2 -1
  97. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.json +14 -7
  98. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.py +117 -124
  99. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.json +7 -4
  100. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.py +2 -1
  101. brg_certificate/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.json +18 -0
  102. brg_certificate/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.py +84 -0
  103. brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.json +21 -0
  104. brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +306 -0
  105. brg_certificate/wltPb_pb2.py +15 -15
  106. brg_certificate/wltPb_pb2.pyi +8 -2
  107. brg_certificate/wlt_types.py +2 -1
  108. gw_certificate/cert_results.py +11 -4
  109. gw_certificate/gw_certificate.py +0 -2
  110. gw_certificate/gw_certificate_cli.py +3 -3
  111. gw_certificate/interface/uart_if.py +1 -1
  112. gw_certificate/tests/actions.py +7 -1
  113. gw_certificate/tests/registration.py +2 -1
  114. gw_certificate/tests/uplink.py +26 -35
  115. {wiliot_certificate-1.5.0a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/METADATA +46 -42
  116. {wiliot_certificate-1.5.0a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/RECORD +120 -112
  117. {wiliot_certificate-1.5.0a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/WHEEL +1 -1
  118. brg_certificate/tests/datapath/adaptive_pacer_algo_test/adaptive_pacer_algo_test.json +0 -13
  119. brg_certificate/tests/datapath/adaptive_pacer_algo_test/adaptive_pacer_algo_test.py +0 -76
  120. brg_certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.json +0 -13
  121. brg_certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.py +0 -398
  122. {wiliot_certificate-1.5.0a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/entry_points.txt +0 -0
  123. {wiliot_certificate-1.5.0a1.dist-info → wiliot_certificate-1.5.2a1.dist-info/licenses}/LICENSE +0 -0
  124. {wiliot_certificate-1.5.0a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,343 @@
1
+ from brg_certificate.cert_prints import *
2
+ from brg_certificate.cert_defines import *
3
+ from brg_certificate.wlt_types import *
4
+ import brg_certificate.cert_common as cert_common
5
+ import brg_certificate.cert_config as cert_config
6
+
7
+ # Test Description:
8
+ # This test is to verify the functionality of both signal indicator tx (tx_brg) and rx (rx_brg) at BRG level.
9
+ # rssi_threshold = phase 0 , check the if rssi value is between 0 to -25.
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
+ # 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.
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.
21
+ # that way we can assure the logic within the receiver is not confused by the signal indicator uuid as external sensor.
22
+
23
+ # Test MACROS #
24
+ NUM_OF_TX_CYCLES = 2
25
+ DEFAULT_SCAN_TIME = 60
26
+ SCAN_DELAY_TIME = 5
27
+ BLE4_LISTEN_PERIOD = 15
28
+ BLE4_BROADCAST_DURATION = BLE4_LISTEN_PERIOD + 1
29
+
30
+
31
+ # Test functions #
32
+ def terminate_test(test, phase, revert_rx_brg=False, revert_tx_brg=False, modules=[]):
33
+ # Temp solution for internal_brg test because test_epilog doesn't support both internal brg and test.brgs
34
+ utPrint(f"Terminating test (phase={phase})!!!!!!!!\n", "BLUE")
35
+ if revert_rx_brg:
36
+ restore_modules = [modules[1]] if (test.internal_brg or phase != 4) else modules
37
+ restore_modules.append(eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}'))
38
+ utPrint(f"reverting rx_brg {test.brg1.id_str} to defaults\n", "BOLD")
39
+ test, response = cert_config.config_brg1_defaults(test, modules=restore_modules, ble5=True)
40
+ if response == NO_RESPONSE and test.exit_on_param_failure:
41
+ test.rc = TEST_FAILED
42
+ test.add_reason(f"BRG {test.brg1.id_str} didn't revert modules "
43
+ f"{restore_modules} to default configuration!")
44
+
45
+ if revert_tx_brg:
46
+ restore_modules = [modules[0]] if (test.internal_brg or phase != 4) else modules
47
+ restore_modules.append(eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}'))
48
+ utPrint(f"reverting tx_brg {test.brg0.id_str} to defaults\n", "BOLD")
49
+ test, response = cert_config.config_brg_defaults(test, modules=restore_modules, ble5=True)
50
+ if response == NO_RESPONSE and test.exit_on_param_failure:
51
+ test.rc = TEST_FAILED
52
+ test.add_reason(f"BRG {test.brg0.id_str} didn't revert modules"
53
+ f"{restore_modules} to default configuration!")
54
+ return cert_common.test_epilog(test)
55
+
56
+
57
+ def brg0_tx_brg1_none(test, energy2400_module, ext_sensors_module, tx_brg_, rx_brg_, modules):
58
+ datapath_module = eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}')
59
+
60
+ # Phase 5 - Tx BRG without rx. just waiting for packets to be sent from the transmitter and verify
61
+ # The receiver isn't receiving any signal indicator packets.
62
+ phase = "brg0_tx_brg1_none"
63
+ tx_signal_ind_cycle = 15
64
+ tx_signal_ind_rep = 1
65
+ utPrint(f"TX BRG without RX - cycle = {tx_signal_ind_cycle}, repetition = {tx_signal_ind_rep}\n", "BLUE")
66
+ # restore default configuration for receiver #
67
+ utPrint(f"Configuring BRG {rx_brg_.id_str} to default", "BOLD")
68
+ restore_modules = [modules[1]] if (test.internal_brg) else modules
69
+ test = cert_config.config_brg1_defaults(test, modules=restore_modules, ble5=True)[0]
70
+ print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
71
+ if test.rc == TEST_FAILED and test.exit_on_param_failure:
72
+ test.add_reason(f"BRG {rx_brg_.id_str}: didn't revert to default configuration!")
73
+
74
+ # configuring transmitter #
75
+ utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
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]
78
+ if test.rc == TEST_FAILED:
79
+ test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
80
+
81
+ print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
82
+ utPrint(f"BRG {tx_brg_.id_str} configured to be transmitter - cycle = {tx_signal_ind_cycle},"
83
+ f"repetition = {tx_signal_ind_rep}", "BOLD")
84
+
85
+ # phase analysis #
86
+ mqtt_scan_n_create_log_file(test, (NUM_OF_TX_CYCLES * tx_signal_ind_cycle) + SCAN_DELAY_TIME, phase)
87
+ expected_signal_ind_pkts = [0]
88
+ received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
89
+ if len(received_signal_ind_pkts) not in expected_signal_ind_pkts:
90
+ test.rc = TEST_FAILED
91
+ test.add_reason(f"Phase {phase} failed - received signal indicator packet from BRG {rx_brg_.id_str}")
92
+
93
+ # Revert bridges to BLE4 before next loop
94
+ utPrint(f"reverting rx_brg {test.brg1.id_str} to defaults\n", "BOLD")
95
+ test, response = cert_config.config_brg1_defaults(test, modules=[datapath_module], ble5=True)
96
+ if response == NO_RESPONSE and test.exit_on_param_failure:
97
+ test.rc = TEST_FAILED
98
+ test.add_reason(f"BRG {test.brg1.id_str} didn't revert datapath_module to default configuration!")
99
+
100
+ utPrint(f"reverting tx_brg {test.brg0.id_str} to defaults\n", "BOLD")
101
+ test, response = cert_config.config_brg_defaults(test, modules=[datapath_module], ble5=True)
102
+ if response == NO_RESPONSE and test.exit_on_param_failure:
103
+ test.rc = TEST_FAILED
104
+ test.add_reason(f"BRG {test.brg0.id_str} didn't revert datapath module to default configuration!")
105
+
106
+ # Test epilog
107
+ return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
108
+
109
+
110
+ def brg0_rxtx_brg1_rxtx(test, energy2400_module, ext_sensors_module, tx_brg_, rx_brg_, modules):
111
+ phase = "brg0_rxtx_brg1_rxtx"
112
+
113
+ if not test.internal_brg:
114
+ # Phase 4 - Both BRG's will be configured to be transmitters and receivers, with different tx params for each one.
115
+ # expecting to see signal indicator packets from both BRG's, according to the tx params.
116
+ utPrint("Both BRG's are transmitter and receivers, with different values\n", "BLUE")
117
+
118
+ # configuring first BRG (tx_brg_) #
119
+ tx_brg_signal_indicator_cycle = 15
120
+ tx_brg_signal_indicator_rep = 3
121
+ # configuring first brg (tx_brg_) as receiver
122
+ utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Receiver", "BOLD")
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
126
+ utPrint(f"BRG {tx_brg_.id_str} successfully configured as Signal Indicator Receiver\n", "BOLD")
127
+
128
+ # configuring transmitter #
129
+ utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
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]
133
+ if test.rc == TEST_FAILED:
134
+ test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
135
+
136
+ print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
137
+ utPrint(f"BRG {tx_brg_.id_str} configured to be transmitter - cycle = {tx_brg_signal_indicator_cycle},"
138
+ f"repetition = {tx_brg_signal_indicator_rep}", "BOLD")
139
+
140
+ # configuring second brg (rx_brg_) as receiver
141
+ utPrint(f"Configuring BRG {rx_brg_.id_str} as Signal Indicator Receiver", "BOLD")
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
145
+ utPrint(f"BRG {rx_brg_.id_str} successfully configured as Signal Indicator Receiver\n", "BOLD")
146
+
147
+ # configuring second brg (rx_brg_) as transmitter
148
+ utPrint(f"Configuring BRG {rx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
149
+ rx_brg_signal_indicator_cycle = 15
150
+ rx_brg_signal_indicator_rep = 4
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
155
+ if test.rc == TEST_FAILED:
156
+ test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
157
+ utPrint(f"BRG {tx_brg_.id_str} configured to be transmitter - cycle = {rx_brg_signal_indicator_cycle},"
158
+ f"repetition = {rx_brg_signal_indicator_rep}")
159
+
160
+ # phase analysis #
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
+
165
+ # Analyzing tx_brg_ performance as receiver
166
+ utPrint(f"Analyzing tx_brg {tx_brg_.id_str} performance as a Receiver\n", "BOLD")
167
+ rx_brg_tx_cycles = max(tx_brg_signal_indicator_cycle, rx_brg_signal_indicator_cycle) / rx_brg_signal_indicator_cycle
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"""
172
+ print(txt)
173
+ if len(received_signal_ind_pkts) not in expected_signal_ind_pkts:
174
+ test.rc = TEST_FAILED
175
+ test.add_reason(txt)
176
+
177
+ # Analyzing rx_brg_ performance as receiver
178
+ utPrint(f"Analyzing rx_brg {rx_brg_.id_str} performance as a Receiver\n", "BOLD")
179
+ tx_brg_tx_cycles = max(tx_brg_signal_indicator_cycle, rx_brg_signal_indicator_cycle) / tx_brg_signal_indicator_cycle
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"""
184
+ print(txt)
185
+ if len(received_signal_ind_pkts) not in expected_signal_ind_pkts:
186
+ test.rc = TEST_FAILED
187
+ test.add_reason(txt)
188
+ else:
189
+ test.add_reason("skip for internal BRG")
190
+ return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
191
+
192
+
193
+ def brg0_none_brg1_rx(test, energy2400_module, ext_sensors_module, tx_brg_, rx_brg_, modules):
194
+ phase = "brg0_none_brg1_rx"
195
+ # Phase 3 - Rx BRG without tx.Expecting no signal indicator packets to be received.
196
+ tx_signal_ind_cycle = ag.BRG_DEFAULT_SIGNAL_INDICATOR_CYCLE
197
+ tx_signal_ind_rep = ag.BRG_DEFAULT_SIGNAL_INDICATOR_REP
198
+ utPrint(f"RX BRG without TX- cycle = {tx_signal_ind_cycle}, repetition = {tx_signal_ind_rep}\n", "BLUE")
199
+
200
+ # configuring transmitter #
201
+ utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
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
205
+ if test.rc == TEST_FAILED:
206
+ test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
207
+ utPrint(f"BRG {tx_brg_.id_str} configured to default!!! cycle = {tx_signal_ind_cycle},"f"repetition = {tx_signal_ind_rep}", "BOLD")
208
+
209
+ # phase analysis #
210
+ mqtt_scan_n_create_log_file(test, DEFAULT_SCAN_TIME, phase)
211
+ expected_signal_ind_pkts = [0]
212
+ received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
213
+ if len(received_signal_ind_pkts) not in expected_signal_ind_pkts:
214
+ test.rc = TEST_FAILED
215
+ test.add_reason(f"Phase {phase} failed - received signal indicator packet from BRG"
216
+ f"{rx_brg_.id_str}")
217
+ return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
218
+
219
+
220
+ def brg0_rx_brg1_tx(test, energy2400_module, ext_sensors_module, tx_brg_, rx_brg_, modules):
221
+ phase = "brg0_rx_brg1_tx"
222
+ cycle_rep = [(30, 3), (60, 4)]
223
+ for tx_signal_ind_cycle, tx_signal_ind_rep in cycle_rep:
224
+
225
+ utPrint(f"TX BRG with RX- cycle = {tx_signal_ind_cycle}, repetition = {tx_signal_ind_rep}\n", "BLUE")
226
+ # configuring receiver #
227
+ utPrint(f"Configuring BRG {rx_brg_.id_str} as Signal Indicator Receiver", "BOLD")
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]
231
+ if test.rc == TEST_FAILED:
232
+ test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
233
+
234
+ # configuring transmitter #
235
+ utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
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
240
+ if test.rc == TEST_FAILED:
241
+ test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
242
+
243
+ utPrint(f"BRG {tx_brg_.id_str} configured to be transmitter - cycle={tx_signal_ind_cycle}, repetition={tx_signal_ind_rep}", "BOLD")
244
+
245
+ # phase analysis
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"""
251
+ print(txt)
252
+ # TODO: change condition
253
+ if len(received_signal_ind_pkts) not in expected_signal_ind_pkts:
254
+ test.rc = TEST_FAILED
255
+ test.add_reason(txt)
256
+ return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
257
+
258
+
259
+ def rssi_threshold(test, energy2400_module, ext_sensors_module, tx_brg_, rx_brg_, modules):
260
+ phase = "rssi_threshold"
261
+ # RSSI Threshold
262
+ rssi_threshold = -25
263
+ tx_signal_ind_cycle = 15
264
+ tx_signal_ind_rep = 3
265
+ utPrint(f"TX BRG with RX- cycle = {tx_signal_ind_cycle}, repetition = {tx_signal_ind_rep}\n", "BLUE")
266
+
267
+ # configuring receiver #
268
+ utPrint(f"Configuring BRG {rx_brg_.id_str} as Signal Indicator Receiver with RSSI Threshold of {rssi_threshold}", "BOLD")
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
272
+
273
+ if test.rc == TEST_FAILED and test.exit_on_param_failure:
274
+ test.add_reason(f"BRG {rx_brg_.id_str}: didn't receive signal indicator receiver configuration!")
275
+
276
+ # configuring transmitter #
277
+ utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
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
281
+ if test.rc == TEST_FAILED:
282
+ test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
283
+
284
+ utPrint(f"BRG {tx_brg_.id_str} configured to be transmitter - cycle = {tx_signal_ind_cycle},"
285
+ f"repetition = {tx_signal_ind_rep}", "BOLD")
286
+ # phase analysis #
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]
290
+ if rssi_threshold_viloation_pkts:
291
+ test.rc = TEST_FAILED
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}")
294
+ field_functionality_pass_fail_print(test, 'phase', phase)
295
+
296
+ return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
297
+
298
+
299
+ SIGNAL_INDICATOR_TEST_MAP = {
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
+
306
+
307
+ def run(test):
308
+
309
+ # Test modules evaluation #
310
+ energy2400_module = eval_pkt(f'ModuleEnergy2400V{test.active_brg.api_version}')
311
+ ext_sensors_module = eval_pkt(f'ModuleExtSensorsV{test.active_brg.api_version}')
312
+ datapath_module = eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}')
313
+
314
+ # Transmitter related defines #
315
+ tx_brg_ = test.brg0
316
+ tx_module = energy2400_module
317
+
318
+ # Receiver related defines #
319
+ rx_brg_ = test.brg1
320
+
321
+ # Modules list #
322
+ modules = [tx_module, ext_sensors_module]
323
+
324
+ # Test prolog
325
+ test = cert_common.test_prolog(test)
326
+ test = cert_config.brg_configure(test, fields=[BRG_RX_CHANNEL], values=[ag.RX_CHANNEL_10_500K], module=datapath_module)[0]
327
+ test = cert_config.brg1_configure(test, fields=[BRG_RX_CHANNEL], values=[ag.RX_CHANNEL_10_500K], module=datapath_module)[0]
328
+ if test.rc == TEST_FAILED and test.exit_on_param_failure:
329
+ return terminate_test(test, phase=1, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
330
+ for param in test.params:
331
+ functionality_run_print(param.name)
332
+ test = SIGNAL_INDICATOR_TEST_MAP[param.value](test, energy2400_module, ext_sensors_module, tx_brg_, rx_brg_, modules)
333
+ generate_log_file(test, param.name)
334
+ field_functionality_pass_fail_print(test, param.name)
335
+ test.set_phase_rc(param.name, test.rc)
336
+ test.add_phase_reason(param.name, test.reason)
337
+ if test.rc == TEST_FAILED and test.exit_on_param_failure:
338
+ break
339
+ else:
340
+ test.reset_result()
341
+
342
+ return cert_common.test_epilog(test, revert_brgs=True, modules=[energy2400_module, ext_sensors_module],
343
+ brg1_modules=[energy2400_module, ext_sensors_module])
@@ -1,13 +1,20 @@
1
1
  {
2
- "name": "signal_indicator_functionality_sub1g_2_4_test",
3
- "module": "energy2400",
4
- "purpose": "TODO",
5
- "documentaion": "<TEST_DOCUMENTATION_LINK>",
6
- "initialCondition": "TODO",
7
- "procedure": ["Test prolog", "TODO", "Test epilog"],
8
- "expectedOutcome": "TODO",
2
+ "name": "Signal Indicator 2.4 & Sub1g Sync",
3
+ "module": "Energizer 2.4GHz",
4
+ "purpose": "Verify the signal indicator tx sync mechanism when transmitting in both sub1g & 2.4 GHz bands.",
5
+ "documentation": "<TEST_DOCUMENTATION_LINK>",
6
+ "initialCondition": "1 GW and at least 1 BRG (tx brg) connected to the GW.",
7
+ "procedure": ["Test prolog",
8
+ "Configure rx BRG to receive signal indicator packets (can be BRG or internal BRG)",
9
+ "Configure tx BRG to transmit signal indicator 2.4 GHz packets",
10
+ "Configure tx BRG to transmit signal indicator sub1g packets with same repetitions & cycle time as 2.4 GHz",
11
+ "Scan packets for 3 cycles",
12
+ "Verify same number of packets received in both sub1g & 2.4 GHz bands",
13
+ "Test epilog"],
14
+ "expectedOutcome": "Sync mechanism should work correctly, with the same number of packets received in both sub1g & 2.4 GHz bands.",
9
15
  "mandatory": 0,
10
16
  "multiBridgeTest": 1,
11
17
  "gwOnlyTest": 0,
18
+ "internalBridge": 1,
12
19
  "allSupportedValues": []
13
20
  }
@@ -1,4 +1,3 @@
1
- import random
2
1
  from brg_certificate.cert_prints import *
3
2
  from brg_certificate.cert_defines import *
4
3
  import brg_certificate.cert_common as cert_common
@@ -7,43 +6,26 @@ from brg_certificate.wlt_types import *
7
6
 
8
7
 
9
8
  # Test MACROS #
10
- DEFAULT_HDR = ag.Hdr(group_id=ag.GROUP_ID_GW2BRG)
11
9
  NUM_OF_SCANNING_CYCLE = 3
12
10
  DEFAULT_SCAN_TIME = 60
13
11
  SCAN_DELAY_TIME = 5
14
- 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]
15
12
  ANTENNA_TYPE_2_4 = 0
16
13
  ANTENNA_TYPE_SUB1G = 1
17
- ANTENNA_TYPE_IDX = 21
18
14
 
19
- # Test functions #
20
- def mqtt_scan_n_create_log_file(test, duration):
21
- test.mqttc.flush_pkts()
22
- mqtt_scan_wait(test, duration=duration)
23
- generate_log_file(test, "15&4")
24
-
25
- def get_all_signal_ind_pkt(test=None, rx_brg=None, tx_brg=None):
26
- if rx_brg == test.brg1:
27
- all_sensor_packets = cert_mqtt.get_all_brg1_ext_sensor_pkts(mqttc=test.mqttc, test=test)
28
- elif rx_brg == test.brg0:
29
- all_sensor_packets = cert_mqtt.get_all_sensor_pkts(mqttc=test.mqttc, test=test)
30
- signal_ind_pkts = []
31
- for p in all_sensor_packets:
32
- 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 p[SENSOR_ID] == tx_brg.id_str):
33
- signal_ind_pkts.append(p)
34
- return signal_ind_pkts
35
15
 
16
+ # Test functions #
36
17
  def expected_signal_ind_pkts_calc(tx_brg, rx_brg, antenna_type):
37
- if (antenna_type == ANTENNA_TYPE_2_4 and tx_brg.board_type in BOARD_TYPES_2_POLARIZATION_ANT_LIST):
18
+ if (antenna_type == ANTENNA_TYPE_2_4 and tx_brg.board_type in cert_common.dual_polarization_ant_boards_get()):
38
19
  tx_brg_ant_polarization_num = 2
39
20
  else:
40
21
  tx_brg_ant_polarization_num = 1
41
- if (antenna_type == ANTENNA_TYPE_2_4 and rx_brg.board_type in BOARD_TYPES_2_POLARIZATION_ANT_LIST):
22
+ if (antenna_type == ANTENNA_TYPE_2_4 and rx_brg.board_type in cert_common.dual_polarization_ant_boards_get()):
42
23
  rx_brg_ant_polarization_num = 2
43
24
  else:
44
25
  rx_brg_ant_polarization_num = 1
45
26
  return NUM_OF_SCANNING_CYCLE * tx_brg_ant_polarization_num * rx_brg_ant_polarization_num
46
27
 
28
+
47
29
  def terminate_test(test, revert_rx_brg=False, revert_tx_brg=False, rx_modules=[], tx_modules=[]):
48
30
  # Temp solution for internal_brg test because test_epilog doesn't support both internal brg and test.brgs
49
31
  utPrint("Terminating test!!!!!!!!\n", "BLUE")
@@ -54,7 +36,7 @@ def terminate_test(test, revert_rx_brg=False, revert_tx_brg=False, rx_modules=[]
54
36
  if response == NO_RESPONSE and test.exit_on_param_failure:
55
37
  test.rc = TEST_FAILED
56
38
  test.add_reason(f"BRG {test.brg1.id_str} didn't revert modules "
57
- f"{restore_modules} to default configuration!")
39
+ f"{restore_modules} to default configuration!")
58
40
 
59
41
  if revert_tx_brg:
60
42
  restore_modules = tx_modules
@@ -63,16 +45,17 @@ def terminate_test(test, revert_rx_brg=False, revert_tx_brg=False, rx_modules=[]
63
45
  if response == NO_RESPONSE and test.exit_on_param_failure:
64
46
  test.rc = TEST_FAILED
65
47
  test.add_reason(f"BRG {test.brg0.id_str} didn't revert modules"
66
- f"{restore_modules} to default configuration!")
48
+ f"{restore_modules} to default configuration!")
67
49
  return cert_common.test_epilog(test)
68
50
 
51
+
69
52
  # Test execution #
70
53
  def run(test):
71
54
 
72
55
  # Test modules evaluation #
73
- energy2400_module = eval(f'ModuleEnergy2400V{test.active_brg.api_version}')
74
- ext_sensors_module = eval(f'ModuleExtSensorsV{test.active_brg.api_version}')
75
- energy_sub1g_module = eval(f'ModuleEnergySub1GV{test.active_brg.api_version}')
56
+ energy2400_module = eval_pkt(f'ModuleEnergy2400V{test.active_brg.api_version}')
57
+ ext_sensors_module = eval_pkt(f'ModuleExtSensorsV{test.active_brg.api_version}')
58
+ energy_sub1g_module = eval_pkt(f'ModuleEnergySub1GV{test.active_brg.api_version}')
76
59
 
77
60
  # Transmitter related defines #
78
61
  tx_brg_ = test.brg0
@@ -86,68 +69,73 @@ def run(test):
86
69
  return terminate_test(test)
87
70
 
88
71
  tx_signal_ind_cycle, tx_signal_ind_rep = 15, 4
89
- utPrint(f"TX BRG with RX- cycle = {tx_signal_ind_cycle}, repetition = {tx_signal_ind_rep}\n", "HEADER")
72
+ utPrint(f"TX BRG in both sub1g & 2.4 - cycle = {tx_signal_ind_cycle}, repetition = {tx_signal_ind_rep}\n", "HEADER")
90
73
 
91
74
  # configuring receiver #
92
75
  utPrint(f"Configuring BRG {rx_brg_.id_str} as Signal Indicator Receiver", "BOLD")
93
- test = cert_config.brg1_configure(test=test, module=ext_sensors_module, fields=[BRG_SENSOR0], values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR])[0]
76
+ test = cert_config.brg1_configure(test=test, module=ext_sensors_module, fields=[BRG_SENSOR0],
77
+ values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR])[0]
94
78
  if test.rc == TEST_FAILED and test.exit_on_param_failure:
95
79
  test.add_reason(f"BRG {rx_brg_.id_str}: didn't receive signal indicator receiver configuration!")
96
80
  return terminate_test(test, revert_rx_brg=True, rx_modules=[ext_sensors_module])
97
- utPrint(f"BRG {rx_brg_.id_str} succesfully configured to be receiver", "GREEN")
81
+ utPrint(f"BRG {rx_brg_.id_str} successfully configured to be receiver", "GREEN")
98
82
 
99
83
  # configuring transmitter 2_4 #
100
84
  utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator 2_4 Transmitter", "BOLD")
101
- transmitter_cfg_pkt_2_4 = WltPkt(hdr=DEFAULT_HDR, pkt=energy2400_module(seq_id=random.randrange(99), brg_mac=tx_brg_.id_int, signal_indicator_cycle=tx_signal_ind_cycle, signal_indicator_rep=tx_signal_ind_rep))
102
- test = cert_config.brg_configure(test=test, cfg_pkt=transmitter_cfg_pkt_2_4)[0]
85
+ test = cert_config.brg_configure(test, fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP],
86
+ values=[tx_signal_ind_cycle, tx_signal_ind_rep], module=energy2400_module)[0]
103
87
  if test.rc == TEST_FAILED and test.exit_on_param_failure:
104
88
  test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator 2_4 transmitter configuration!")
105
- return terminate_test(test, revert_rx_brg=True,revert_tx_brg=True)
106
- utPrint(f"BRG {tx_brg_.id_str} succesfully configured to be 2_4 transmitter - cycle = {tx_signal_ind_cycle},"
107
- f"repetition = {tx_signal_ind_rep}", "GREEN")
108
-
89
+ return terminate_test(test, revert_rx_brg=True, revert_tx_brg=True)
90
+ utPrint(f"BRG {tx_brg_.id_str} successfully configured to be 2_4 transmitter - cycle = {tx_signal_ind_cycle},"
91
+ f"repetition = {tx_signal_ind_rep}", "GREEN")
92
+
109
93
  # configuring transmitter sub1g #
110
94
  utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator sub1g Transmitter", "BOLD")
111
- transmitter_cfg_pkt_sub1g = WltPkt(hdr=DEFAULT_HDR, pkt=energy_sub1g_module(seq_id=random.randrange(99), brg_mac=tx_brg_.id_int, signal_indicator_cycle=tx_signal_ind_cycle, signal_indicator_rep=tx_signal_ind_rep, pattern=ag.SUB1G_ENERGY_PATTERN_ISRAEL))
112
- test = cert_config.brg_configure(test=test, cfg_pkt=transmitter_cfg_pkt_sub1g)[0]
95
+ test = cert_config.brg_configure(test, fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP, BRG_DUTY_CYCLE],
96
+ values=[tx_signal_ind_cycle, tx_signal_ind_rep, 0],
97
+ module=energy_sub1g_module)[0]
113
98
  if test.rc == TEST_FAILED and test.exit_on_param_failure:
114
99
  test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator sub1g transmitter configuration!")
115
- return terminate_test(test, revert_rx_brg=True,revert_tx_brg=True, rx_modules=[ext_sensors_module], tx_modules=[energy2400_module, energy_sub1g_module])
116
- utPrint(f"BRG {tx_brg_.id_str} succesfully configured to be Sub1g transmitter - cycle = {tx_signal_ind_cycle},"
117
- f"repetition = {tx_signal_ind_rep}, EP = {ag.SUB1G_ENERGY_PATTERN_ISRAEL}", "GREEN")
118
-
100
+ return terminate_test(test, revert_rx_brg=True, revert_tx_brg=True, rx_modules=[ext_sensors_module],
101
+ tx_modules=[energy2400_module, energy_sub1g_module])
102
+ utPrint(f"BRG {tx_brg_.id_str} successfully configured to be Sub1g transmitter - cycle = {tx_signal_ind_cycle},"
103
+ f"repetition = {tx_signal_ind_rep}, EP = {ag.SUB1G_ENERGY_PATTERN_ISRAEL}", "GREEN")
104
+
119
105
  # analysis #
120
106
  mqtt_scan_n_create_log_file(test, (NUM_OF_SCANNING_CYCLE * tx_signal_ind_cycle) + SCAN_DELAY_TIME)
121
- received_signal_ind_pkts = get_all_signal_ind_pkt(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
107
+ received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
122
108
  expected_signal_ind_2_4_pkts = expected_signal_ind_pkts_calc(tx_brg_, rx_brg_, ANTENNA_TYPE_2_4)
123
109
  expected_signal_ind_sub1g_pkts = expected_signal_ind_pkts_calc(tx_brg_, rx_brg_, ANTENNA_TYPE_SUB1G)
124
110
  signal_indicator_2_4_packets = 0
125
111
  signal_indicator_sub1g_packets = 0
126
112
  for p in received_signal_ind_pkts:
127
- if int(p[PAYLOAD][ANTENNA_TYPE_IDX]) == ANTENNA_TYPE_SUB1G and p[SENSOR_ID] == tx_brg_.id_str:
113
+ if p[SENSOR_PKT].pkt.antenna_type == ANTENNA_TYPE_SUB1G and p[SENSOR_ID] == tx_brg_.id_str:
128
114
  signal_indicator_sub1g_packets += 1
129
- elif int(p[PAYLOAD][ANTENNA_TYPE_IDX]) == ANTENNA_TYPE_2_4 and p[SENSOR_ID] == tx_brg_.id_alias:
115
+ elif p[SENSOR_PKT].pkt.antenna_type == ANTENNA_TYPE_2_4 and p[SENSOR_ID] == tx_brg_.id_alias:
130
116
  signal_indicator_2_4_packets += 1
131
- utPrint(f"Received {signal_indicator_2_4_packets} 2_4 signal indicator packets and {signal_indicator_sub1g_packets} subg signal indicator packets", "BLUE")
117
+ utPrint(f"Received {signal_indicator_2_4_packets} 2_4 signal indicator packets"
118
+ f" and {signal_indicator_sub1g_packets} sub1g signal indicator packets", "BLUE")
132
119
 
133
120
  # Test evaluation #
134
- if len(received_signal_ind_pkts) < expected_signal_ind_2_4_pkts + expected_signal_ind_sub1g_pkts:
121
+ if len(received_signal_ind_pkts) != expected_signal_ind_2_4_pkts + expected_signal_ind_sub1g_pkts:
135
122
  test.rc = TEST_FAILED
136
123
  test.add_reason(f"Test failed - BRG {rx_brg_.id_str} received wrong number of "
137
- f"total signal indicator packets\n received {len(received_signal_ind_pkts)} packets, "
138
- f"expected {expected_signal_ind_2_4_pkts + expected_signal_ind_sub1g_pkts} packets")
139
- elif signal_indicator_2_4_packets < expected_signal_ind_2_4_pkts:
124
+ f"total signal indicator packets\n received {len(received_signal_ind_pkts)} packets, "
125
+ f"expected {expected_signal_ind_2_4_pkts + expected_signal_ind_sub1g_pkts} packets")
126
+ elif signal_indicator_2_4_packets != expected_signal_ind_2_4_pkts:
140
127
  test.rc = TEST_FAILED
141
128
  test.add_reason(f"Test failed - BRG {rx_brg_.id_str} received wrong number of "
142
- f"signal indicator 2.4 packets\n received {signal_indicator_2_4_packets} packets, "
143
- f"expected {expected_signal_ind_2_4_pkts} packets")
144
- elif signal_indicator_sub1g_packets < expected_signal_ind_sub1g_pkts:
129
+ f"signal indicator 2.4 packets\n received {signal_indicator_2_4_packets} packets, "
130
+ f"expected {expected_signal_ind_2_4_pkts} packets")
131
+ elif signal_indicator_sub1g_packets != expected_signal_ind_sub1g_pkts:
145
132
  test.rc = TEST_FAILED
146
133
  test.add_reason(f"Test failed - BRG {rx_brg_.id_str} received wrong number of "
147
- f"signal indicator sub1g packets\n received {signal_indicator_sub1g_packets} packets, "
148
- f"expected {expected_signal_ind_sub1g_pkts} packets")
134
+ f"signal indicator sub1g packets\n received {signal_indicator_sub1g_packets} packets, "
135
+ f"expected {expected_signal_ind_sub1g_pkts} packets")
149
136
 
150
- field_functionality_pass_fail_print(test,'Signal Indicator Functionality 2_4 & Sub1g')
137
+ field_functionality_pass_fail_print(test, 'Signal Indicator Functionality 2_4 & Sub1g')
151
138
 
152
139
  # Test epilog
153
- return terminate_test(test, revert_rx_brg=False,revert_tx_brg=True, rx_modules=[ext_sensors_module], tx_modules=[energy2400_module, energy_sub1g_module])
140
+ return terminate_test(test, revert_rx_brg=False, revert_tx_brg=True,
141
+ rx_modules=[ext_sensors_module], tx_modules=[energy2400_module, energy_sub1g_module])
@@ -1,13 +1,20 @@
1
1
  {
2
- "name": "signal_indicator_functionality_test",
3
- "module": "energy2400",
4
- "purpose": "TODO",
5
- "documentaion": "<TEST_DOCUMENTATION_LINK>",
6
- "initialCondition": "TODO",
7
- "procedure": ["Test prolog", "TODO", "Test epilog"],
8
- "expectedOutcome": "TODO",
2
+ "name": "Signal Indicator",
3
+ "module": "Energizer 2.4GHz",
4
+ "purpose": "Test functionality for supported Energizer 2.4GHz signal indicator cycle & repetitions sets of values",
5
+ "documentation": "https://community.wiliot.com/customers/s/article/Wiliot-Network-Energizing-2-4Ghz",
6
+ "initialCondition": "Bridge configured to defaults",
7
+ "procedure": ["Test prolog",
8
+ "rssi_threshold - check the if rssi value is between 0 to -25.",
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",
10
+ "brg0_none_brg1_rx - One rx BRG without any tx BRG. We don't expect to see any signal indicator packets.",
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
+ "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
+ "Test epilog"],
14
+ "expectedOutcome": "All phases passes successfully",
9
15
  "mandatory": 0,
10
16
  "multiBridgeTest": 1,
11
17
  "gwOnlyTest": 0,
18
+ "internalBridge": 1,
12
19
  "allSupportedValues": ["rssi_threshold", "brg0_rx_brg1_tx", "brg0_none_brg1_rx", "brg0_rxtx_brg1_rxtx", "brg0_tx_brg1_none"]
13
20
  }