wiliot-certificate 1.3.0a1__py3-none-any.whl → 1.4.0a2__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 (184) hide show
  1. brg_certificate/__init__.py +0 -0
  2. brg_certificate/ag/energous_v0_defines.py +925 -0
  3. brg_certificate/ag/energous_v1_defines.py +931 -0
  4. brg_certificate/ag/energous_v2_defines.py +925 -0
  5. brg_certificate/ag/energous_v3_defines.py +925 -0
  6. brg_certificate/ag/energous_v4_defines.py +925 -0
  7. brg_certificate/ag/fanstel_lan_v0_defines.py +925 -0
  8. brg_certificate/ag/fanstel_lte_v0_defines.py +925 -0
  9. brg_certificate/ag/fanstel_wifi_v0_defines.py +925 -0
  10. brg_certificate/ag/minew_lte_v0_defines.py +925 -0
  11. brg_certificate/ag/wlt_cmd_if.html +102 -0
  12. brg_certificate/ag/wlt_types.html +6114 -0
  13. brg_certificate/ag/wlt_types_ag.py +7840 -0
  14. brg_certificate/ag/wlt_types_ag_jsons/brg2brg_ota.json +142 -0
  15. brg_certificate/ag/wlt_types_ag_jsons/brg2gw_hb.json +785 -0
  16. brg_certificate/ag/wlt_types_ag_jsons/brg2gw_hb_sleep.json +139 -0
  17. brg_certificate/ag/wlt_types_ag_jsons/calibration.json +394 -0
  18. brg_certificate/ag/wlt_types_ag_jsons/custom.json +515 -0
  19. brg_certificate/ag/wlt_types_ag_jsons/datapath.json +672 -0
  20. brg_certificate/ag/wlt_types_ag_jsons/energy2400.json +550 -0
  21. brg_certificate/ag/wlt_types_ag_jsons/energySub1g.json +595 -0
  22. brg_certificate/ag/wlt_types_ag_jsons/externalSensor.json +598 -0
  23. brg_certificate/ag/wlt_types_ag_jsons/interface.json +938 -0
  24. brg_certificate/ag/wlt_types_ag_jsons/powerManagement.json +1234 -0
  25. brg_certificate/ag/wlt_types_ag_jsons/side_info_sensor.json +105 -0
  26. brg_certificate/ag/wlt_types_ag_jsons/signal_indicator_data.json +77 -0
  27. brg_certificate/ag/wlt_types_ag_jsons/unified_echo_ext_pkt.json +61 -0
  28. brg_certificate/ag/wlt_types_ag_jsons/unified_echo_pkt.json +110 -0
  29. brg_certificate/brg_certificate.py +191 -0
  30. brg_certificate/brg_certificate_cli.py +47 -0
  31. brg_certificate/cert_common.py +828 -0
  32. brg_certificate/cert_config.py +395 -0
  33. brg_certificate/cert_data_sim.py +188 -0
  34. brg_certificate/cert_defines.py +337 -0
  35. brg_certificate/cert_gw_sim.py +285 -0
  36. brg_certificate/cert_mqtt.py +373 -0
  37. brg_certificate/cert_prints.py +181 -0
  38. brg_certificate/cert_protobuf.py +88 -0
  39. brg_certificate/cert_results.py +300 -0
  40. brg_certificate/cert_utils.py +358 -0
  41. brg_certificate/certificate_sanity_test_list.txt +36 -0
  42. brg_certificate/certificate_test_list.txt +43 -0
  43. brg_certificate/config/eclipse.json +10 -0
  44. brg_certificate/config/hivemq.json +10 -0
  45. brg_certificate/config/mosquitto.json +10 -0
  46. brg_certificate/config/mosquitto.md +95 -0
  47. brg_certificate/config/wiliot-dev.json +10 -0
  48. brg_certificate/restore_brg.py +59 -0
  49. brg_certificate/tests/calibration/interval_test/interval_test.json +13 -0
  50. brg_certificate/tests/calibration/interval_test/interval_test.py +28 -0
  51. brg_certificate/tests/calibration/output_power_test/output_power_test.json +13 -0
  52. brg_certificate/tests/calibration/output_power_test/output_power_test.py +28 -0
  53. brg_certificate/tests/calibration/pattern_test/pattern_test.json +13 -0
  54. brg_certificate/tests/calibration/pattern_test/pattern_test.py +70 -0
  55. brg_certificate/tests/datapath/adaptive_pacer_algo_test/adaptive_pacer_algo_test.json +13 -0
  56. brg_certificate/tests/datapath/adaptive_pacer_algo_test/adaptive_pacer_algo_test.py +76 -0
  57. brg_certificate/tests/datapath/num_of_tags_test/num_of_tags_test.json +13 -0
  58. brg_certificate/tests/datapath/num_of_tags_test/num_of_tags_test.py +83 -0
  59. brg_certificate/tests/datapath/output_power_test/output_power_test.json +13 -0
  60. brg_certificate/tests/datapath/output_power_test/output_power_test.py +27 -0
  61. brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.json +13 -0
  62. brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +43 -0
  63. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.json +13 -0
  64. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.py +63 -0
  65. brg_certificate/tests/datapath/pacer_interval_test/pacer_interval_test.json +13 -0
  66. brg_certificate/tests/datapath/pacer_interval_test/pacer_interval_test.py +50 -0
  67. brg_certificate/tests/datapath/pattern_test/pattern_test.json +13 -0
  68. brg_certificate/tests/datapath/pattern_test/pattern_test.py +28 -0
  69. brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.json +13 -0
  70. brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +51 -0
  71. brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.json +13 -0
  72. brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.py +54 -0
  73. brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.json +13 -0
  74. brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.py +55 -0
  75. brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.json +13 -0
  76. brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.py +73 -0
  77. brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.json +13 -0
  78. brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.py +41 -0
  79. brg_certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.json +21 -0
  80. brg_certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +184 -0
  81. brg_certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.json +21 -0
  82. brg_certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.py +210 -0
  83. brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.json +30 -0
  84. brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.py +203 -0
  85. brg_certificate/tests/datapath/stress_test/stress_test.json +30 -0
  86. brg_certificate/tests/datapath/stress_test/stress_test.py +210 -0
  87. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.json +13 -0
  88. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.py +113 -0
  89. brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.json +13 -0
  90. brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.py +79 -0
  91. brg_certificate/tests/edge_mgmt/actions_test/actions_test.json +13 -0
  92. brg_certificate/tests/edge_mgmt/actions_test/actions_test.py +432 -0
  93. brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.json +13 -0
  94. brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.py +94 -0
  95. brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.json +13 -0
  96. brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.py +87 -0
  97. brg_certificate/tests/edge_mgmt/leds_test/leds_test.json +13 -0
  98. brg_certificate/tests/edge_mgmt/leds_test/leds_test.py +210 -0
  99. brg_certificate/tests/edge_mgmt/ota_test/ota_test.json +13 -0
  100. brg_certificate/tests/edge_mgmt/ota_test/ota_test.py +83 -0
  101. brg_certificate/tests/edge_mgmt/stat_test/stat_test.json +13 -0
  102. brg_certificate/tests/edge_mgmt/stat_test/stat_test.py +48 -0
  103. brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.json +13 -0
  104. brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.py +26 -0
  105. brg_certificate/tests/energy2400/output_power_test/output_power_test.json +13 -0
  106. brg_certificate/tests/energy2400/output_power_test/output_power_test.py +27 -0
  107. brg_certificate/tests/energy2400/pattern_test/pattern_test.json +13 -0
  108. brg_certificate/tests/energy2400/pattern_test/pattern_test.py +28 -0
  109. brg_certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.json +13 -0
  110. brg_certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.py +398 -0
  111. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.json +13 -0
  112. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.py +153 -0
  113. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +13 -0
  114. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +264 -0
  115. brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.json +13 -0
  116. brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.py +27 -0
  117. brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.json +13 -0
  118. brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.py +26 -0
  119. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.json +13 -0
  120. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.py +397 -0
  121. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.json +13 -0
  122. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.py +27 -0
  123. brg_certificate/wltPb_pb2.py +72 -0
  124. brg_certificate/wltPb_pb2.pyi +227 -0
  125. brg_certificate/wlt_types.py +114 -0
  126. gw_certificate/api/extended_api.py +7 -1531
  127. gw_certificate/api_if/200/data.json +106 -0
  128. gw_certificate/api_if/200/logs.json +12 -0
  129. gw_certificate/api_if/200/status.json +47 -0
  130. gw_certificate/api_if/201/data.json +98 -0
  131. gw_certificate/api_if/201/logs.json +12 -0
  132. gw_certificate/api_if/201/status.json +53 -0
  133. gw_certificate/api_if/202/data.json +83 -0
  134. gw_certificate/api_if/202/logs.json +12 -0
  135. gw_certificate/api_if/202/status.json +60 -0
  136. gw_certificate/api_if/203/data.json +85 -0
  137. gw_certificate/api_if/203/logs.json +12 -0
  138. gw_certificate/api_if/203/status.json +63 -0
  139. gw_certificate/api_if/204/data.json +85 -0
  140. gw_certificate/api_if/204/logs.json +12 -0
  141. gw_certificate/api_if/204/status.json +63 -0
  142. gw_certificate/api_if/205/data.json +85 -0
  143. gw_certificate/api_if/205/logs.json +12 -0
  144. gw_certificate/api_if/205/status.json +63 -0
  145. gw_certificate/api_if/api_validation.py +0 -2
  146. gw_certificate/common/analysis_data_bricks.py +18 -1413
  147. gw_certificate/common/debug.py +0 -21
  148. gw_certificate/common/utils.py +1 -212
  149. gw_certificate/common/utils_defines.py +0 -87
  150. gw_certificate/gw_certificate.py +9 -7
  151. gw_certificate/gw_certificate_cli.py +39 -23
  152. gw_certificate/interface/4.4.52_app.zip +0 -0
  153. gw_certificate/interface/4.4.52_sd_bl_app.zip +0 -0
  154. gw_certificate/interface/ble_simulator.py +0 -32
  155. gw_certificate/interface/if_defines.py +1 -0
  156. gw_certificate/interface/mqtt.py +96 -19
  157. gw_certificate/interface/nrfutil-linux +0 -0
  158. gw_certificate/interface/nrfutil-mac +0 -0
  159. gw_certificate/interface/nrfutil.exe +0 -0
  160. gw_certificate/interface/pkt_generator.py +0 -82
  161. gw_certificate/interface/uart_if.py +73 -43
  162. gw_certificate/templates/results.html +1 -1
  163. gw_certificate/tests/__init__.py +1 -2
  164. gw_certificate/tests/actions.py +134 -9
  165. gw_certificate/tests/connection.py +10 -5
  166. gw_certificate/tests/downlink.py +2 -4
  167. gw_certificate/tests/generic.py +62 -12
  168. gw_certificate/tests/registration.py +78 -27
  169. gw_certificate/tests/static/generated_packet_table.py +12 -48
  170. gw_certificate/tests/static/packet_table.csv +10048 -10048
  171. gw_certificate/tests/static/references.py +2 -1
  172. gw_certificate/tests/static/uplink_defines.py +0 -7
  173. gw_certificate/tests/throughput.py +7 -12
  174. gw_certificate/tests/uplink.py +83 -43
  175. {wiliot_certificate-1.3.0a1.dist-info → wiliot_certificate-1.4.0a2.dist-info}/METADATA +59 -8
  176. wiliot_certificate-1.4.0a2.dist-info/RECORD +198 -0
  177. {wiliot_certificate-1.3.0a1.dist-info → wiliot_certificate-1.4.0a2.dist-info}/WHEEL +1 -1
  178. wiliot_certificate-1.4.0a2.dist-info/entry_points.txt +3 -0
  179. wiliot_certificate-1.4.0a2.dist-info/top_level.txt +2 -0
  180. gw_certificate/interface/packet_error.py +0 -22
  181. wiliot_certificate-1.3.0a1.dist-info/RECORD +0 -51
  182. wiliot_certificate-1.3.0a1.dist-info/entry_points.txt +0 -2
  183. wiliot_certificate-1.3.0a1.dist-info/top_level.txt +0 -1
  184. {wiliot_certificate-1.3.0a1.dist-info → wiliot_certificate-1.4.0a2.dist-info}/LICENSE +0 -0
