wiliot-certificate 1.5.2a1__py3-none-any.whl → 4.4.0a1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- brg_certificate/ag/energous_v0_defines.py +3 -3
- brg_certificate/ag/energous_v1_defines.py +3 -3
- brg_certificate/ag/energous_v2_defines.py +3 -3
- brg_certificate/ag/energous_v3_defines.py +3 -3
- brg_certificate/ag/energous_v4_defines.py +3 -3
- brg_certificate/ag/fanstel_lan_v0_defines.py +3 -3
- brg_certificate/ag/fanstel_lte_v0_defines.py +3 -3
- brg_certificate/ag/fanstel_wifi_v0_defines.py +3 -3
- brg_certificate/ag/minew_lte_v0_defines.py +3 -3
- brg_certificate/ag/wlt_types.html +3 -3
- brg_certificate/ag/wlt_types_ag.py +8 -8
- brg_certificate/cert_common.py +61 -11
- brg_certificate/cert_config.py +12 -7
- brg_certificate/cert_utils.py +3 -1
- brg_certificate/certificate_bcc_test_list.txt +2 -2
- brg_certificate/certificate_test_list.txt +4 -4
- brg_certificate/tests/calibration/interval_test/interval_test.py +7 -6
- brg_certificate/tests/calibration/output_power_test/output_power_test.py +7 -6
- brg_certificate/tests/calibration/pattern_test/pattern_test.py +20 -10
- brg_certificate/tests/datapath/aging_test/aging_test.py +11 -9
- brg_certificate/tests/datapath/num_of_tags_test/num_of_tags_test.py +11 -13
- brg_certificate/tests/datapath/output_power_test/output_power_test.py +7 -5
- brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +13 -8
- brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.py +11 -4
- brg_certificate/tests/datapath/pacer_interval_test/pacer_interval_test.py +12 -10
- brg_certificate/tests/datapath/pattern_test/pattern_test.py +7 -6
- brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +12 -9
- brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.py +13 -10
- brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.py +13 -11
- brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.py +13 -11
- brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.py +7 -7
- brg_certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +34 -35
- brg_certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.py +41 -44
- brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.json +1 -2
- brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.py +7 -9
- brg_certificate/tests/datapath/stress_test/stress_test.json +1 -2
- brg_certificate/tests/datapath/stress_test/stress_test.py +8 -10
- brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.py +1 -1
- brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.py +14 -11
- brg_certificate/tests/edge_mgmt/actions_test/actions_test.py +15 -13
- brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.py +1 -1
- brg_certificate/tests/edge_mgmt/leds_test/leds_test.py +2 -2
- brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.py +7 -5
- brg_certificate/tests/energy2400/output_power_test/output_power_test.py +7 -5
- brg_certificate/tests/energy2400/pattern_test/pattern_test.py +7 -5
- brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.json +2 -2
- brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.py +256 -278
- brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.json +2 -2
- brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.py +256 -278
- brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.py +3 -3
- brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +30 -91
- brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.py +7 -6
- brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.py +7 -5
- brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.py +2 -2
- brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.py +7 -6
- brg_certificate/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.py +2 -2
- brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +8 -7
- gw_certificate/api_if/gw_capabilities.py +37 -1
- gw_certificate/common/serialization_formatter.py +80 -0
- gw_certificate/common/wltPb_pb2.py +50 -38
- gw_certificate/common/wltPb_pb2.pyi +42 -35
- gw_certificate/gw_certificate.py +4 -2
- gw_certificate/gw_certificate_cli.py +5 -4
- gw_certificate/interface/4.4.88_app.zip +0 -0
- gw_certificate/interface/{4.4.52_sd_bl_app.zip → 4.4.88_sd_bl_app.zip} +0 -0
- gw_certificate/interface/ble_simulator.py +5 -3
- gw_certificate/interface/mqtt.py +39 -23
- gw_certificate/interface/pkt_generator.py +0 -44
- gw_certificate/interface/uart_if.py +25 -12
- gw_certificate/tests/actions.py +33 -5
- gw_certificate/tests/connection.py +3 -1
- gw_certificate/tests/generic.py +1 -1
- gw_certificate/tests/registration.py +4 -4
- gw_certificate/tests/static/generated_packet_table.py +47 -25
- gw_certificate/tests/static/packet_table.csv +10067 -10051
- gw_certificate/tests/static/uplink_defines.py +1 -0
- gw_certificate/tests/throughput.py +2 -1
- gw_certificate/tests/uplink.py +142 -22
- {wiliot_certificate-1.5.2a1.dist-info → wiliot_certificate-4.4.0a1.dist-info}/METADATA +1 -1
- {wiliot_certificate-1.5.2a1.dist-info → wiliot_certificate-4.4.0a1.dist-info}/RECORD +84 -83
- gw_certificate/interface/4.4.52_app.zip +0 -0
- {wiliot_certificate-1.5.2a1.dist-info → wiliot_certificate-4.4.0a1.dist-info}/WHEEL +0 -0
- {wiliot_certificate-1.5.2a1.dist-info → wiliot_certificate-4.4.0a1.dist-info}/entry_points.txt +0 -0
- {wiliot_certificate-1.5.2a1.dist-info → wiliot_certificate-4.4.0a1.dist-info}/licenses/LICENSE +0 -0
- {wiliot_certificate-1.5.2a1.dist-info → wiliot_certificate-4.4.0a1.dist-info}/top_level.txt +0 -0
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
3
4
|
# source: wltPb.proto
|
|
4
|
-
# Protobuf Python Version:
|
|
5
|
+
# Protobuf Python Version: 6.30.2
|
|
5
6
|
"""Generated protocol buffer code."""
|
|
6
7
|
from google.protobuf import descriptor as _descriptor
|
|
7
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
8
10
|
from google.protobuf import symbol_database as _symbol_database
|
|
9
11
|
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
30,
|
|
16
|
+
2,
|
|
17
|
+
'',
|
|
18
|
+
'wltPb.proto'
|
|
19
|
+
)
|
|
10
20
|
# @@protoc_insertion_point(imports)
|
|
11
21
|
|
|
12
22
|
_sym_db = _symbol_database.Default()
|
|
@@ -14,20 +24,20 @@ _sym_db = _symbol_database.Default()
|
|
|
14
24
|
|
|
15
25
|
|
|
16
26
|
|
|
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\"\
|
|
27
|
+
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\"&\n\x03\x41\x43L\x12\x12\n\nmode_allow\x18\x01 \x01(\x08\x12\x0b\n\x03ids\x18\x02 \x03(\x0c\"\x97\x01\n\x12GatewayConfigValue\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\x12\x1e\n\x08\x61\x63lValue\x18\x05 \x01(\x0b\x32\n.wltPb.ACLH\x00\x42\x06\n\x04type\"\xe8\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\x1aH\n\x0b\x43onfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.wltPb.GatewayConfigValue:\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\"\x92\x01\n\x0c\x41\x63tionStatus\x12\x0e\n\x06\x61\x63tion\x18\x01 \x01(\r\x12\x0e\n\x06status\x18\x02 \x01(\r\x12\x11\n\x04step\x18\x03 \x01(\rH\x00\x88\x01\x01\x12\x15\n\x08progress\x18\x04 \x01(\rH\x01\x88\x01\x01\x12\x15\n\x08\x62ridgeId\x18\x05 \x01(\x0cH\x02\x88\x01\x01\x42\x07\n\x05_stepB\x0b\n\t_progressB\x0b\n\t_bridgeId\"\x8e\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\rcustomMessage\x18\x06 \x01(\x0b\x32\x14.wltPb.CustomMessageH\x00\x42\x06\n\x04typeJ\x04\x08\x05\x10\x06R\x0c\x63ustomBroker\"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\"\xc6\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\x1aH\n\x0b\x43onfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.wltPb.GatewayConfigValue:\x02\x38\x01\x42\n\n\x08_versionB\x0f\n\r_bleSwVersionB\x15\n\x13_interfaceSwVersionB\x0b\n\t_location\"\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
28
|
|
|
19
29
|
_globals = globals()
|
|
20
30
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
21
31
|
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'wltPb_pb2', _globals)
|
|
22
|
-
if _descriptor._USE_C_DESCRIPTORS
|
|
23
|
-
DESCRIPTOR.
|
|
24
|
-
_globals['_GATEWAYSTATUS_CONFIGENTRY'].
|
|
32
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
33
|
+
DESCRIPTOR._loaded_options = None
|
|
34
|
+
_globals['_GATEWAYSTATUS_CONFIGENTRY']._loaded_options = None
|
|
25
35
|
_globals['_GATEWAYSTATUS_CONFIGENTRY']._serialized_options = b'8\001'
|
|
26
|
-
_globals['_GATEWAYINFO_ENTRIESENTRY'].
|
|
36
|
+
_globals['_GATEWAYINFO_ENTRIESENTRY']._loaded_options = None
|
|
27
37
|
_globals['_GATEWAYINFO_ENTRIESENTRY']._serialized_options = b'8\001'
|
|
28
|
-
_globals['_GATEWAYCONFIG_CONFIGENTRY'].
|
|
38
|
+
_globals['_GATEWAYCONFIG_CONFIGENTRY']._loaded_options = None
|
|
29
39
|
_globals['_GATEWAYCONFIG_CONFIGENTRY']._serialized_options = b'8\001'
|
|
30
|
-
_globals['_CUSTOMMESSAGE_ENTRIESENTRY'].
|
|
40
|
+
_globals['_CUSTOMMESSAGE_ENTRIESENTRY']._loaded_options = None
|
|
31
41
|
_globals['_CUSTOMMESSAGE_ENTRIESENTRY']._serialized_options = b'8\001'
|
|
32
42
|
_globals['_LOCATION']._serialized_start=22
|
|
33
43
|
_globals['_LOCATION']._serialized_end=58
|
|
@@ -39,34 +49,36 @@ if _descriptor._USE_C_DESCRIPTORS == False:
|
|
|
39
49
|
_globals['_GATEWAYDATA_PACKET']._serialized_end=421
|
|
40
50
|
_globals['_UPLINKMESSAGE']._serialized_start=437
|
|
41
51
|
_globals['_UPLINKMESSAGE']._serialized_end=638
|
|
42
|
-
_globals['
|
|
43
|
-
_globals['
|
|
44
|
-
_globals['
|
|
45
|
-
_globals['
|
|
46
|
-
_globals['
|
|
47
|
-
_globals['
|
|
48
|
-
_globals['
|
|
49
|
-
_globals['
|
|
50
|
-
_globals['
|
|
51
|
-
_globals['
|
|
52
|
-
_globals['
|
|
53
|
-
_globals['
|
|
54
|
-
_globals['
|
|
55
|
-
_globals['
|
|
56
|
-
_globals['
|
|
57
|
-
_globals['
|
|
58
|
-
_globals['
|
|
59
|
-
_globals['
|
|
60
|
-
_globals['
|
|
61
|
-
_globals['
|
|
62
|
-
_globals['
|
|
63
|
-
_globals['
|
|
64
|
-
_globals['
|
|
65
|
-
_globals['
|
|
66
|
-
_globals['
|
|
67
|
-
_globals['
|
|
68
|
-
_globals['
|
|
69
|
-
_globals['
|
|
70
|
-
_globals['
|
|
71
|
-
_globals['
|
|
52
|
+
_globals['_ACL']._serialized_start=640
|
|
53
|
+
_globals['_ACL']._serialized_end=678
|
|
54
|
+
_globals['_GATEWAYCONFIGVALUE']._serialized_start=681
|
|
55
|
+
_globals['_GATEWAYCONFIGVALUE']._serialized_end=832
|
|
56
|
+
_globals['_GATEWAYSTATUS']._serialized_start=835
|
|
57
|
+
_globals['_GATEWAYSTATUS']._serialized_end=1323
|
|
58
|
+
_globals['_GATEWAYSTATUS_CONFIGENTRY']._serialized_start=1171
|
|
59
|
+
_globals['_GATEWAYSTATUS_CONFIGENTRY']._serialized_end=1243
|
|
60
|
+
_globals['_GATEWAYINFO']._serialized_start=1325
|
|
61
|
+
_globals['_GATEWAYINFO']._serialized_end=1450
|
|
62
|
+
_globals['_GATEWAYINFO_ENTRIESENTRY']._serialized_start=1390
|
|
63
|
+
_globals['_GATEWAYINFO_ENTRIESENTRY']._serialized_end=1450
|
|
64
|
+
_globals['_GATEWAYLOGS']._serialized_start=1452
|
|
65
|
+
_globals['_GATEWAYLOGS']._serialized_end=1479
|
|
66
|
+
_globals['_ACTIONSTATUS']._serialized_start=1482
|
|
67
|
+
_globals['_ACTIONSTATUS']._serialized_end=1628
|
|
68
|
+
_globals['_DOWNLINKMESSAGE']._serialized_start=1631
|
|
69
|
+
_globals['_DOWNLINKMESSAGE']._serialized_end=1901
|
|
70
|
+
_globals['_TXPACKET']._serialized_start=1903
|
|
71
|
+
_globals['_TXPACKET']._serialized_end=1973
|
|
72
|
+
_globals['_GATEWAYACTION']._serialized_start=1975
|
|
73
|
+
_globals['_GATEWAYACTION']._serialized_end=2006
|
|
74
|
+
_globals['_BRIDGEUPGRADE']._serialized_start=2009
|
|
75
|
+
_globals['_BRIDGEUPGRADE']._serialized_end=2174
|
|
76
|
+
_globals['_GATEWAYCONFIG']._serialized_start=2177
|
|
77
|
+
_globals['_GATEWAYCONFIG']._serialized_end=2503
|
|
78
|
+
_globals['_GATEWAYCONFIG_CONFIGENTRY']._serialized_start=1171
|
|
79
|
+
_globals['_GATEWAYCONFIG_CONFIGENTRY']._serialized_end=1243
|
|
80
|
+
_globals['_CUSTOMMESSAGE']._serialized_start=2506
|
|
81
|
+
_globals['_CUSTOMMESSAGE']._serialized_end=2635
|
|
82
|
+
_globals['_CUSTOMMESSAGE_ENTRIESENTRY']._serialized_start=1390
|
|
83
|
+
_globals['_CUSTOMMESSAGE_ENTRIESENTRY']._serialized_end=1450
|
|
72
84
|
# @@protoc_insertion_point(module_scope)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
from google.protobuf.internal import containers as _containers
|
|
2
2
|
from google.protobuf import descriptor as _descriptor
|
|
3
3
|
from google.protobuf import message as _message
|
|
4
|
-
from
|
|
4
|
+
from collections.abc import Iterable as _Iterable, Mapping as _Mapping
|
|
5
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
|
|
5
6
|
|
|
6
7
|
DESCRIPTOR: _descriptor.FileDescriptor
|
|
7
8
|
|
|
@@ -62,6 +63,28 @@ class UplinkMessage(_message.Message):
|
|
|
62
63
|
actionStatus: ActionStatus
|
|
63
64
|
def __init__(self, gatewayStatus: _Optional[_Union[GatewayStatus, _Mapping]] = ..., gatewayInfo: _Optional[_Union[GatewayInfo, _Mapping]] = ..., gatewayLogs: _Optional[_Union[GatewayLogs, _Mapping]] = ..., actionStatus: _Optional[_Union[ActionStatus, _Mapping]] = ...) -> None: ...
|
|
64
65
|
|
|
66
|
+
class ACL(_message.Message):
|
|
67
|
+
__slots__ = ("mode_allow", "ids")
|
|
68
|
+
MODE_ALLOW_FIELD_NUMBER: _ClassVar[int]
|
|
69
|
+
IDS_FIELD_NUMBER: _ClassVar[int]
|
|
70
|
+
mode_allow: bool
|
|
71
|
+
ids: _containers.RepeatedScalarFieldContainer[bytes]
|
|
72
|
+
def __init__(self, mode_allow: bool = ..., ids: _Optional[_Iterable[bytes]] = ...) -> None: ...
|
|
73
|
+
|
|
74
|
+
class GatewayConfigValue(_message.Message):
|
|
75
|
+
__slots__ = ("integerValue", "numberValue", "stringValue", "boolValue", "aclValue")
|
|
76
|
+
INTEGERVALUE_FIELD_NUMBER: _ClassVar[int]
|
|
77
|
+
NUMBERVALUE_FIELD_NUMBER: _ClassVar[int]
|
|
78
|
+
STRINGVALUE_FIELD_NUMBER: _ClassVar[int]
|
|
79
|
+
BOOLVALUE_FIELD_NUMBER: _ClassVar[int]
|
|
80
|
+
ACLVALUE_FIELD_NUMBER: _ClassVar[int]
|
|
81
|
+
integerValue: int
|
|
82
|
+
numberValue: float
|
|
83
|
+
stringValue: str
|
|
84
|
+
boolValue: bool
|
|
85
|
+
aclValue: ACL
|
|
86
|
+
def __init__(self, integerValue: _Optional[int] = ..., numberValue: _Optional[float] = ..., stringValue: _Optional[str] = ..., boolValue: bool = ..., aclValue: _Optional[_Union[ACL, _Mapping]] = ...) -> None: ...
|
|
87
|
+
|
|
65
88
|
class GatewayStatus(_message.Message):
|
|
66
89
|
__slots__ = ("gatewayId", "gatewayType", "downlinkSupported", "bridgeOtaUpgradeSupported", "apiVersion", "version", "bleSwVersion", "interfaceSwVersion", "location", "config", "bleAddress")
|
|
67
90
|
class ConfigEntry(_message.Message):
|
|
@@ -69,8 +92,8 @@ class GatewayStatus(_message.Message):
|
|
|
69
92
|
KEY_FIELD_NUMBER: _ClassVar[int]
|
|
70
93
|
VALUE_FIELD_NUMBER: _ClassVar[int]
|
|
71
94
|
key: str
|
|
72
|
-
value:
|
|
73
|
-
def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[
|
|
95
|
+
value: GatewayConfigValue
|
|
96
|
+
def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[GatewayConfigValue, _Mapping]] = ...) -> None: ...
|
|
74
97
|
GATEWAYID_FIELD_NUMBER: _ClassVar[int]
|
|
75
98
|
GATEWAYTYPE_FIELD_NUMBER: _ClassVar[int]
|
|
76
99
|
DOWNLINKSUPPORTED_FIELD_NUMBER: _ClassVar[int]
|
|
@@ -91,9 +114,9 @@ class GatewayStatus(_message.Message):
|
|
|
91
114
|
bleSwVersion: str
|
|
92
115
|
interfaceSwVersion: str
|
|
93
116
|
location: Location
|
|
94
|
-
config: _containers.MessageMap[str,
|
|
117
|
+
config: _containers.MessageMap[str, GatewayConfigValue]
|
|
95
118
|
bleAddress: str
|
|
96
|
-
def __init__(self, gatewayId: _Optional[str] = ..., gatewayType: _Optional[str] = ..., downlinkSupported: bool = ..., bridgeOtaUpgradeSupported: bool = ..., apiVersion: _Optional[int] = ..., version: _Optional[str] = ..., bleSwVersion: _Optional[str] = ..., interfaceSwVersion: _Optional[str] = ..., location: _Optional[_Union[Location, _Mapping]] = ..., config: _Optional[_Mapping[str,
|
|
119
|
+
def __init__(self, gatewayId: _Optional[str] = ..., gatewayType: _Optional[str] = ..., downlinkSupported: bool = ..., bridgeOtaUpgradeSupported: bool = ..., apiVersion: _Optional[int] = ..., version: _Optional[str] = ..., bleSwVersion: _Optional[str] = ..., interfaceSwVersion: _Optional[str] = ..., location: _Optional[_Union[Location, _Mapping]] = ..., config: _Optional[_Mapping[str, GatewayConfigValue]] = ..., bleAddress: _Optional[str] = ...) -> None: ...
|
|
97
120
|
|
|
98
121
|
class GatewayInfo(_message.Message):
|
|
99
122
|
__slots__ = ("entries",)
|
|
@@ -115,28 +138,32 @@ class GatewayLogs(_message.Message):
|
|
|
115
138
|
def __init__(self, logs: _Optional[_Iterable[str]] = ...) -> None: ...
|
|
116
139
|
|
|
117
140
|
class ActionStatus(_message.Message):
|
|
118
|
-
__slots__ = ("action", "status")
|
|
141
|
+
__slots__ = ("action", "status", "step", "progress", "bridgeId")
|
|
119
142
|
ACTION_FIELD_NUMBER: _ClassVar[int]
|
|
120
143
|
STATUS_FIELD_NUMBER: _ClassVar[int]
|
|
144
|
+
STEP_FIELD_NUMBER: _ClassVar[int]
|
|
145
|
+
PROGRESS_FIELD_NUMBER: _ClassVar[int]
|
|
146
|
+
BRIDGEID_FIELD_NUMBER: _ClassVar[int]
|
|
121
147
|
action: int
|
|
122
148
|
status: int
|
|
123
|
-
|
|
149
|
+
step: int
|
|
150
|
+
progress: int
|
|
151
|
+
bridgeId: bytes
|
|
152
|
+
def __init__(self, action: _Optional[int] = ..., status: _Optional[int] = ..., step: _Optional[int] = ..., progress: _Optional[int] = ..., bridgeId: _Optional[bytes] = ...) -> None: ...
|
|
124
153
|
|
|
125
154
|
class DownlinkMessage(_message.Message):
|
|
126
|
-
__slots__ = ("txPacket", "gatewayAction", "bridgeUpgrade", "gatewayConfig", "
|
|
155
|
+
__slots__ = ("txPacket", "gatewayAction", "bridgeUpgrade", "gatewayConfig", "customMessage")
|
|
127
156
|
TXPACKET_FIELD_NUMBER: _ClassVar[int]
|
|
128
157
|
GATEWAYACTION_FIELD_NUMBER: _ClassVar[int]
|
|
129
158
|
BRIDGEUPGRADE_FIELD_NUMBER: _ClassVar[int]
|
|
130
159
|
GATEWAYCONFIG_FIELD_NUMBER: _ClassVar[int]
|
|
131
|
-
CUSTOMBROKER_FIELD_NUMBER: _ClassVar[int]
|
|
132
160
|
CUSTOMMESSAGE_FIELD_NUMBER: _ClassVar[int]
|
|
133
161
|
txPacket: TxPacket
|
|
134
162
|
gatewayAction: GatewayAction
|
|
135
163
|
bridgeUpgrade: BridgeUpgrade
|
|
136
164
|
gatewayConfig: GatewayConfig
|
|
137
|
-
customBroker: CustomBroker
|
|
138
165
|
customMessage: CustomMessage
|
|
139
|
-
def __init__(self, txPacket: _Optional[_Union[TxPacket, _Mapping]] = ..., gatewayAction: _Optional[_Union[GatewayAction, _Mapping]] = ..., bridgeUpgrade: _Optional[_Union[BridgeUpgrade, _Mapping]] = ..., gatewayConfig: _Optional[_Union[GatewayConfig, _Mapping]] = ...,
|
|
166
|
+
def __init__(self, txPacket: _Optional[_Union[TxPacket, _Mapping]] = ..., gatewayAction: _Optional[_Union[GatewayAction, _Mapping]] = ..., bridgeUpgrade: _Optional[_Union[BridgeUpgrade, _Mapping]] = ..., gatewayConfig: _Optional[_Union[GatewayConfig, _Mapping]] = ..., customMessage: _Optional[_Union[CustomMessage, _Mapping]] = ...) -> None: ...
|
|
140
167
|
|
|
141
168
|
class TxPacket(_message.Message):
|
|
142
169
|
__slots__ = ("payload", "maxRetries", "maxDurationMs")
|
|
@@ -179,8 +206,8 @@ class GatewayConfig(_message.Message):
|
|
|
179
206
|
KEY_FIELD_NUMBER: _ClassVar[int]
|
|
180
207
|
VALUE_FIELD_NUMBER: _ClassVar[int]
|
|
181
208
|
key: str
|
|
182
|
-
value:
|
|
183
|
-
def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[
|
|
209
|
+
value: GatewayConfigValue
|
|
210
|
+
def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[GatewayConfigValue, _Mapping]] = ...) -> None: ...
|
|
184
211
|
VERSION_FIELD_NUMBER: _ClassVar[int]
|
|
185
212
|
BLESWVERSION_FIELD_NUMBER: _ClassVar[int]
|
|
186
213
|
INTERFACESWVERSION_FIELD_NUMBER: _ClassVar[int]
|
|
@@ -190,28 +217,8 @@ class GatewayConfig(_message.Message):
|
|
|
190
217
|
bleSwVersion: str
|
|
191
218
|
interfaceSwVersion: str
|
|
192
219
|
location: Location
|
|
193
|
-
config: _containers.MessageMap[str,
|
|
194
|
-
def __init__(self, version: _Optional[str] = ..., bleSwVersion: _Optional[str] = ..., interfaceSwVersion: _Optional[str] = ..., location: _Optional[_Union[Location, _Mapping]] = ..., config: _Optional[_Mapping[str,
|
|
195
|
-
|
|
196
|
-
class CustomBroker(_message.Message):
|
|
197
|
-
__slots__ = ("customBroker", "port", "brokerUrl", "username", "password", "updateTopic", "statusTopic", "dataTopic")
|
|
198
|
-
CUSTOMBROKER_FIELD_NUMBER: _ClassVar[int]
|
|
199
|
-
PORT_FIELD_NUMBER: _ClassVar[int]
|
|
200
|
-
BROKERURL_FIELD_NUMBER: _ClassVar[int]
|
|
201
|
-
USERNAME_FIELD_NUMBER: _ClassVar[int]
|
|
202
|
-
PASSWORD_FIELD_NUMBER: _ClassVar[int]
|
|
203
|
-
UPDATETOPIC_FIELD_NUMBER: _ClassVar[int]
|
|
204
|
-
STATUSTOPIC_FIELD_NUMBER: _ClassVar[int]
|
|
205
|
-
DATATOPIC_FIELD_NUMBER: _ClassVar[int]
|
|
206
|
-
customBroker: bool
|
|
207
|
-
port: int
|
|
208
|
-
brokerUrl: str
|
|
209
|
-
username: str
|
|
210
|
-
password: str
|
|
211
|
-
updateTopic: str
|
|
212
|
-
statusTopic: str
|
|
213
|
-
dataTopic: str
|
|
214
|
-
def __init__(self, customBroker: bool = ..., port: _Optional[int] = ..., brokerUrl: _Optional[str] = ..., username: _Optional[str] = ..., password: _Optional[str] = ..., updateTopic: _Optional[str] = ..., statusTopic: _Optional[str] = ..., dataTopic: _Optional[str] = ...) -> None: ...
|
|
220
|
+
config: _containers.MessageMap[str, GatewayConfigValue]
|
|
221
|
+
def __init__(self, version: _Optional[str] = ..., bleSwVersion: _Optional[str] = ..., interfaceSwVersion: _Optional[str] = ..., location: _Optional[_Union[Location, _Mapping]] = ..., config: _Optional[_Mapping[str, GatewayConfigValue]] = ...) -> None: ...
|
|
215
222
|
|
|
216
223
|
class CustomMessage(_message.Message):
|
|
217
224
|
__slots__ = ("entries",)
|
gw_certificate/gw_certificate.py
CHANGED
|
@@ -18,8 +18,9 @@ from gw_certificate.interface.ble_simulator import BLESimulator
|
|
|
18
18
|
from gw_certificate.interface.mqtt import MqttClient
|
|
19
19
|
from gw_certificate.tests import *
|
|
20
20
|
from gw_certificate.interface.uart_ports import get_uart_ports
|
|
21
|
-
from gw_certificate.api_if.gw_capabilities import GWCapabilities
|
|
21
|
+
from gw_certificate.api_if.gw_capabilities import GWCapabilities, ConfigurationData
|
|
22
22
|
from gw_certificate.tests import TESTS_NO_UART
|
|
23
|
+
|
|
23
24
|
import gw_certificate.cert_results as cert_results
|
|
24
25
|
|
|
25
26
|
GW_CERT_VERSION = importlib.metadata.version("wiliot-certificate")
|
|
@@ -58,6 +59,7 @@ class GWCertificate:
|
|
|
58
59
|
self.result_pdf_path = os.path.join(self.certificate_dir, f'results_{self.current_datetime.strftime('%Y%m%d_%H%M%S')}.pdf')
|
|
59
60
|
self.template_engine = TemplateEngine()
|
|
60
61
|
self.env = env
|
|
62
|
+
self.error = ""
|
|
61
63
|
|
|
62
64
|
# Version
|
|
63
65
|
self.gw_cert_version = GW_CERT_VERSION
|
|
@@ -71,7 +73,7 @@ class GWCertificate:
|
|
|
71
73
|
self.stress_pps = stress_pps
|
|
72
74
|
self.aggregation_time = aggregation_time
|
|
73
75
|
self.actions = actions
|
|
74
|
-
self.
|
|
76
|
+
self.cfg_data = ConfigurationData()
|
|
75
77
|
|
|
76
78
|
# UART-related. Require only when running tests that need it
|
|
77
79
|
self.use_uart = not all(test in TESTS_NO_UART for test in tests)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import time
|
|
3
|
-
from argparse import ArgumentParser
|
|
3
|
+
from argparse import ArgumentParser, SUPPRESS
|
|
4
4
|
|
|
5
5
|
from gw_certificate.common.debug import debug_print
|
|
6
6
|
from gw_certificate.gw_certificate import GWCertificate, GW_CERT_VERSION
|
|
@@ -27,7 +27,7 @@ def filter_actions(actions_names):
|
|
|
27
27
|
def main():
|
|
28
28
|
usage = (
|
|
29
29
|
"usage: wlt-gw-certificate [-h] -owner OWNER -gw GW\n"
|
|
30
|
-
f" [-tests {{connection, uplink, downlink, actions, stress}}] [-
|
|
30
|
+
f" [-tests {{connection, uplink, downlink, actions, stress}}] [-noupdate] [-pps {STRESS_DEFAULT_PPS}]\n"
|
|
31
31
|
f" [-actions {{info, reboot, bridgeota}}] [-agg AGG] [-env {{prod, test, dev}}]"
|
|
32
32
|
)
|
|
33
33
|
|
|
@@ -44,13 +44,14 @@ def main():
|
|
|
44
44
|
default=['connection', 'uplink', 'downlink', 'actions', 'stress'])
|
|
45
45
|
optional.add_argument('-actions', type=str, choices=['info', 'reboot', 'bridgeota'],
|
|
46
46
|
help="Action stages to run under ActionsTest", required=False, nargs='+', default=['info', 'reboot', 'bridgeota'])
|
|
47
|
-
optional.add_argument('-update', action='store_true', help='Update test board firmware', default=False, required=False)
|
|
48
47
|
optional.add_argument('-pps', type=int, help='Single packets-per-second rate to simulate in the stress test',
|
|
49
48
|
choices=STRESS_DEFAULT_PPS, default=None, required=False)
|
|
50
49
|
optional.add_argument('-agg', type=int, help='Aggregation time [seconds] the Uplink stages wait before processing results',
|
|
51
50
|
default=0, required=False)
|
|
52
51
|
optional.add_argument('-env', type=str, help='Environment for the RegistrationTest & BridgeOTAStage',
|
|
53
52
|
choices=['prod', 'test', 'dev'], default='prod', required=False)
|
|
53
|
+
optional.add_argument('-update', action='store_true', help=SUPPRESS, default=True, required=False)
|
|
54
|
+
optional.add_argument('-noupdate', action='store_true', help='Skip the default certification kit firmware update', default=False, required=False)
|
|
54
55
|
args = parser.parse_args()
|
|
55
56
|
|
|
56
57
|
topic_suffix = '' if args.suffix == '' else '-'+args.suffix
|
|
@@ -72,7 +73,7 @@ def main():
|
|
|
72
73
|
parser.error("When running any test other than registration, the gateway must be registered to an owner which should be provided using the '-owner' flag.")
|
|
73
74
|
|
|
74
75
|
|
|
75
|
-
gwc = GWCertificate(gw_id=args.gw, owner_id=args.owner, topic_suffix=topic_suffix, tests=tests, update_fw=args.
|
|
76
|
+
gwc = GWCertificate(gw_id=args.gw, owner_id=args.owner, topic_suffix=topic_suffix, tests=tests, update_fw=(not args.noupdate),
|
|
76
77
|
stress_pps=args.pps, aggregation_time=args.agg, env=args.env, actions=actions)
|
|
77
78
|
debug_print(f"All arguments: {vars(args)}")
|
|
78
79
|
gwc.run_tests()
|
|
Binary file
|
|
Binary file
|
|
@@ -20,19 +20,21 @@ class BLESimulator():
|
|
|
20
20
|
self.uart.reset_gw()
|
|
21
21
|
time.sleep(3)
|
|
22
22
|
|
|
23
|
-
def send_packet(self, raw_packet, duplicates=DEFAULT_DUPLICATES, output_power=DEFAULT_OUTPUT_POWER, channel=SEND_ALL_ADV_CHANNELS,
|
|
23
|
+
def send_packet(self, raw_packet, duplicates=DEFAULT_DUPLICATES, output_power=DEFAULT_OUTPUT_POWER, channel=SEND_ALL_ADV_CHANNELS,
|
|
24
|
+
delay=DEFAULT_DELAY, print_for_debug=True):
|
|
24
25
|
assert self.sim_mode is True, 'BLE Sim not initialized!'
|
|
25
26
|
if len(raw_packet) == 62:
|
|
26
27
|
# Add ADVA
|
|
27
28
|
raw_packet = DEFAULT_ADVA + raw_packet
|
|
28
29
|
if len(raw_packet) != 74:
|
|
29
30
|
raise ValueError('Raw Packet must be 62/74 chars long!')
|
|
30
|
-
self.uart.write_ble_command(f"!ble_sim {str(raw_packet)} {str(duplicates)} {str(output_power)} {str(channel)} {str(delay)}")
|
|
31
|
+
self.uart.write_ble_command(f"!ble_sim {str(raw_packet)} {str(duplicates)} {str(output_power)} {str(channel)} {str(delay)}", print_for_debug=print_for_debug)
|
|
31
32
|
if delay > 0:
|
|
32
33
|
diff = time.perf_counter()
|
|
33
34
|
time.sleep((delay/1000) * duplicates)
|
|
34
35
|
diff = time.perf_counter() - diff
|
|
35
|
-
|
|
36
|
+
if print_for_debug:
|
|
37
|
+
debug_print(f'Desired Delay: {(delay/1000) * duplicates} Actual Delay {diff}')
|
|
36
38
|
|
|
37
39
|
|
|
38
40
|
def send_data_si_pair(self, data_packet, si_packet, duplicates, output_power=DEFAULT_OUTPUT_POWER, delay=DEFAULT_DELAY, packet_error=None):
|
gw_certificate/interface/mqtt.py
CHANGED
|
@@ -346,7 +346,7 @@ class MqttClient:
|
|
|
346
346
|
return message.body_ex
|
|
347
347
|
return None
|
|
348
348
|
|
|
349
|
-
def
|
|
349
|
+
def get_gw_configuration_reboot(self):
|
|
350
350
|
self.flush_messages()
|
|
351
351
|
self.send_action(GwAction.REBOOT_GW)
|
|
352
352
|
debug_print('---GW CONFIG---')
|
|
@@ -360,20 +360,29 @@ class MqttClient:
|
|
|
360
360
|
if mqtt_mode == 'legacy':
|
|
361
361
|
return self.send_action(GwAction.DISABLE_DEV_MODE)
|
|
362
362
|
elif mqtt_mode == 'automatic':
|
|
363
|
-
custom_mqtt = {
|
|
364
|
-
"customBroker": False,
|
|
365
|
-
"brokerUrl": "",
|
|
366
|
-
"port": 8883,
|
|
367
|
-
"username": "",
|
|
368
|
-
"password": "",
|
|
369
|
-
"updateTopic": f"update/{self.owner_id}/{self.gw_id}",
|
|
370
|
-
"statusTopic": f"status/{self.owner_id}/{self.gw_id}",
|
|
371
|
-
"dataTopic": f"data/{self.owner_id}/{self.gw_id}"
|
|
372
|
-
}
|
|
373
363
|
if self.get_serialization() in {Serialization.UNKNOWN, Serialization.JSON}:
|
|
364
|
+
custom_mqtt = {
|
|
365
|
+
"customBroker": False,
|
|
366
|
+
"brokerUrl": "",
|
|
367
|
+
"port": 8883,
|
|
368
|
+
"username": "",
|
|
369
|
+
"password": "",
|
|
370
|
+
"updateTopic": f"update/{self.owner_id}/{self.gw_id}",
|
|
371
|
+
"statusTopic": f"status/{self.owner_id}/{self.gw_id}",
|
|
372
|
+
"dataTopic": f"data/{self.owner_id}/{self.gw_id}"
|
|
373
|
+
}
|
|
374
374
|
self.send_payload(custom_mqtt)
|
|
375
375
|
if self.get_serialization() in {Serialization.UNKNOWN, Serialization.PB}:
|
|
376
|
-
|
|
376
|
+
custom_mqtt = wltPb_pb2.DownlinkMessage()
|
|
377
|
+
custom_mqtt.customMessage.entries['customBroker'].CopyFrom(wltPb_pb2.Value(boolValue=False))
|
|
378
|
+
custom_mqtt.customMessage.entries['brokerUrl'].CopyFrom(wltPb_pb2.Value(stringValue=""))
|
|
379
|
+
custom_mqtt.customMessage.entries['port'].CopyFrom(wltPb_pb2.Value(integerValue=8883))
|
|
380
|
+
custom_mqtt.customMessage.entries['username'].CopyFrom(wltPb_pb2.Value(stringValue=""))
|
|
381
|
+
custom_mqtt.customMessage.entries['password'].CopyFrom(wltPb_pb2.Value(stringValue=""))
|
|
382
|
+
custom_mqtt.customMessage.entries['updateTopic'].CopyFrom(wltPb_pb2.Value(stringValue=f"update/{self.owner_id}/{self.gw_id}"))
|
|
383
|
+
custom_mqtt.customMessage.entries['statusTopic'].CopyFrom(wltPb_pb2.Value(stringValue=f"status/{self.owner_id}/{self.gw_id}"))
|
|
384
|
+
custom_mqtt.customMessage.entries['dataTopic'].CopyFrom(wltPb_pb2.Value(stringValue=f"data/{self.owner_id}/{self.gw_id}"))
|
|
385
|
+
self.send_payload(custom_mqtt)
|
|
377
386
|
elif mqtt_mode == 'manual':
|
|
378
387
|
debug_print(f"Make sure GW {self.gw_id} is set to Wiliot MQTT broker")
|
|
379
388
|
return True
|
|
@@ -383,6 +392,15 @@ class MqttClient:
|
|
|
383
392
|
self.userdata = {'messages': WltMqttMessages(), 'gw_seen': False , 'logger': self.logger, 'serialization':self.get_serialization(), 'published':[]}
|
|
384
393
|
self.client.user_data_set(self.userdata)
|
|
385
394
|
|
|
395
|
+
def flush_messages_topic(self, topic:Literal['status', 'data', 'update']):
|
|
396
|
+
if topic == 'data':
|
|
397
|
+
self.userdata['messages'].data = []
|
|
398
|
+
elif topic == 'status':
|
|
399
|
+
self.userdata['messages'].status = []
|
|
400
|
+
elif topic == 'update':
|
|
401
|
+
self.userdata['messages'].update = []
|
|
402
|
+
|
|
403
|
+
|
|
386
404
|
def get_all_messages_from_topic(self, topic:Literal['status', 'data', 'update']):
|
|
387
405
|
return getattr(self.userdata['messages'], topic)
|
|
388
406
|
|
|
@@ -406,19 +424,21 @@ class MqttClient:
|
|
|
406
424
|
elif GATEWAYSTATUS in message.body_ex.keys():
|
|
407
425
|
return message.body_ex[GATEWAYSTATUS]
|
|
408
426
|
return None
|
|
409
|
-
|
|
427
|
+
|
|
410
428
|
def get_action_status_message(self):
|
|
429
|
+
# Implemented with a list since we can't expect when the GW will publish a msg. To avoid flushing it.
|
|
411
430
|
messages = self.get_all_messages_from_topic('status')
|
|
431
|
+
action_status_msgs = []
|
|
412
432
|
for message in messages:
|
|
413
433
|
if GW_LOGS not in message.body_ex.keys():
|
|
414
434
|
if STATUS_CODE_STR in message.body_ex.keys():
|
|
415
|
-
|
|
435
|
+
action_status_msgs.append(message.body_ex)
|
|
416
436
|
elif ACTIONSTATUS in message.body_ex.keys():
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
return
|
|
437
|
+
message.body_ex[ACTIONSTATUS].setdefault('status', 0)
|
|
438
|
+
action_status_msgs.append(message.body_ex[ACTIONSTATUS])
|
|
439
|
+
if len(action_status_msgs) == 0:
|
|
440
|
+
return None
|
|
441
|
+
return action_status_msgs[-1]
|
|
422
442
|
|
|
423
443
|
def get_coupled_tags_pkts(self):
|
|
424
444
|
return [p for p in self.get_all_pkts_from_topic('data') if NFPKT in p]
|
|
@@ -517,9 +537,6 @@ def on_message_protobuf(mqttc, userdata, message):
|
|
|
517
537
|
try:
|
|
518
538
|
pb_message = wltPb_pb2.GatewayData()
|
|
519
539
|
pb_message.ParseFromString(message.payload)
|
|
520
|
-
# # Decode packets payloads as hex
|
|
521
|
-
# for idx, packet in enumerate(pb_message.packets):
|
|
522
|
-
# pb_message.packets[idx].payload = packet.payload.hex().upper().encode('utf-8')
|
|
523
540
|
except DecodeError as e:
|
|
524
541
|
userdata['logger'].debug(f'{message.topic}: An exception occured:\n{e}\n(could be a JSON msg or pb msg that is not UplinkMessage)###########')
|
|
525
542
|
userdata['logger'].debug(f'Raw Payload: {message.payload}')
|
|
@@ -528,7 +545,6 @@ def on_message_protobuf(mqttc, userdata, message):
|
|
|
528
545
|
userdata['logger'].debug(f'{message.topic}: {message.payload}')
|
|
529
546
|
if pb_message is not None:
|
|
530
547
|
pb_message_dict = MessageToDict(pb_message)
|
|
531
|
-
# Decode b64 packet payloads to hex
|
|
532
548
|
if 'data' in message.topic and 'packets' in pb_message_dict.keys():
|
|
533
549
|
for idx, packet in enumerate(pb_message_dict['packets']):
|
|
534
550
|
pb_message_dict['packets'][idx]['payload'] = base64.b64decode(packet['payload']).hex().upper()
|
|
@@ -185,15 +185,6 @@ class TagPktGenerator:
|
|
|
185
185
|
assert len(pkt) == 62, "packet must be 74 / 62 hex chars long!"
|
|
186
186
|
self.data_packet.set(pkt)
|
|
187
187
|
|
|
188
|
-
def get_expected_mqtt(self):
|
|
189
|
-
timestamp = int(datetime.datetime.now().timestamp() * 1000)
|
|
190
|
-
expected = {
|
|
191
|
-
TIMESTAMP: timestamp,
|
|
192
|
-
PAYLOAD: self.get_packet()[ADVA_LENGTH+GAP_LENGTH:]
|
|
193
|
-
}
|
|
194
|
-
return expected
|
|
195
|
-
|
|
196
|
-
|
|
197
188
|
|
|
198
189
|
class BrgPktGenerator:
|
|
199
190
|
"""Bridge Packet Generator - represents 1 wiliot Bridge"""
|
|
@@ -451,41 +442,6 @@ class BrgPktGenerator:
|
|
|
451
442
|
}
|
|
452
443
|
return [expected_data, expected_si]
|
|
453
444
|
|
|
454
|
-
def get_expected_mqtt_unified(self, full_data_pkt, tag_idx:int=None):
|
|
455
|
-
if tag_idx is None:
|
|
456
|
-
tag_idx = 0
|
|
457
|
-
assert tag_idx <= len(self.tag_list), f'Tag index must be in {[i for i in range(len(self.tag_list))]}'
|
|
458
|
-
|
|
459
|
-
def extract_param_from_pkt():
|
|
460
|
-
# Take only the relevant digis from the data packet
|
|
461
|
-
param_hex_string = full_data_pkt[46:-22]
|
|
462
|
-
if len(param_hex_string) != 6:
|
|
463
|
-
raise ValueError("The parameters hex representation must be 6 digits long")
|
|
464
|
-
|
|
465
|
-
# Convert to decimal from binari and assign
|
|
466
|
-
param_binari_string = bin(int(param_hex_string, 16))[2:].zfill(24)
|
|
467
|
-
nfpkt = int(param_binari_string[:8], 2)
|
|
468
|
-
rssi = int(param_binari_string[8:14], 2)
|
|
469
|
-
# Note: rssi here is -40 then the actual value. This portion is to be added on cloud
|
|
470
|
-
brg_latency = int(param_binari_string[14:20], 2)
|
|
471
|
-
brg_global_pacing_group = int(param_binari_string[20:], 2)
|
|
472
|
-
return [nfpkt, rssi, brg_latency, brg_global_pacing_group]
|
|
473
|
-
|
|
474
|
-
"""generates expected MQTT packet"""
|
|
475
|
-
timestamp = int(datetime.datetime.now().timestamp() * 1000)
|
|
476
|
-
pkt_param = extract_param_from_pkt()
|
|
477
|
-
|
|
478
|
-
expected_data = {
|
|
479
|
-
TIMESTAMP: timestamp,
|
|
480
|
-
BRIDGE_ID: self.bridge_id,
|
|
481
|
-
NFPKT: pkt_param[0],
|
|
482
|
-
RSSI: pkt_param[1],
|
|
483
|
-
BRG_LATENCY: pkt_param[2],
|
|
484
|
-
BRG_GLOBAL_PACING_GROUP: pkt_param[3],
|
|
485
|
-
PAYLOAD: full_data_pkt[(ADVA_LENGTH+GAP_LENGTH):]
|
|
486
|
-
}
|
|
487
|
-
return [expected_data]
|
|
488
|
-
|
|
489
445
|
def get_expected_hb_mqtt(self):
|
|
490
446
|
timestamp = int(datetime.datetime.now().timestamp() * 1000)
|
|
491
447
|
expected = {
|