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.
- brg_certificate/__init__.py +0 -0
- brg_certificate/ag/energous_v0_defines.py +925 -0
- brg_certificate/ag/energous_v1_defines.py +931 -0
- brg_certificate/ag/energous_v2_defines.py +925 -0
- brg_certificate/ag/energous_v3_defines.py +925 -0
- brg_certificate/ag/energous_v4_defines.py +925 -0
- brg_certificate/ag/fanstel_lan_v0_defines.py +925 -0
- brg_certificate/ag/fanstel_lte_v0_defines.py +925 -0
- brg_certificate/ag/fanstel_wifi_v0_defines.py +925 -0
- brg_certificate/ag/minew_lte_v0_defines.py +925 -0
- brg_certificate/ag/wlt_cmd_if.html +102 -0
- brg_certificate/ag/wlt_types.html +6114 -0
- brg_certificate/ag/wlt_types_ag.py +7840 -0
- brg_certificate/ag/wlt_types_ag_jsons/brg2brg_ota.json +142 -0
- brg_certificate/ag/wlt_types_ag_jsons/brg2gw_hb.json +785 -0
- brg_certificate/ag/wlt_types_ag_jsons/brg2gw_hb_sleep.json +139 -0
- brg_certificate/ag/wlt_types_ag_jsons/calibration.json +394 -0
- brg_certificate/ag/wlt_types_ag_jsons/custom.json +515 -0
- brg_certificate/ag/wlt_types_ag_jsons/datapath.json +672 -0
- brg_certificate/ag/wlt_types_ag_jsons/energy2400.json +550 -0
- brg_certificate/ag/wlt_types_ag_jsons/energySub1g.json +595 -0
- brg_certificate/ag/wlt_types_ag_jsons/externalSensor.json +598 -0
- brg_certificate/ag/wlt_types_ag_jsons/interface.json +938 -0
- brg_certificate/ag/wlt_types_ag_jsons/powerManagement.json +1234 -0
- brg_certificate/ag/wlt_types_ag_jsons/side_info_sensor.json +105 -0
- brg_certificate/ag/wlt_types_ag_jsons/signal_indicator_data.json +77 -0
- brg_certificate/ag/wlt_types_ag_jsons/unified_echo_ext_pkt.json +61 -0
- brg_certificate/ag/wlt_types_ag_jsons/unified_echo_pkt.json +110 -0
- brg_certificate/brg_certificate.py +191 -0
- brg_certificate/brg_certificate_cli.py +47 -0
- brg_certificate/cert_common.py +828 -0
- brg_certificate/cert_config.py +395 -0
- brg_certificate/cert_data_sim.py +188 -0
- brg_certificate/cert_defines.py +337 -0
- brg_certificate/cert_gw_sim.py +285 -0
- brg_certificate/cert_mqtt.py +373 -0
- brg_certificate/cert_prints.py +181 -0
- brg_certificate/cert_protobuf.py +88 -0
- brg_certificate/cert_results.py +300 -0
- brg_certificate/cert_utils.py +358 -0
- brg_certificate/certificate_sanity_test_list.txt +36 -0
- brg_certificate/certificate_test_list.txt +43 -0
- brg_certificate/config/eclipse.json +10 -0
- brg_certificate/config/hivemq.json +10 -0
- brg_certificate/config/mosquitto.json +10 -0
- brg_certificate/config/mosquitto.md +95 -0
- brg_certificate/config/wiliot-dev.json +10 -0
- brg_certificate/restore_brg.py +59 -0
- brg_certificate/tests/calibration/interval_test/interval_test.json +13 -0
- brg_certificate/tests/calibration/interval_test/interval_test.py +28 -0
- brg_certificate/tests/calibration/output_power_test/output_power_test.json +13 -0
- brg_certificate/tests/calibration/output_power_test/output_power_test.py +28 -0
- brg_certificate/tests/calibration/pattern_test/pattern_test.json +13 -0
- brg_certificate/tests/calibration/pattern_test/pattern_test.py +70 -0
- brg_certificate/tests/datapath/adaptive_pacer_algo_test/adaptive_pacer_algo_test.json +13 -0
- brg_certificate/tests/datapath/adaptive_pacer_algo_test/adaptive_pacer_algo_test.py +76 -0
- brg_certificate/tests/datapath/num_of_tags_test/num_of_tags_test.json +13 -0
- brg_certificate/tests/datapath/num_of_tags_test/num_of_tags_test.py +83 -0
- brg_certificate/tests/datapath/output_power_test/output_power_test.json +13 -0
- brg_certificate/tests/datapath/output_power_test/output_power_test.py +27 -0
- brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.json +13 -0
- brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +43 -0
- brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.json +13 -0
- brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.py +63 -0
- brg_certificate/tests/datapath/pacer_interval_test/pacer_interval_test.json +13 -0
- brg_certificate/tests/datapath/pacer_interval_test/pacer_interval_test.py +50 -0
- brg_certificate/tests/datapath/pattern_test/pattern_test.json +13 -0
- brg_certificate/tests/datapath/pattern_test/pattern_test.py +28 -0
- brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.json +13 -0
- brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +51 -0
- brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.json +13 -0
- brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.py +54 -0
- brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.json +13 -0
- brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.py +55 -0
- brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.json +13 -0
- brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.py +73 -0
- brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.json +13 -0
- brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.py +41 -0
- brg_certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.json +21 -0
- brg_certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +184 -0
- brg_certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.json +21 -0
- brg_certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.py +210 -0
- brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.json +30 -0
- brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.py +203 -0
- brg_certificate/tests/datapath/stress_test/stress_test.json +30 -0
- brg_certificate/tests/datapath/stress_test/stress_test.py +210 -0
- brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.json +13 -0
- brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.py +113 -0
- brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.json +13 -0
- brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.py +79 -0
- brg_certificate/tests/edge_mgmt/actions_test/actions_test.json +13 -0
- brg_certificate/tests/edge_mgmt/actions_test/actions_test.py +432 -0
- brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.json +13 -0
- brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.py +94 -0
- brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.json +13 -0
- brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.py +87 -0
- brg_certificate/tests/edge_mgmt/leds_test/leds_test.json +13 -0
- brg_certificate/tests/edge_mgmt/leds_test/leds_test.py +210 -0
- brg_certificate/tests/edge_mgmt/ota_test/ota_test.json +13 -0
- brg_certificate/tests/edge_mgmt/ota_test/ota_test.py +83 -0
- brg_certificate/tests/edge_mgmt/stat_test/stat_test.json +13 -0
- brg_certificate/tests/edge_mgmt/stat_test/stat_test.py +48 -0
- brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.json +13 -0
- brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.py +26 -0
- brg_certificate/tests/energy2400/output_power_test/output_power_test.json +13 -0
- brg_certificate/tests/energy2400/output_power_test/output_power_test.py +27 -0
- brg_certificate/tests/energy2400/pattern_test/pattern_test.json +13 -0
- brg_certificate/tests/energy2400/pattern_test/pattern_test.py +28 -0
- brg_certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.json +13 -0
- brg_certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.py +398 -0
- brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.json +13 -0
- brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.py +153 -0
- brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +13 -0
- brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +264 -0
- brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.json +13 -0
- brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.py +27 -0
- brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.json +13 -0
- brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.py +26 -0
- brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.json +13 -0
- brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.py +397 -0
- brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.json +13 -0
- brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.py +27 -0
- brg_certificate/wltPb_pb2.py +72 -0
- brg_certificate/wltPb_pb2.pyi +227 -0
- brg_certificate/wlt_types.py +114 -0
- gw_certificate/api/extended_api.py +7 -1531
- gw_certificate/api_if/200/data.json +106 -0
- gw_certificate/api_if/200/logs.json +12 -0
- gw_certificate/api_if/200/status.json +47 -0
- gw_certificate/api_if/201/data.json +98 -0
- gw_certificate/api_if/201/logs.json +12 -0
- gw_certificate/api_if/201/status.json +53 -0
- gw_certificate/api_if/202/data.json +83 -0
- gw_certificate/api_if/202/logs.json +12 -0
- gw_certificate/api_if/202/status.json +60 -0
- gw_certificate/api_if/203/data.json +85 -0
- gw_certificate/api_if/203/logs.json +12 -0
- gw_certificate/api_if/203/status.json +63 -0
- gw_certificate/api_if/204/data.json +85 -0
- gw_certificate/api_if/204/logs.json +12 -0
- gw_certificate/api_if/204/status.json +63 -0
- gw_certificate/api_if/205/data.json +85 -0
- gw_certificate/api_if/205/logs.json +12 -0
- gw_certificate/api_if/205/status.json +63 -0
- gw_certificate/api_if/api_validation.py +0 -2
- gw_certificate/common/analysis_data_bricks.py +18 -1413
- gw_certificate/common/debug.py +0 -21
- gw_certificate/common/utils.py +1 -212
- gw_certificate/common/utils_defines.py +0 -87
- gw_certificate/gw_certificate.py +9 -7
- gw_certificate/gw_certificate_cli.py +39 -23
- gw_certificate/interface/4.4.52_app.zip +0 -0
- gw_certificate/interface/4.4.52_sd_bl_app.zip +0 -0
- gw_certificate/interface/ble_simulator.py +0 -32
- gw_certificate/interface/if_defines.py +1 -0
- gw_certificate/interface/mqtt.py +96 -19
- gw_certificate/interface/nrfutil-linux +0 -0
- gw_certificate/interface/nrfutil-mac +0 -0
- gw_certificate/interface/nrfutil.exe +0 -0
- gw_certificate/interface/pkt_generator.py +0 -82
- gw_certificate/interface/uart_if.py +73 -43
- gw_certificate/templates/results.html +1 -1
- gw_certificate/tests/__init__.py +1 -2
- gw_certificate/tests/actions.py +134 -9
- gw_certificate/tests/connection.py +10 -5
- gw_certificate/tests/downlink.py +2 -4
- gw_certificate/tests/generic.py +62 -12
- gw_certificate/tests/registration.py +78 -27
- gw_certificate/tests/static/generated_packet_table.py +12 -48
- gw_certificate/tests/static/packet_table.csv +10048 -10048
- gw_certificate/tests/static/references.py +2 -1
- gw_certificate/tests/static/uplink_defines.py +0 -7
- gw_certificate/tests/throughput.py +7 -12
- gw_certificate/tests/uplink.py +83 -43
- {wiliot_certificate-1.3.0a1.dist-info → wiliot_certificate-1.4.0a2.dist-info}/METADATA +59 -8
- wiliot_certificate-1.4.0a2.dist-info/RECORD +198 -0
- {wiliot_certificate-1.3.0a1.dist-info → wiliot_certificate-1.4.0a2.dist-info}/WHEEL +1 -1
- wiliot_certificate-1.4.0a2.dist-info/entry_points.txt +3 -0
- wiliot_certificate-1.4.0a2.dist-info/top_level.txt +2 -0
- gw_certificate/interface/packet_error.py +0 -22
- wiliot_certificate-1.3.0a1.dist-info/RECORD +0 -51
- wiliot_certificate-1.3.0a1.dist-info/entry_points.txt +0 -2
- wiliot_certificate-1.3.0a1.dist-info/top_level.txt +0 -1
- {wiliot_certificate-1.3.0a1.dist-info → wiliot_certificate-1.4.0a2.dist-info}/LICENSE +0 -0
|
@@ -0,0 +1,397 @@
|
|
|
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
|
+
import random
|
|
7
|
+
|
|
8
|
+
# Test Description:
|
|
9
|
+
# This test is to verify the functionality of both signal indicator tx (tx_brg) and rx (rx_brg) at BRG level.
|
|
10
|
+
# We will configure several signal indicator params during the test, and check the functionality of the signal indicator logic
|
|
11
|
+
# for each of them.
|
|
12
|
+
# 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.
|
|
13
|
+
# At first, we will configure several tx signal indicator params and check for ack's, to verify all indicated params were
|
|
14
|
+
# received at the cloud.
|
|
15
|
+
# Then, we will examine the signal indicator end-2-end logic with both transmitter and receiver:
|
|
16
|
+
# phase 1 - One BRG will be configured as signal indicator tx, and the other as signal indicator rx, and we expect to see
|
|
17
|
+
# signal indicator packets only from the tx BRG, and according to the tx params (to check the repetition and cycle params).
|
|
18
|
+
# phase 2 - Same as phase 1, but with different tx params configured.
|
|
19
|
+
# 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
|
|
20
|
+
# brg module logic is working properly, and no tag packet is accidentally being treated as signal indicator packet.
|
|
21
|
+
# phase 4 - Both BRG's will be configured to be transmitters and receivers, with different tx params for each one. we expect
|
|
22
|
+
# to see signal indicator packets from both BRG's, according to the tx params.
|
|
23
|
+
# phase 5 - One BRG will be configured as signal indicator tx, but no rx, so we don't expect to receive signal indicatopr packets.
|
|
24
|
+
# that way we can assure the logic within the receiver is not confused by the signal indicator uuid as external sensor.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
# Test MACROS #
|
|
28
|
+
DEFAULT_HDR = ag.Hdr(group_id=ag.GROUP_ID_GW2BRG)
|
|
29
|
+
NUM_OF_SCANNING_CYCLE = 2
|
|
30
|
+
DEFAULT_SCAN_TIME = 60
|
|
31
|
+
SCAN_DELAY_TIME = 5
|
|
32
|
+
VALUES_DICT = {0:(5,3),1:(5,3),2:(60,4),3:(ag.BRG_DEFAULT_SIGNAL_INDICATOR_CYCLE,ag.BRG_DEFAULT_SIGNAL_INDICATOR_REP),4:[(45,3),(90,4)],5:(15,1)}
|
|
33
|
+
CYCLE_IDX = 0
|
|
34
|
+
REP_IDX = 1
|
|
35
|
+
TX_BRG_IDX = 0
|
|
36
|
+
RX_BRG_IDX = 1
|
|
37
|
+
TEST_SUB1G_ENERGY_PATTERNS = [ag.SUB1G_ENERGY_PATTERN_SINGLE_TONE_915000, ag.SUB1G_ENERGY_PATTERN_FCC_HOPPING,
|
|
38
|
+
ag.SUB1G_ENERGY_PATTERN_SINGLE_TONE_916300, ag.SUB1G_ENERGY_PATTERN_SINGLE_TONE_917500,
|
|
39
|
+
ag.SUB1G_ENERGY_PATTERN_AUSTRALIA, ag.SUB1G_ENERGY_PATTERN_ISRAEL, ag.SUB1G_ENERGY_PATTERN_NZ_HOPPING]
|
|
40
|
+
|
|
41
|
+
hex2id_get =lambda id_str : "{:012X}".format(id_str)
|
|
42
|
+
|
|
43
|
+
# Helper function #
|
|
44
|
+
def get_phase_tx_params_values(phase, brg):
|
|
45
|
+
if phase == 4:
|
|
46
|
+
return VALUES_DICT[phase][brg][CYCLE_IDX] , VALUES_DICT[phase][brg][REP_IDX]
|
|
47
|
+
else:
|
|
48
|
+
return VALUES_DICT[phase][CYCLE_IDX], VALUES_DICT[phase][REP_IDX]
|
|
49
|
+
|
|
50
|
+
# Test functions #
|
|
51
|
+
def mqtt_scan_n_create_log_file(test, duration, phase):
|
|
52
|
+
test.mqttc.flush_pkts()
|
|
53
|
+
mqtt_scan_wait(test, duration=duration)
|
|
54
|
+
generate_log_file(test, phase)
|
|
55
|
+
|
|
56
|
+
def get_all_signal_ind_pkt(test=None, rx_brg=None, tx_brg=None):
|
|
57
|
+
if rx_brg == test.brg1:
|
|
58
|
+
all_sensor_packets = cert_mqtt.get_all_brg1_ext_sensor_pkts(mqttc=test.mqttc, test=test)
|
|
59
|
+
elif rx_brg == test.brg0:
|
|
60
|
+
all_sensor_packets = cert_mqtt.get_all_sensor_pkts(mqttc=test.mqttc, test=test)
|
|
61
|
+
signal_ind_pkts = []
|
|
62
|
+
for p in all_sensor_packets:
|
|
63
|
+
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_str:
|
|
64
|
+
signal_ind_pkts.append(p)
|
|
65
|
+
return signal_ind_pkts
|
|
66
|
+
|
|
67
|
+
def terminate_test(test, phase=0, revert_rx_brg=False, revert_tx_brg=False, modules=[]):
|
|
68
|
+
# Temp solution for internal_brg test because test_epilog doesn't support both internal brg and test.brgs
|
|
69
|
+
utPrint("Terminating test!!!!!!!!\n", "BLUE")
|
|
70
|
+
if revert_rx_brg:
|
|
71
|
+
restore_modules = [modules[1]] if (test.internal_brg or phase != 4) else modules
|
|
72
|
+
utPrint(f"reverting rx_brg {test.brg1.id_str} to defaults\n", "BOLD")
|
|
73
|
+
test, response = cert_config.config_brg1_defaults(test, modules=restore_modules)
|
|
74
|
+
if response == NO_RESPONSE and test.exit_on_param_failure:
|
|
75
|
+
test.rc = TEST_FAILED
|
|
76
|
+
test.add_reason(f"BRG {test.brg1.id_str} didn't revert modules "
|
|
77
|
+
f"{restore_modules} to default configuration!")
|
|
78
|
+
|
|
79
|
+
if revert_tx_brg:
|
|
80
|
+
restore_modules = [modules[0]] if (test.internal_brg or phase != 4) else modules
|
|
81
|
+
utPrint(f"reverting tx_brg {test.brg0.id_str} to defaults\n", "BOLD")
|
|
82
|
+
test, response = cert_config.config_brg_defaults(test, modules=restore_modules)
|
|
83
|
+
if response == NO_RESPONSE and test.exit_on_param_failure:
|
|
84
|
+
test.rc = TEST_FAILED
|
|
85
|
+
test.add_reason(f"BRG {test.brg0.id_str} didn't revert modules"
|
|
86
|
+
f"{restore_modules} to default configuration!")
|
|
87
|
+
return cert_common.test_epilog(test)
|
|
88
|
+
|
|
89
|
+
# Test execution #
|
|
90
|
+
def run(test):
|
|
91
|
+
|
|
92
|
+
# Test modules evaluation #
|
|
93
|
+
sub1g_module = eval_pkt(f'ModuleEnergySub1GV{test.active_brg.api_version}')
|
|
94
|
+
ext_sensors_module = eval_pkt(f'ModuleExtSensorsV{test.active_brg.api_version}')
|
|
95
|
+
|
|
96
|
+
# Transmitter related defines #
|
|
97
|
+
tx_brg_ = test.brg0
|
|
98
|
+
tx_module = sub1g_module
|
|
99
|
+
|
|
100
|
+
# Receiver related defines #
|
|
101
|
+
rx_brg_ = test.brg1
|
|
102
|
+
|
|
103
|
+
# Modules list #
|
|
104
|
+
modules = [tx_module, ext_sensors_module]
|
|
105
|
+
|
|
106
|
+
# RSSI Threshold
|
|
107
|
+
rssi_threshold = -25
|
|
108
|
+
|
|
109
|
+
# Test prolog
|
|
110
|
+
test = cert_common.test_prolog(test)
|
|
111
|
+
if test.rc == TEST_FAILED or test.reason != TEST_SUCCESS:
|
|
112
|
+
return terminate_test(test)
|
|
113
|
+
|
|
114
|
+
phase = 0
|
|
115
|
+
functionality_run_print(f"phase {phase}")
|
|
116
|
+
# Phase 1 - BRG0 Tx, BRG1 Rx. No Energizing.
|
|
117
|
+
# Checking for RSSI Threshold violations.
|
|
118
|
+
tx_signal_ind_cycle, tx_signal_ind_rep = get_phase_tx_params_values(phase, TX_BRG_IDX)
|
|
119
|
+
utPrint(f"TX BRG with RX- cycle = {tx_signal_ind_cycle}, repetition = {tx_signal_ind_rep}\n", "HEADER")
|
|
120
|
+
|
|
121
|
+
# configuring RX #
|
|
122
|
+
utPrint(f"Configuring BRG {rx_brg_.id_str} as SUB1G Signal Indicator Receiver", "BOLD")
|
|
123
|
+
test = cert_config.brg1_configure(test=test, module=ext_sensors_module, fields=[BRG_SENSOR0, BRG_SUB1G_RSSI_THRESHOLD],
|
|
124
|
+
values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR, rssi_threshold])[0]
|
|
125
|
+
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
126
|
+
test.add_reason(f"BRG {rx_brg_.id_str}: didn't receive signal indicator receiver configuration!")
|
|
127
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True, modules=modules)
|
|
128
|
+
utPrint(f"BRG {rx_brg_.id_str} succesfully configured to be Receiver", "GREEN")
|
|
129
|
+
|
|
130
|
+
# configuring TX #
|
|
131
|
+
utPrint(f"Configuring BRG {tx_brg_.id_str} as SUB1G Signal Indicator Transmitter\n", "BOLD")
|
|
132
|
+
transmitter_cfg_pkt = WltPkt(hdr=DEFAULT_HDR, pkt=tx_module(seq_id=random.randrange(99), brg_mac=tx_brg_.id_int,
|
|
133
|
+
signal_indicator_cycle=tx_signal_ind_cycle, signal_indicator_rep=tx_signal_ind_rep, pattern=ag.SUB1G_ENERGY_PATTERN_ISRAEL, duty_cycle=30))
|
|
134
|
+
test = cert_config.brg_configure(test=test, cfg_pkt=transmitter_cfg_pkt)[0]
|
|
135
|
+
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
136
|
+
test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
|
|
137
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
138
|
+
utPrint(f"BRG {tx_brg_.id_str} succesfully configured to be transmitter - cycle = {tx_signal_ind_cycle},"
|
|
139
|
+
f"repetition = {tx_signal_ind_rep}, pattern = {ag.SUB1G_ENERGY_PATTERN_ISRAEL}", "GREEN")
|
|
140
|
+
|
|
141
|
+
# Analyzing RSSI Threshold violation #
|
|
142
|
+
mqtt_scan_n_create_log_file(test, (NUM_OF_SCANNING_CYCLE * tx_signal_ind_cycle) + SCAN_DELAY_TIME, phase)
|
|
143
|
+
received_signal_ind_pkts = get_all_signal_ind_pkt(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
|
|
144
|
+
rssi_threshold_viloation_pkts = [p for p in received_signal_ind_pkts if p[RSSI] >= -1*rssi_threshold]
|
|
145
|
+
if rssi_threshold_viloation_pkts:
|
|
146
|
+
test.rc = TEST_FAILED
|
|
147
|
+
test.add_reason(f"rssi_threshold phase failed - BRG {rx_brg_.id_str} echoed" +
|
|
148
|
+
f" {len(rssi_threshold_viloation_pkts)} signal indicator packets\n with RSSI weaker than {rssi_threshold}")
|
|
149
|
+
|
|
150
|
+
field_functionality_pass_fail_print(test,'phase',phase)
|
|
151
|
+
if test.rc == TEST_FAILED:
|
|
152
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
153
|
+
|
|
154
|
+
phase = 1
|
|
155
|
+
functionality_run_print(f"phase {phase}")
|
|
156
|
+
# Phase 1 - BRG0 Tx, BRG1 Rx. No Energizing.
|
|
157
|
+
# expecting the receiver to receive signal indicator packets from the transmitter
|
|
158
|
+
# according to the tx params.
|
|
159
|
+
tx_signal_ind_cycle, tx_signal_ind_rep = get_phase_tx_params_values(phase, TX_BRG_IDX)
|
|
160
|
+
utPrint(f"TX BRG with RX- cycle = {tx_signal_ind_cycle}, repetition = {tx_signal_ind_rep}\n", "HEADER")
|
|
161
|
+
|
|
162
|
+
# configuring RX #
|
|
163
|
+
utPrint(f"Configuring BRG {rx_brg_.id_str} as SUB1G 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])[0]
|
|
165
|
+
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
166
|
+
test.add_reason(f"BRG {rx_brg_.id_str}: didn't receive signal indicator receiver configuration!")
|
|
167
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True, modules=modules)
|
|
168
|
+
utPrint(f"BRG {rx_brg_.id_str} succesfully configured to be Receiver", "GREEN")
|
|
169
|
+
|
|
170
|
+
for energy_pattern in TEST_SUB1G_ENERGY_PATTERNS:
|
|
171
|
+
utPrint(f"Energy pattern is {energy_pattern}", "WARNING")
|
|
172
|
+
|
|
173
|
+
# configuring RX BRG to desired pattern #
|
|
174
|
+
utPrint(f"Configuring RX BRG {rx_brg_.id_str} to EP {energy_pattern}", "BOLD")
|
|
175
|
+
receiver_cfg_pkt = WltPkt(hdr=DEFAULT_HDR, pkt=tx_module(seq_id=random.randrange(99), brg_mac=rx_brg_.id_int, pattern=energy_pattern, duty_cycle=30))
|
|
176
|
+
test = cert_config.brg1_configure(test=test, cfg_pkt=receiver_cfg_pkt)[0]
|
|
177
|
+
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
178
|
+
test.add_reason(f"Reciever BRG {rx_brg_.id_str} didn't received sub1g EP configuration!")
|
|
179
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
180
|
+
utPrint(f"Receiver BRG {rx_brg_.id_str} succesfully configured to desired sub1g EP", "GREEN")
|
|
181
|
+
|
|
182
|
+
# configuring TX #
|
|
183
|
+
# in sub1g must configure also the energy pattern
|
|
184
|
+
utPrint(f"Configuring BRG {tx_brg_.id_str} as SUB1G Signal Indicator Transmitter\n", "BOLD")
|
|
185
|
+
transmitter_cfg_pkt = WltPkt(hdr=DEFAULT_HDR, pkt=tx_module(seq_id=random.randrange(99), brg_mac=tx_brg_.id_int,
|
|
186
|
+
signal_indicator_cycle=tx_signal_ind_cycle, signal_indicator_rep=tx_signal_ind_rep, pattern=energy_pattern, duty_cycle=30))
|
|
187
|
+
test = cert_config.brg_configure(test=test, cfg_pkt=transmitter_cfg_pkt)[0]
|
|
188
|
+
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
189
|
+
test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
|
|
190
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
191
|
+
utPrint(f"BRG {tx_brg_.id_str} succesfully configured to be transmitter - cycle = {tx_signal_ind_cycle},"
|
|
192
|
+
f"repetition = {tx_signal_ind_rep}, pattern = {energy_pattern}", "GREEN")
|
|
193
|
+
|
|
194
|
+
# phase analysis #
|
|
195
|
+
mqtt_scan_n_create_log_file(test, (NUM_OF_SCANNING_CYCLE * tx_signal_ind_cycle) + SCAN_DELAY_TIME, phase)
|
|
196
|
+
expected_signal_ind_pkts = NUM_OF_SCANNING_CYCLE
|
|
197
|
+
received_signal_ind_pkts = get_all_signal_ind_pkt(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
|
|
198
|
+
if len(received_signal_ind_pkts) < expected_signal_ind_pkts:
|
|
199
|
+
test.rc = TEST_FAILED
|
|
200
|
+
test.add_reason(f"Phase {phase} failed - BRG {rx_brg_.id_str} received wrong number of "
|
|
201
|
+
f"signal indicator packets\n received {len(received_signal_ind_pkts)} packets, "
|
|
202
|
+
f"expected {expected_signal_ind_pkts} packets")
|
|
203
|
+
field_functionality_pass_fail_print(test,'Energy pattern',energy_pattern)
|
|
204
|
+
if test.rc == TEST_FAILED:
|
|
205
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
206
|
+
field_functionality_pass_fail_print(test,'phase',phase)
|
|
207
|
+
|
|
208
|
+
phase = 2
|
|
209
|
+
functionality_run_print(f"phase {phase}")
|
|
210
|
+
# Phase 2 - Tx BRG with rx. tx params changed from last values configured in phase 1
|
|
211
|
+
# expecting the receiver to receive signal indicator packets from the transmitter according to the tx params.
|
|
212
|
+
tx_signal_ind_cycle, tx_signal_ind_rep = get_phase_tx_params_values(phase, TX_BRG_IDX)
|
|
213
|
+
utPrint(f"TX BRG with RX- cycle = {tx_signal_ind_cycle}, repetition = {tx_signal_ind_rep}\n", "HEADER")
|
|
214
|
+
|
|
215
|
+
# configuring RX BRG to default pattern #
|
|
216
|
+
utPrint(f"Configuring BRG {rx_brg_.id_str} to default EP", "BOLD")
|
|
217
|
+
receiver_cfg_pkt = WltPkt(hdr=DEFAULT_HDR, pkt=tx_module(seq_id=random.randrange(99), brg_mac=rx_brg_.id_int, pattern=ag.SUB1G_ENERGY_PATTERN_ISRAEL, duty_cycle=30))
|
|
218
|
+
test = cert_config.brg1_configure(test=test, cfg_pkt=receiver_cfg_pkt)[0]
|
|
219
|
+
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
220
|
+
test.add_reason(f"Reciever BRG {rx_brg_.id_str} didn't revert to defualt sub1g EP!")
|
|
221
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
222
|
+
utPrint(f"Receiver BRG {rx_brg_.id_str} succesfully configured to desired sub1g EP", "GREEN")
|
|
223
|
+
|
|
224
|
+
# configuring transmitter, SUB1G_ENERGY_PATTERN_ISRAEL is must here because this is the receiver freq #
|
|
225
|
+
utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter\n", "BOLD")
|
|
226
|
+
transmitter_cfg_pkt = WltPkt(hdr=DEFAULT_HDR, pkt=tx_module(seq_id=random.randrange(99), brg_mac=tx_brg_.id_int,
|
|
227
|
+
signal_indicator_cycle=tx_signal_ind_cycle, signal_indicator_rep=tx_signal_ind_rep,
|
|
228
|
+
pattern=ag.SUB1G_ENERGY_PATTERN_ISRAEL, duty_cycle=30))
|
|
229
|
+
test = cert_config.brg_configure(test=test, cfg_pkt=transmitter_cfg_pkt)[0]
|
|
230
|
+
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
231
|
+
test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
|
|
232
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
233
|
+
utPrint(f"BRG {tx_brg_.id_str} succesfully configured to be transmitter - cycle = {tx_signal_ind_cycle},"
|
|
234
|
+
f"repetition = {tx_signal_ind_rep}, EP = {ag.SUB1G_ENERGY_PATTERN_ISRAEL}", "GREEN")
|
|
235
|
+
|
|
236
|
+
# phase analysis #
|
|
237
|
+
mqtt_scan_n_create_log_file(test, (NUM_OF_SCANNING_CYCLE*tx_signal_ind_cycle) + SCAN_DELAY_TIME, phase)
|
|
238
|
+
expected_signal_ind_pkts = NUM_OF_SCANNING_CYCLE
|
|
239
|
+
received_signal_ind_pkts = get_all_signal_ind_pkt(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
|
|
240
|
+
if (not len(received_signal_ind_pkts) or
|
|
241
|
+
len(received_signal_ind_pkts) < expected_signal_ind_pkts or
|
|
242
|
+
len(received_signal_ind_pkts) > expected_signal_ind_pkts):
|
|
243
|
+
test.rc = TEST_FAILED
|
|
244
|
+
test.add_reason(f"Phase {phase} failed - BRG {rx_brg_.id_str} received wrong number of "
|
|
245
|
+
f"signal indicator packets\n received {len(received_signal_ind_pkts)} packets, "
|
|
246
|
+
f"expected {expected_signal_ind_pkts} packets")
|
|
247
|
+
field_functionality_pass_fail_print(test,'phase',phase)
|
|
248
|
+
if test.rc == TEST_FAILED:
|
|
249
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
250
|
+
|
|
251
|
+
phase = 3
|
|
252
|
+
functionality_run_print(f"phase {phase}")
|
|
253
|
+
# Phase 3 - Rx BRG without tx.Expecting no signal indicator packets to be received.
|
|
254
|
+
tx_signal_ind_cycle, tx_signal_ind_rep = get_phase_tx_params_values(phase, TX_BRG_IDX)
|
|
255
|
+
utPrint(f"RX BRG without TX- cycle = {tx_signal_ind_cycle}, repetition = {tx_signal_ind_rep}\n", "HEADER")
|
|
256
|
+
|
|
257
|
+
# configuring transmitter to no TX #
|
|
258
|
+
utPrint(f"Configuring BRG {tx_brg_.id_str} to default\n", "BOLD")
|
|
259
|
+
transmitter_cfg_pkt = WltPkt(hdr=DEFAULT_HDR, pkt=tx_module(seq_id=random.randrange(99), brg_mac=tx_brg_.id_int,
|
|
260
|
+
signal_indicator_cycle=tx_signal_ind_cycle, signal_indicator_rep=tx_signal_ind_rep,
|
|
261
|
+
pattern=ag.SUB1G_ENERGY_PATTERN_ISRAEL))
|
|
262
|
+
test = cert_config.brg_configure(test=test, cfg_pkt=transmitter_cfg_pkt)[0]
|
|
263
|
+
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
264
|
+
test.add_reason(f"BRG {tx_brg_.id_str}: didn't revert to default (no signal indicator tx)!")
|
|
265
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
266
|
+
utPrint(f"BRG {tx_brg_.id_str} succesfully configured to default!!! cycle = {tx_signal_ind_cycle},"
|
|
267
|
+
f"repetition = {tx_signal_ind_rep}, EP = {ag.SUB1G_ENERGY_PATTERN_ISRAEL}", "GREEN")
|
|
268
|
+
|
|
269
|
+
# phase analysis #
|
|
270
|
+
mqtt_scan_n_create_log_file(test, DEFAULT_SCAN_TIME, phase)
|
|
271
|
+
expected_signal_ind_pkts = 0
|
|
272
|
+
received_signal_ind_pkts = get_all_signal_ind_pkt(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
|
|
273
|
+
if len(received_signal_ind_pkts) != expected_signal_ind_pkts:
|
|
274
|
+
test.rc = TEST_FAILED
|
|
275
|
+
test.add_reason(f"Phase {phase} failed - received signal indicator packet from BRG"
|
|
276
|
+
f"{rx_brg_.id_str}")
|
|
277
|
+
field_functionality_pass_fail_print(test,'phase',phase)
|
|
278
|
+
if test.rc == TEST_FAILED:
|
|
279
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True, modules=modules)
|
|
280
|
+
|
|
281
|
+
if not test.internal_brg:
|
|
282
|
+
phase = 4
|
|
283
|
+
functionality_run_print(f"phase {phase}")
|
|
284
|
+
# Phase 4 - Both BRG's will be configured to be transmitters and receivers, with different tx params for each one.
|
|
285
|
+
# expecting to see signal indicator packets from both BRG's, according to the tx params.
|
|
286
|
+
utPrint(f"Both BRG's are transmitter and receivers, with different values\n", "HEADER")
|
|
287
|
+
|
|
288
|
+
# configuring first BRG (tx_brg_) #
|
|
289
|
+
tx_brg_signal_indicator_cycle, tx_brg_signal_indicator_rep = get_phase_tx_params_values(phase, TX_BRG_IDX)
|
|
290
|
+
# configuring first brg (tx_brg_) as receiver
|
|
291
|
+
utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Receiver", "BOLD")
|
|
292
|
+
test = cert_config.brg_configure(test=test, module=ext_sensors_module, fields=[BRG_SENSOR0], values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR])[0]
|
|
293
|
+
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
294
|
+
test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator receiver configuration!")
|
|
295
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
296
|
+
utPrint(f"BRG {tx_brg_.id_str} successfully configured as Signal Indicator Receiver\n", "GREEN")
|
|
297
|
+
# configuring first brg (tx_brg_) as transmitter
|
|
298
|
+
utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
|
|
299
|
+
transmitter_cfg_pkt = WltPkt(hdr=DEFAULT_HDR, pkt=tx_module(seq_id=random.randrange(99), brg_mac=tx_brg_.id_int,
|
|
300
|
+
signal_indicator_cycle=tx_brg_signal_indicator_cycle, signal_indicator_rep=tx_brg_signal_indicator_rep,
|
|
301
|
+
pattern=ag.SUB1G_ENERGY_PATTERN_ISRAEL))
|
|
302
|
+
test = cert_config.brg_configure(test=test, cfg_pkt=transmitter_cfg_pkt)[0]
|
|
303
|
+
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
304
|
+
test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
|
|
305
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
306
|
+
utPrint(f"BRG {tx_brg_.id_str} succesfully configured to be transmitter - cycle = {tx_brg_signal_indicator_cycle},"
|
|
307
|
+
f"repetition = {tx_brg_signal_indicator_rep}, EP = {ag.SUB1G_ENERGY_PATTERN_ISRAEL}", "GREEN")
|
|
308
|
+
|
|
309
|
+
# configuring second BRG (rx_brg_), already configured as rx, need only tx configuration #
|
|
310
|
+
rx_brg_signal_indicator_cycle, rx_brg_signal_indicator_rep = get_phase_tx_params_values(phase, RX_BRG_IDX)
|
|
311
|
+
# configuring second brg (rx_brg_) as transmitter
|
|
312
|
+
utPrint(f"Configuring BRG {rx_brg_.id_str} as Signal Indicator Transmitter\n", "BOLD")
|
|
313
|
+
transmitter_cfg_pkt = WltPkt(hdr=DEFAULT_HDR, pkt=tx_module(seq_id=random.randrange(99), brg_mac=rx_brg_.id_int,
|
|
314
|
+
signal_indicator_cycle=rx_brg_signal_indicator_cycle, signal_indicator_rep=rx_brg_signal_indicator_rep,
|
|
315
|
+
pattern=ag.SUB1G_ENERGY_PATTERN_ISRAEL))
|
|
316
|
+
test = cert_config.brg1_configure(test=test, cfg_pkt=transmitter_cfg_pkt)[0]
|
|
317
|
+
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
318
|
+
test.add_reason(f"BRG {rx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
|
|
319
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
320
|
+
utPrint(f"BRG {rx_brg_.id_str} succesfully configured to be transmitter - cycle = {rx_brg_signal_indicator_cycle},"
|
|
321
|
+
f"repetition = {rx_brg_signal_indicator_rep}, EP = {ag.SUB1G_ENERGY_PATTERN_ISRAEL}", "GREEN")
|
|
322
|
+
|
|
323
|
+
# phase analysis #
|
|
324
|
+
mqtt_scan_n_create_log_file(test, NUM_OF_SCANNING_CYCLE * max(tx_brg_signal_indicator_cycle, rx_brg_signal_indicator_cycle) + SCAN_DELAY_TIME, phase)
|
|
325
|
+
|
|
326
|
+
# Analysing tx_brg_ performance as receiver
|
|
327
|
+
rx_brg_tx_cycles = max(tx_brg_signal_indicator_cycle, rx_brg_signal_indicator_cycle) / rx_brg_signal_indicator_cycle
|
|
328
|
+
expected_signal_ind_pkts = int(NUM_OF_SCANNING_CYCLE * rx_brg_tx_cycles)
|
|
329
|
+
received_signal_ind_pkts = get_all_signal_ind_pkt(test=test, rx_brg=tx_brg_, tx_brg=rx_brg_)
|
|
330
|
+
if (not len(received_signal_ind_pkts) or
|
|
331
|
+
len(received_signal_ind_pkts) < expected_signal_ind_pkts or
|
|
332
|
+
len(received_signal_ind_pkts) > expected_signal_ind_pkts):
|
|
333
|
+
test.rc = TEST_FAILED
|
|
334
|
+
test.add_reason(f"Phase {phase} failed - BRG {tx_brg_.id_str} received wrong number of "
|
|
335
|
+
f"signal indicator packets\n received {len(received_signal_ind_pkts)} packets, "
|
|
336
|
+
f"expected {expected_signal_ind_pkts} packets")
|
|
337
|
+
if test.rc == TEST_FAILED:
|
|
338
|
+
field_functionality_pass_fail_print(test,'phase',phase)
|
|
339
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
340
|
+
|
|
341
|
+
# Analysing rx_brg_ performance as receiver
|
|
342
|
+
tx_brg_tx_cycles = max(tx_brg_signal_indicator_cycle, rx_brg_signal_indicator_cycle) / tx_brg_signal_indicator_cycle
|
|
343
|
+
expected_signal_ind_pkts = int(NUM_OF_SCANNING_CYCLE * tx_brg_tx_cycles)
|
|
344
|
+
received_signal_ind_pkts = get_all_signal_ind_pkt(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
|
|
345
|
+
if (not len(received_signal_ind_pkts) or
|
|
346
|
+
len(received_signal_ind_pkts) < expected_signal_ind_pkts or
|
|
347
|
+
len(received_signal_ind_pkts) > expected_signal_ind_pkts):
|
|
348
|
+
test.rc = TEST_FAILED
|
|
349
|
+
test.add_reason(f"Phase {phase} failed - BRG {rx_brg_.id_str} received wrong number of "
|
|
350
|
+
f"signal indicator packets\n received {len(received_signal_ind_pkts)} packets, "
|
|
351
|
+
f"expected {expected_signal_ind_pkts} packets")
|
|
352
|
+
if test.rc == TEST_FAILED:
|
|
353
|
+
field_functionality_pass_fail_print(test,'phase',phase)
|
|
354
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
355
|
+
field_functionality_pass_fail_print(test,'phase',phase)
|
|
356
|
+
|
|
357
|
+
phase = 5 if not test.internal_brg else 4
|
|
358
|
+
functionality_run_print(f"phase {phase}")
|
|
359
|
+
# for internal_brg this is phase 4 !!!!!!!!!!!!!!!!
|
|
360
|
+
# Phase 5 - Tx BRG without rx. just waiting for packets to be sent from the transmitter and verify
|
|
361
|
+
# The receiver isn't receiving any signal indicator packets.
|
|
362
|
+
tx_signal_ind_cycle, tx_signal_ind_rep = get_phase_tx_params_values(5, TX_BRG_IDX)
|
|
363
|
+
utPrint(f"TX BRG without RX - cycle = {tx_signal_ind_cycle}, repetition = {tx_signal_ind_rep}\n", "HEADER")
|
|
364
|
+
|
|
365
|
+
# restore default configuration for receiver #
|
|
366
|
+
utPrint(f"Configuring BRG {rx_brg_.id_str} to default", "BOLD")
|
|
367
|
+
test = cert_config.config_brg1_defaults(test, modules=modules)[0]
|
|
368
|
+
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
369
|
+
test.add_reason(f"BRG {rx_brg_.id_str}: didn't revert to default configuration!")
|
|
370
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
371
|
+
|
|
372
|
+
# configuring transmitter #
|
|
373
|
+
utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
|
|
374
|
+
transmitter_cfg_pkt = WltPkt(hdr=DEFAULT_HDR, pkt=tx_module(seq_id=random.randrange(99), brg_mac=tx_brg_.id_int,
|
|
375
|
+
signal_indicator_cycle=tx_signal_ind_cycle, signal_indicator_rep=tx_signal_ind_rep,
|
|
376
|
+
pattern=ag.SUB1G_ENERGY_PATTERN_ISRAEL))
|
|
377
|
+
test = cert_config.brg_configure(test=test, cfg_pkt=transmitter_cfg_pkt)[0]
|
|
378
|
+
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
379
|
+
test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
|
|
380
|
+
return terminate_test(test, phase=phase, revert_tx_brg=True, modules=modules)
|
|
381
|
+
utPrint(f"BRG {tx_brg_.id_str} succesfully configured to be transmitter - cycle = {tx_signal_ind_cycle},"
|
|
382
|
+
f"repetition = {tx_signal_ind_rep}, EP = {ag.SUB1G_ENERGY_PATTERN_ISRAEL}", "GREEN")
|
|
383
|
+
|
|
384
|
+
# phase analysis #
|
|
385
|
+
mqtt_scan_n_create_log_file(test, (NUM_OF_SCANNING_CYCLE*tx_signal_ind_cycle) + SCAN_DELAY_TIME, phase)
|
|
386
|
+
expected_signal_ind_pkts = 0
|
|
387
|
+
received_signal_ind_pkts = get_all_signal_ind_pkt(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
|
|
388
|
+
if len(received_signal_ind_pkts) != expected_signal_ind_pkts:
|
|
389
|
+
test.rc = TEST_FAILED
|
|
390
|
+
test.add_reason(f"Phase {phase} failed - received signal indicator packet from BRG"
|
|
391
|
+
f"{rx_brg_.id_str}")
|
|
392
|
+
field_functionality_pass_fail_print(test,'phase',phase)
|
|
393
|
+
if test.rc == TEST_FAILED:
|
|
394
|
+
return terminate_test(test, phase=phase, revert_rx_brg=False,revert_tx_brg=True, modules=modules)
|
|
395
|
+
|
|
396
|
+
# Test epilog
|
|
397
|
+
return terminate_test(test, phase=phase, revert_rx_brg=False,revert_tx_brg=True, modules=modules)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "signal_indicator_test",
|
|
3
|
+
"module": "energy_sub1g",
|
|
4
|
+
"purpose": "Test configuration for supported energy_sub1g signal indicator cycle & repetitions 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": [[60,4], [100,3]]
|
|
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_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP]
|
|
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
|
+
field_functionality_pass_fail_print(test, fields[0] + "_sub1g", value=param_name)
|
|
19
|
+
generate_log_file(test, 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,72 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# source: wltPb.proto
|
|
4
|
+
# Protobuf Python Version: 4.25.1
|
|
5
|
+
"""Generated protocol buffer code."""
|
|
6
|
+
from google.protobuf import descriptor as _descriptor
|
|
7
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
8
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
9
|
+
from google.protobuf.internal import builder as _builder
|
|
10
|
+
# @@protoc_insertion_point(imports)
|
|
11
|
+
|
|
12
|
+
_sym_db = _symbol_database.Default()
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0bwltPb.proto\x12\x05wltPb\"$\n\x08Location\x12\x0b\n\x03lat\x18\x01 \x01(\x01\x12\x0b\n\x03lng\x18\x02 \x01(\x01\"j\n\x05Value\x12\x16\n\x0cintegerValue\x18\x01 \x01(\x03H\x00\x12\x15\n\x0bnumberValue\x18\x02 \x01(\x01H\x00\x12\x15\n\x0bstringValue\x18\x03 \x01(\tH\x00\x12\x13\n\tboolValue\x18\x04 \x01(\x08H\x00\x42\x06\n\x04type\"\x89\x02\n\x0bGatewayData\x12\x11\n\tgatewayId\x18\x01 \x01(\t\x12\x11\n\ttimestamp\x18\x02 \x01(\x04\x12*\n\x07packets\x18\x03 \x03(\x0b\x32\x19.wltPb.GatewayData.Packet\x12&\n\x08location\x18\x04 \x01(\x0b\x32\x0f.wltPb.LocationH\x00\x88\x01\x01\x1as\n\x06Packet\x12\x0f\n\x07payload\x18\x01 \x01(\x0c\x12\x11\n\ttimestamp\x18\x02 \x01(\x04\x12\x12\n\nsequenceId\x18\x03 \x01(\r\x12\x11\n\x04rssi\x18\x04 \x01(\rH\x00\x88\x01\x01\x12\x15\n\raliasBridgeId\x18\x05 \x01(\tB\x07\n\x05_rssiB\x0b\n\t_location\"\xc9\x01\n\rUplinkMessage\x12-\n\rgatewayStatus\x18\x01 \x01(\x0b\x32\x14.wltPb.GatewayStatusH\x00\x12)\n\x0bgatewayInfo\x18\x02 \x01(\x0b\x32\x12.wltPb.GatewayInfoH\x00\x12)\n\x0bgatewayLogs\x18\x03 \x01(\x0b\x32\x12.wltPb.GatewayLogsH\x00\x12+\n\x0c\x61\x63tionStatus\x18\x04 \x01(\x0b\x32\x13.wltPb.ActionStatusH\x00\x42\x06\n\x04type\"\xdb\x03\n\rGatewayStatus\x12\x11\n\tgatewayId\x18\x01 \x01(\t\x12\x13\n\x0bgatewayType\x18\x02 \x01(\t\x12\x19\n\x11\x64ownlinkSupported\x18\x03 \x01(\x08\x12!\n\x19\x62ridgeOtaUpgradeSupported\x18\x04 \x01(\x08\x12\x12\n\napiVersion\x18\x05 \x01(\r\x12\x14\n\x07version\x18\x06 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0c\x62leSwVersion\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x1f\n\x12interfaceSwVersion\x18\x08 \x01(\tH\x02\x88\x01\x01\x12&\n\x08location\x18\t \x01(\x0b\x32\x0f.wltPb.LocationH\x03\x88\x01\x01\x12\x30\n\x06\x63onfig\x18\n \x03(\x0b\x32 .wltPb.GatewayStatus.ConfigEntry\x12\x17\n\nbleAddress\x18\x0b \x01(\tH\x04\x88\x01\x01\x1a;\n\x0b\x43onfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1b\n\x05value\x18\x02 \x01(\x0b\x32\x0c.wltPb.Value:\x02\x38\x01\x42\n\n\x08_versionB\x0f\n\r_bleSwVersionB\x15\n\x13_interfaceSwVersionB\x0b\n\t_locationB\r\n\x0b_bleAddress\"}\n\x0bGatewayInfo\x12\x30\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x1f.wltPb.GatewayInfo.EntriesEntry\x1a<\n\x0c\x45ntriesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1b\n\x05value\x18\x02 \x01(\x0b\x32\x0c.wltPb.Value:\x02\x38\x01\"\x1b\n\x0bGatewayLogs\x12\x0c\n\x04logs\x18\x01 \x03(\t\".\n\x0c\x41\x63tionStatus\x12\x0e\n\x06\x61\x63tion\x18\x01 \x01(\r\x12\x0e\n\x06status\x18\x02 \x01(\r\"\xa7\x02\n\x0f\x44ownlinkMessage\x12#\n\x08txPacket\x18\x01 \x01(\x0b\x32\x0f.wltPb.TxPacketH\x00\x12-\n\rgatewayAction\x18\x02 \x01(\x0b\x32\x14.wltPb.GatewayActionH\x00\x12-\n\rbridgeUpgrade\x18\x03 \x01(\x0b\x32\x14.wltPb.BridgeUpgradeH\x00\x12-\n\rgatewayConfig\x18\x04 \x01(\x0b\x32\x14.wltPb.GatewayConfigH\x00\x12+\n\x0c\x63ustomBroker\x18\x05 \x01(\x0b\x32\x13.wltPb.CustomBrokerH\x00\x12-\n\rcustomMessage\x18\x06 \x01(\x0b\x32\x14.wltPb.CustomMessageH\x00\x42\x06\n\x04type\"F\n\x08TxPacket\x12\x0f\n\x07payload\x18\x01 \x01(\x0c\x12\x12\n\nmaxRetries\x18\x02 \x01(\r\x12\x15\n\rmaxDurationMs\x18\x03 \x01(\r\"\x1f\n\rGatewayAction\x12\x0e\n\x06\x61\x63tion\x18\x01 \x01(\t\"\xa5\x01\n\rBridgeUpgrade\x12\x14\n\x0crebootPacket\x18\x01 \x01(\x0c\x12\x17\n\x0ftxMaxDurationMs\x18\x02 \x01(\r\x12\x14\n\x0ctxMaxRetries\x18\x03 \x01(\r\x12\x10\n\x08\x62ridgeId\x18\x04 \x01(\t\x12\x13\n\x0bversionUuid\x18\x05 \x01(\t\x12\x13\n\x0bupgradeBlSd\x18\x06 \x01(\x08\x12\x13\n\x0bimageDirUrl\x18\x07 \x01(\t\"\xb9\x02\n\rGatewayConfig\x12\x14\n\x07version\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0c\x62leSwVersion\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x1f\n\x12interfaceSwVersion\x18\x03 \x01(\tH\x02\x88\x01\x01\x12&\n\x08location\x18\x04 \x01(\x0b\x32\x0f.wltPb.LocationH\x03\x88\x01\x01\x12\x30\n\x06\x63onfig\x18\x05 \x03(\x0b\x32 .wltPb.GatewayConfig.ConfigEntry\x1a;\n\x0b\x43onfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1b\n\x05value\x18\x02 \x01(\x0b\x32\x0c.wltPb.Value:\x02\x38\x01\x42\n\n\x08_versionB\x0f\n\r_bleSwVersionB\x15\n\x13_interfaceSwVersionB\x0b\n\t_location\"\xa6\x01\n\x0c\x43ustomBroker\x12\x14\n\x0c\x63ustomBroker\x18\x01 \x01(\x08\x12\x0c\n\x04port\x18\x02 \x01(\r\x12\x11\n\tbrokerUrl\x18\x03 \x01(\t\x12\x10\n\x08username\x18\x04 \x01(\t\x12\x10\n\x08password\x18\x05 \x01(\t\x12\x13\n\x0bupdateTopic\x18\x06 \x01(\t\x12\x13\n\x0bstatusTopic\x18\x07 \x01(\t\x12\x11\n\tdataTopic\x18\x08 \x01(\t\"\x81\x01\n\rCustomMessage\x12\x32\n\x07\x65ntries\x18\x01 \x03(\x0b\x32!.wltPb.CustomMessage.EntriesEntry\x1a<\n\x0c\x45ntriesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1b\n\x05value\x18\x02 \x01(\x0b\x32\x0c.wltPb.Value:\x02\x38\x01\x62\x06proto3')
|
|
18
|
+
|
|
19
|
+
_globals = globals()
|
|
20
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
21
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'wltPb_pb2', _globals)
|
|
22
|
+
if _descriptor._USE_C_DESCRIPTORS == False:
|
|
23
|
+
DESCRIPTOR._options = None
|
|
24
|
+
_globals['_GATEWAYSTATUS_CONFIGENTRY']._options = None
|
|
25
|
+
_globals['_GATEWAYSTATUS_CONFIGENTRY']._serialized_options = b'8\001'
|
|
26
|
+
_globals['_GATEWAYINFO_ENTRIESENTRY']._options = None
|
|
27
|
+
_globals['_GATEWAYINFO_ENTRIESENTRY']._serialized_options = b'8\001'
|
|
28
|
+
_globals['_GATEWAYCONFIG_CONFIGENTRY']._options = None
|
|
29
|
+
_globals['_GATEWAYCONFIG_CONFIGENTRY']._serialized_options = b'8\001'
|
|
30
|
+
_globals['_CUSTOMMESSAGE_ENTRIESENTRY']._options = None
|
|
31
|
+
_globals['_CUSTOMMESSAGE_ENTRIESENTRY']._serialized_options = b'8\001'
|
|
32
|
+
_globals['_LOCATION']._serialized_start=22
|
|
33
|
+
_globals['_LOCATION']._serialized_end=58
|
|
34
|
+
_globals['_VALUE']._serialized_start=60
|
|
35
|
+
_globals['_VALUE']._serialized_end=166
|
|
36
|
+
_globals['_GATEWAYDATA']._serialized_start=169
|
|
37
|
+
_globals['_GATEWAYDATA']._serialized_end=434
|
|
38
|
+
_globals['_GATEWAYDATA_PACKET']._serialized_start=306
|
|
39
|
+
_globals['_GATEWAYDATA_PACKET']._serialized_end=421
|
|
40
|
+
_globals['_UPLINKMESSAGE']._serialized_start=437
|
|
41
|
+
_globals['_UPLINKMESSAGE']._serialized_end=638
|
|
42
|
+
_globals['_GATEWAYSTATUS']._serialized_start=641
|
|
43
|
+
_globals['_GATEWAYSTATUS']._serialized_end=1116
|
|
44
|
+
_globals['_GATEWAYSTATUS_CONFIGENTRY']._serialized_start=977
|
|
45
|
+
_globals['_GATEWAYSTATUS_CONFIGENTRY']._serialized_end=1036
|
|
46
|
+
_globals['_GATEWAYINFO']._serialized_start=1118
|
|
47
|
+
_globals['_GATEWAYINFO']._serialized_end=1243
|
|
48
|
+
_globals['_GATEWAYINFO_ENTRIESENTRY']._serialized_start=1183
|
|
49
|
+
_globals['_GATEWAYINFO_ENTRIESENTRY']._serialized_end=1243
|
|
50
|
+
_globals['_GATEWAYLOGS']._serialized_start=1245
|
|
51
|
+
_globals['_GATEWAYLOGS']._serialized_end=1272
|
|
52
|
+
_globals['_ACTIONSTATUS']._serialized_start=1274
|
|
53
|
+
_globals['_ACTIONSTATUS']._serialized_end=1320
|
|
54
|
+
_globals['_DOWNLINKMESSAGE']._serialized_start=1323
|
|
55
|
+
_globals['_DOWNLINKMESSAGE']._serialized_end=1618
|
|
56
|
+
_globals['_TXPACKET']._serialized_start=1620
|
|
57
|
+
_globals['_TXPACKET']._serialized_end=1690
|
|
58
|
+
_globals['_GATEWAYACTION']._serialized_start=1692
|
|
59
|
+
_globals['_GATEWAYACTION']._serialized_end=1723
|
|
60
|
+
_globals['_BRIDGEUPGRADE']._serialized_start=1726
|
|
61
|
+
_globals['_BRIDGEUPGRADE']._serialized_end=1891
|
|
62
|
+
_globals['_GATEWAYCONFIG']._serialized_start=1894
|
|
63
|
+
_globals['_GATEWAYCONFIG']._serialized_end=2207
|
|
64
|
+
_globals['_GATEWAYCONFIG_CONFIGENTRY']._serialized_start=977
|
|
65
|
+
_globals['_GATEWAYCONFIG_CONFIGENTRY']._serialized_end=1036
|
|
66
|
+
_globals['_CUSTOMBROKER']._serialized_start=2210
|
|
67
|
+
_globals['_CUSTOMBROKER']._serialized_end=2376
|
|
68
|
+
_globals['_CUSTOMMESSAGE']._serialized_start=2379
|
|
69
|
+
_globals['_CUSTOMMESSAGE']._serialized_end=2508
|
|
70
|
+
_globals['_CUSTOMMESSAGE_ENTRIESENTRY']._serialized_start=1183
|
|
71
|
+
_globals['_CUSTOMMESSAGE_ENTRIESENTRY']._serialized_end=1243
|
|
72
|
+
# @@protoc_insertion_point(module_scope)
|