@@ -0,0 +1,264 @@
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
+ # We will configure several signal indicator params during the test, and check the functionality of the signal indicator logic
10
+ # for each of them.
11
+ # It is important to execute the test with several setups: 2 Fanstel BRG's, 2 Minew BRG's and 1 Fanstel and 1 Minew BRG.
12
+ # At first, we will configure several tx signal indicator params and check for ack's, to verify all indicated params were
13
+ # received at the cloud.
14
+ # Then, we will examine the signal indicator end-2-end logic with both transmitter and receiver:
15
+ # phase 1 - One BRG will be configured as signal indicator tx, and the other as signal indicator rx, and we expect to see
16
+ # signal indicator packets only from the tx BRG, and according to the tx params (to check the repetition and cycle params).
17
+ # phase 2 - Same as phase 1, but with different tx params configured.
18
+ # 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
19
+ # brg module logic is working properly, and no tag packet is accidentally being treated as signal indicator packet.
20
+ # phase 4 - Both BRG's will be configured to be transmitters and receivers, with different tx params for each one. we expect
21
+ # to see signal indicator packets from both BRG's, according to the tx params.
22
+ # phase 5 - One BRG will be configured as signal indicator tx, but no rx, so we don't expect to receive signal indicatopr packets.
23
+ # that way we can assure the logic within the receiver is not confused by the signal indicator uuid as external sensor.
24
+
25
+
26
+ # Test MACROS #
27
+ DEFAULT_HDR = ag.Hdr(group_id=ag.GROUP_ID_GW2BRG)
28
+ NUM_OF_SCANNING_CYCLE = 2
29
+ DEFAULT_SCAN_TIME = 60
30
+ SCAN_DELAY_TIME = 5
31
+ 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]
32
+
33
+ # Test functions #
34
+ def mqtt_scan_n_create_log_file(test, duration, phase):
35
+ test.mqttc.flush_pkts()
36
+ mqtt_scan_wait(test, duration=duration)
37
+ generate_log_file(test, phase)
38
+
39
+ def get_all_signal_ind_pkt(test=None, rx_brg=None, tx_brg=None):
40
+ if rx_brg == test.brg1:
41
+ all_sensor_packets = cert_mqtt.get_all_brg1_ext_sensor_pkts(mqttc=test.mqttc, test=test)
42
+ elif rx_brg == test.brg0:
43
+ all_sensor_packets = cert_mqtt.get_all_sensor_pkts(mqttc=test.mqttc, test=test)
44
+ signal_ind_pkts = []
45
+ for p in all_sensor_packets:
46
+ 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):
47
+ signal_ind_pkts.append(p)
48
+ return signal_ind_pkts
49
+
50
+ def expected_signal_ind_pkts_calc(tx_brg, rx_brg):
51
+ if (tx_brg.board_type in BOARD_TYPES_2_POLARIZATION_ANT_LIST):
52
+ tx_brg_ant_polarization_num = 2
53
+ else:
54
+ tx_brg_ant_polarization_num = 1
55
+ if (rx_brg.board_type in BOARD_TYPES_2_POLARIZATION_ANT_LIST):
56
+ rx_brg_ant_polarization_num = 2
57
+ else:
58
+ rx_brg_ant_polarization_num = 1
59
+ return NUM_OF_SCANNING_CYCLE * tx_brg_ant_polarization_num * rx_brg_ant_polarization_num
60
+
61
+ def test_brg0_rx_brg1_tx(test, energy2400_module, ext_sensors_module):
62
+ cycle_rep = [(30,3), (60,4)]
63
+ tx_brg_ = test.brg0
64
+ rx_brg_ = test.brg1
65
+ for cycle,rep in cycle_rep:
66
+ utPrint(f"TX BRG with RX- cycle = {cycle}, repetition = {rep}\n", "BLUE")
67
+ # configuring receiver #
68
+ utPrint(f"Configuring BRG {rx_brg_.id_str} as Signal Indicator Receiver", "BOLD")
69
+ test = cert_config.brg1_configure(test=test, module=ext_sensors_module, fields=[BRG_SENSOR0], values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR])[0]
70
+ if test.rc == TEST_FAILED:
71
+ test.add_reason(f"BRG {rx_brg_.id_str}: didn't receive signal indicator receiver configuration!")
72
+ return test
73
+ # configuring transmitter #
74
+ utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
75
+ test = cert_config.brg_configure(test=test, module=energy2400_module, fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP], values=[cycle, rep])[0]
76
+ if test.rc == TEST_FAILED:
77
+ test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
78
+ return test
79
+ utPrint(f"BRG {tx_brg_.id_str} configured to be transmitter - cycle = {cycle},"
80
+ f"repetition = {rep}", "BOLD")
81
+ # phase analysis #
82
+ mqtt_scan_n_create_log_file(test, (NUM_OF_SCANNING_CYCLE * cycle) + SCAN_DELAY_TIME, f"brg0_rx_brg1_tx_{cycle}_{rep}")
83
+ expected_signal_ind_pkts = expected_signal_ind_pkts_calc(tx_brg_, rx_brg_)
84
+ received_signal_ind_pkts = get_all_signal_ind_pkt(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
85
+ if len(received_signal_ind_pkts) != expected_signal_ind_pkts:
86
+ test.rc = TEST_FAILED
87
+ test.add_reason(f"brg0_rx_brg1_tx phase failed - BRG {rx_brg_.id_str} received wrong number of "
88
+ f"signal indicator packets\n received {len(received_signal_ind_pkts)} packets, "
89
+ f"expected {expected_signal_ind_pkts} packets")
90
+ if test.rc == TEST_FAILED: return test
91
+ return test
92
+
93
+ def test_rssi_threshold(test, energy2400_module, ext_sensors_module):
94
+ cycle, rep = 30, 3
95
+ tx_brg_ = test.brg0
96
+ rx_brg_ = test.brg1
97
+ rssi_threshold = -25
98
+
99
+ utPrint(f"TX BRG with RX- cycle = {cycle}, repetition = {rep}\n", "BLUE")
100
+ # configuring receiver #
101
+ utPrint(f"Configuring BRG {rx_brg_.id_str} as Signal Indicator Receiver with RSSI Threshold of {rssi_threshold}", "BOLD")
102
+ 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])[0]
103
+ if test.rc == TEST_FAILED:
104
+ test.add_reason(f"BRG {rx_brg_.id_str}: didn't receive signal indicator receiver configuration!")
105
+ return test
106
+ # configuring transmitter #
107
+ utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
108
+ test = cert_config.brg_configure(test=test, module=energy2400_module, fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP], values=[cycle, rep])[0]
109
+ if test.rc == TEST_FAILED:
110
+ test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
111
+ return test
112
+ utPrint(f"BRG {tx_brg_.id_str} configured to be transmitter - cycle = {cycle},"
113
+ f"repetition = {rep}", "BOLD")
114
+ # phase analysis #
115
+ mqtt_scan_n_create_log_file(test, (NUM_OF_SCANNING_CYCLE * cycle) + SCAN_DELAY_TIME, f"rssi_threshold")
116
+ received_signal_ind_pkts = get_all_signal_ind_pkt(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
117
+ rssi_threshold_viloation_pkts = [p for p in received_signal_ind_pkts if p[RSSI] >= -1*rssi_threshold]
118
+ if rssi_threshold_viloation_pkts:
119
+ test.rc = TEST_FAILED
120
+ test.add_reason(f"rssi_threshold phase failed - BRG {rx_brg_.id_str} echoed" +
121
+ f" {len(rssi_threshold_viloation_pkts)} signal indicator packets\n with RSSI weaker than {rssi_threshold}")
122
+ return test
123
+
124
+ def test_brg0_none_brg1_rx(test, energy2400_module, ext_sensors_module):
125
+ cycle, rep = ag.BRG_DEFAULT_SIGNAL_INDICATOR_CYCLE, ag.BRG_DEFAULT_SIGNAL_INDICATOR_REP
126
+ tx_brg_ = test.brg0
127
+ rx_brg_ = test.brg1
128
+ utPrint(f"RX BRG without TX- cycle = {cycle}, repetition = {rep}\n", "BLUE")
129
+ # configuring transmitter to no TX #
130
+ utPrint(f"Configuring BRG {tx_brg_.id_str} to default", "BOLD")
131
+ test = cert_config.brg_configure(test=test, module=energy2400_module, fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP], values=[cycle, rep])[0]
132
+ if test.rc == TEST_FAILED:
133
+ test.add_reason(f"BRG {tx_brg_.id_str}: didn't revert to default (no signal indicator tx)!")
134
+ return test
135
+ utPrint(f"BRG {tx_brg_.id_str} configured to default!!! cycle = {cycle},"
136
+ f"repetition = {rep}", "BOLD")
137
+ # phase analysis #
138
+ mqtt_scan_n_create_log_file(test, DEFAULT_SCAN_TIME, "brg0_none_brg1_rx")
139
+ expected_signal_ind_pkts = 0
140
+ received_signal_ind_pkts = get_all_signal_ind_pkt(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
141
+ if len(received_signal_ind_pkts) != expected_signal_ind_pkts:
142
+ test.rc = TEST_FAILED
143
+ test.add_reason(f"brg0_none_brg1_rx phase failed - received signal indicator packet from BRG"
144
+ f"{rx_brg_.id_str}")
145
+ return test
146
+
147
+ def test_brg0_rxtx_brg1_rxtx(test, energy2400_module, ext_sensors_module):
148
+ tx_cycle, tx_rep = 15,4
149
+ rx_cycle, rx_rep = 16,4
150
+ tx_brg_ = test.brg0
151
+ rx_brg_ = test.brg1
152
+ utPrint(f"Both BRG's are transmitter and receivers, with different values\n", "BLUE")
153
+ # configuring first brg (tx_brg_) as receiver
154
+ utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Receiver", "BOLD")
155
+ test = cert_config.brg_configure(test=test, module=ext_sensors_module, fields=[BRG_SENSOR0], values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR])[0]
156
+ if test.rc == TEST_FAILED and test.exit_on_param_failure:
157
+ test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator receiver configuration!")
158
+ return test
159
+ utPrint(f"BRG {tx_brg_.id_str} successfully configured as Signal Indicator Receiver\n", "BOLD")
160
+ # configuring first brg (tx_brg_) as transmitter
161
+ utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
162
+ test = cert_config.brg_configure(test=test, module=energy2400_module, fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP], values=[tx_cycle, tx_rep])[0]
163
+ if test.rc == TEST_FAILED and test.exit_on_param_failure:
164
+ test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
165
+ return test
166
+ utPrint(f"BRG {tx_brg_.id_str} configured to be transmitter - cycle = {tx_cycle},"
167
+ f"repetition = {tx_rep}", "BOLD")
168
+
169
+ # configuring second brg (rx_brg_) as receiver
170
+ utPrint(f"Configuring BRG {rx_brg_.id_str} as Signal Indicator Receiver", "BOLD")
171
+ test = cert_config.brg1_configure(test=test, module=ext_sensors_module, fields=[BRG_SENSOR0], values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR])[0]
172
+ if test.rc == TEST_FAILED and test.exit_on_param_failure:
173
+ test.add_reason(f"BRG {rx_brg_.id_str}: didn't receive signal indicator receiver configuration!")
174
+ return test
175
+ utPrint(f"BRG {rx_brg_.id_str} successfully configured as Signal Indicator Receiver\n", "BOLD")
176
+ # configuring second brg (rx_brg_) as transmitter (already configured as rx)
177
+ utPrint(f"Configuring BRG {rx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
178
+ test = cert_config.brg1_configure(test=test, module=energy2400_module, fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP], values=[rx_cycle, rx_rep])[0]
179
+ if test.rc == TEST_FAILED and test.exit_on_param_failure:
180
+ test.add_reason(f"BRG {rx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
181
+ return test
182
+ utPrint(f"BRG {rx_brg_.id_str} configured to be transmitter - cycle = {rx_cycle},"
183
+ f"repetition = {rx_rep}")
184
+
185
+ # phase analysis #
186
+ mqtt_scan_n_create_log_file(test, NUM_OF_SCANNING_CYCLE * max(tx_cycle, rx_cycle) + SCAN_DELAY_TIME, "brg0_rxtx_brg1_rxtx")
187
+
188
+ # Analysing brg0 as a receiver
189
+ expected_signal_ind_pkts = expected_signal_ind_pkts_calc(rx_brg_, tx_brg_)
190
+ received_signal_ind_pkts = get_all_signal_ind_pkt(test=test, rx_brg=tx_brg_, tx_brg=rx_brg_)
191
+ if len(received_signal_ind_pkts) != expected_signal_ind_pkts:
192
+ test.rc = TEST_FAILED
193
+ test.add_reason(f"brg0_rxtx_brg1_rxtx phase failed - BRG {tx_brg_.id_str} received wrong number of "
194
+ f"signal indicator packets\n received {len(received_signal_ind_pkts)} packets, "
195
+ f"expected {expected_signal_ind_pkts} packets")
196
+ if test.rc == TEST_FAILED: return test
197
+
198
+ # Analysing brg1 as a receiver
199
+ expected_signal_ind_pkts = expected_signal_ind_pkts_calc(tx_brg_, rx_brg_)
200
+ received_signal_ind_pkts = get_all_signal_ind_pkt(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
201
+ if len(received_signal_ind_pkts) != expected_signal_ind_pkts:
202
+ test.rc = TEST_FAILED
203
+ test.add_reason(f"brg0_rxtx_brg1_rxtx phase failed - BRG {rx_brg_.id_str} received wrong number of "
204
+ f"signal indicator packets\n received {len(received_signal_ind_pkts)} packets, "
205
+ f"expected {expected_signal_ind_pkts} packets")
206
+ return test
207
+
208
+ def test_brg0_tx_brg1_none(test, energy2400_module, ext_sensors_module):
209
+ # Tx BRG without rx. just waiting for packets to be sent from the transmitter and verify
210
+ # The receiver isn't receiving any signal indicator packets.
211
+ cycle, rep = 15,3
212
+ tx_brg_ = test.brg0
213
+ rx_brg_ = test.brg1
214
+ utPrint(f"TX BRG without RX - cycle = {cycle}, repetition = {rep}\n", "BLUE")
215
+ # restore default configuration for receiver #
216
+ utPrint(f"Configuring BRG {rx_brg_.id_str} to default", "BOLD")
217
+ test = cert_config.config_brg1_defaults(test, modules=[energy2400_module, ext_sensors_module])[0]
218
+ if test.rc == TEST_FAILED:
219
+ test.add_reason(f"BRG {rx_brg_.id_str}: didn't revert to default configuration!")
220
+ return test
221
+ # configuring transmitter #
222
+ utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
223
+ test = cert_config.brg_configure(test=test, module=energy2400_module, fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP], values=[cycle, rep])[0]
224
+ if test.rc == TEST_FAILED:
225
+ test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
226
+ return test
227
+
228
+ # phase analysis #
229
+ mqtt_scan_n_create_log_file(test, (NUM_OF_SCANNING_CYCLE*cycle) + SCAN_DELAY_TIME, "brg0_tx_brg1_none")
230
+ expected_signal_ind_pkts = 0
231
+ received_signal_ind_pkts = get_all_signal_ind_pkt(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
232
+ if len(received_signal_ind_pkts) != expected_signal_ind_pkts:
233
+ test.rc = TEST_FAILED
234
+ test.add_reason(f"brg0_tx_brg1_none phase failed - received signal indicator packet from BRG"
235
+ f"{rx_brg_.id_str}")
236
+ return test
237
+
238
+ SIGNAL_INDICATOR_TEST_MAP = {"rssi_threshold" : test_rssi_threshold, "brg0_rx_brg1_tx": test_brg0_rx_brg1_tx,
239
+ "brg0_none_brg1_rx": test_brg0_none_brg1_rx, "brg0_rxtx_brg1_rxtx": test_brg0_rxtx_brg1_rxtx,
240
+ "brg0_tx_brg1_none": test_brg0_tx_brg1_none}
241
+
242
+ def run(test):
243
+
244
+ # Test modules evaluation #
245
+ energy2400_module = eval_pkt(f'ModuleEnergy2400V{test.active_brg.api_version}')
246
+ ext_sensors_module = eval_pkt(f'ModuleExtSensorsV{test.active_brg.api_version}')
247
+
248
+ # Test prolog
249
+ test = cert_common.test_prolog(test)
250
+
251
+ for param in test.params:
252
+ functionality_run_print(param.name)
253
+ test = SIGNAL_INDICATOR_TEST_MAP[param.value](test, energy2400_module, ext_sensors_module)
254
+ generate_log_file(test, param.name)
255
+ field_functionality_pass_fail_print(test, param.name)
256
+ test.set_phase_rc(param.name, test.rc)
257
+ test.add_phase_reason(param.name, test.reason)
258
+ if test.rc == TEST_FAILED and test.exit_on_param_failure:
259
+ break
260
+ else:
261
+ test.reset_result()
262
+
263
+ return cert_common.test_epilog(test, revert_brgs=True, modules=[energy2400_module, ext_sensors_module],
264
+ brg1_modules=[energy2400_module, ext_sensors_module])
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "duty_cycle_test",
3
+ "module": "energy_sub1g",
4
+ "purpose": "Test configuration for supported energy_sub1g duty cycle & bridge cycle sets of values",
5
+ "documentaion": "<TEST_DOCUMENTATION_LINK>",
6
+ "initialCondition": "Bridge configured to defaults",
7
+ "procedure": ["Test prolog", "Configurations", "Test epilog and revert to defaults"],
8
+ "expectedOutcome": "All values configured successfully",
9
+ "mandatory": 1,
10
+ "multiBridgeTest": 0,
11
+ "gwOnlyTest": 0,
12
+ "allSupportedValues": [15, 20, 40, 0]
13
+ }
@@ -0,0 +1,27 @@
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
+ def run(test):
8
+
9
+ fields = [BRG_DUTY_CYCLE]
10
+ sub1g_module = eval_pkt(f'ModuleEnergySub1GV{test.active_brg.api_version}')
11
+
12
+ test = cert_common.test_prolog(test)
13
+ if test.rc == TEST_FAILED or test.reason != TEST_SUCCESS:
14
+ return cert_common.test_epilog(test)
15
+ for param in test.params:
16
+ param_name = f"{param.name}"
17
+ test = cert_config.brg_configure(test, fields=fields, values=[param.value], module=sub1g_module)[0]
18
+ generate_log_file(test, param_name)
19
+ field_functionality_pass_fail_print(test, fields, value=param_name)
20
+ test.set_phase_rc(param.name, test.rc)
21
+ test.add_phase_reason(param.name, test.reason)
22
+ if test.rc == TEST_FAILED and test.exit_on_param_failure:
23
+ break
24
+ else:
25
+ test.reset_result()
26
+
27
+ return cert_common.test_epilog(test, revert_brgs=True, modules=[sub1g_module])
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "pattern_test",
3
+ "module": "energy_sub1g",
4
+ "purpose": "Test configuration for all supported Energy SUB1GHz pattern values",
5
+ "documentaion": "<TEST_DOCUMENTATION_LINK>",
6
+ "initialCondition": "Bridge configured to defaults",
7
+ "procedure": ["Test prolog", "Configurations", "Test epilog and revert to defaults"],
8
+ "expectedOutcome": "All values configured successfully",
9
+ "mandatory": 1,
10
+ "multiBridgeTest": 0,
11
+ "gwOnlyTest": 0,
12
+ "allSupportedValues": ["SUB1G_ENERGY_PATTERN_NO_ENERGIZING", "SUB1G_ENERGY_PATTERN_SINGLE_TONE_915000", "SUB1G_ENERGY_PATTERN_FCC_HOPPING", "SUB1G_ENERGY_PATTERN_JAPAN_1W", "SUB1G_ENERGY_PATTERN_JAPAN_350MW", "SUB1G_ENERGY_PATTERN_KOREA", "SUB1G_ENERGY_PATTERN_SINGLE_TONE_916300", "SUB1G_ENERGY_PATTERN_SINGLE_TONE_917500", "SUB1G_ENERGY_PATTERN_AUSTRALIA", "SUB1G_ENERGY_PATTERN_ISRAEL", "SUB1G_ENERGY_PATTERN_NZ_HOPPING"]
13
+ }
@@ -0,0 +1,26 @@
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
+ def run(test):
8
+
9
+ fields = [BRG_PATTERN]
10
+ sub1g_module = eval_pkt(f'ModuleEnergySub1GV{test.active_brg.api_version}')
11
+
12
+ test = cert_common.test_prolog(test)
13
+ if test.rc == TEST_FAILED or test.reason != TEST_SUCCESS:
14
+ return cert_common.test_epilog(test)
15
+ for param in test.params:
16
+ test = cert_config.brg_configure(test, fields=fields, values=[param.value], module=sub1g_module)[0]
17
+ generate_log_file(test, param.name)
18
+ field_functionality_pass_fail_print(test, fields, value=param.name)
19
+ test.set_phase_rc(param.name, test.rc)
20
+ test.add_phase_reason(param.name, test.reason)
21
+ if test.rc == TEST_FAILED and test.exit_on_param_failure:
22
+ break
23
+ else:
24
+ test.reset_result()
25
+
26
+ return cert_common.test_epilog(test, revert_brgs=True, modules=[sub1g_module])
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "signal_indicator_functionality_test",
3
+ "module": "energy_sub1g",
4
+ "purpose": "TODO",
5
+ "documentaion": "<TEST_DOCUMENTATION_LINK>",
6
+ "initialCondition": "TODO",
7
+ "procedure": ["Test prolog", "TODO", "Test epilog"],
8
+ "expectedOutcome": "TODO",
9
+ "mandatory": 0,
10
+ "multiBridgeTest": 1,
11
+ "gwOnlyTest": 0,
12
+ "allSupportedValues": []
13
+ }