wiliot-certificate 1.3.0a1__py3-none-any.whl → 1.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.
Files changed (184) hide show
  1. brg_certificate/__init__.py +0 -0
  2. brg_certificate/ag/energous_v0_defines.py +925 -0
  3. brg_certificate/ag/energous_v1_defines.py +931 -0
  4. brg_certificate/ag/energous_v2_defines.py +925 -0
  5. brg_certificate/ag/energous_v3_defines.py +925 -0
  6. brg_certificate/ag/energous_v4_defines.py +925 -0
  7. brg_certificate/ag/fanstel_lan_v0_defines.py +925 -0
  8. brg_certificate/ag/fanstel_lte_v0_defines.py +925 -0
  9. brg_certificate/ag/fanstel_wifi_v0_defines.py +925 -0
  10. brg_certificate/ag/minew_lte_v0_defines.py +925 -0
  11. brg_certificate/ag/wlt_cmd_if.html +102 -0
  12. brg_certificate/ag/wlt_types.html +6114 -0
  13. brg_certificate/ag/wlt_types_ag.py +7840 -0
  14. brg_certificate/ag/wlt_types_ag_jsons/brg2brg_ota.json +142 -0
  15. brg_certificate/ag/wlt_types_ag_jsons/brg2gw_hb.json +785 -0
  16. brg_certificate/ag/wlt_types_ag_jsons/brg2gw_hb_sleep.json +139 -0
  17. brg_certificate/ag/wlt_types_ag_jsons/calibration.json +394 -0
  18. brg_certificate/ag/wlt_types_ag_jsons/custom.json +515 -0
  19. brg_certificate/ag/wlt_types_ag_jsons/datapath.json +672 -0
  20. brg_certificate/ag/wlt_types_ag_jsons/energy2400.json +550 -0
  21. brg_certificate/ag/wlt_types_ag_jsons/energySub1g.json +595 -0
  22. brg_certificate/ag/wlt_types_ag_jsons/externalSensor.json +598 -0
  23. brg_certificate/ag/wlt_types_ag_jsons/interface.json +938 -0
  24. brg_certificate/ag/wlt_types_ag_jsons/powerManagement.json +1234 -0
  25. brg_certificate/ag/wlt_types_ag_jsons/side_info_sensor.json +105 -0
  26. brg_certificate/ag/wlt_types_ag_jsons/signal_indicator_data.json +77 -0
  27. brg_certificate/ag/wlt_types_ag_jsons/unified_echo_ext_pkt.json +61 -0
  28. brg_certificate/ag/wlt_types_ag_jsons/unified_echo_pkt.json +110 -0
  29. brg_certificate/brg_certificate.py +191 -0
  30. brg_certificate/brg_certificate_cli.py +47 -0
  31. brg_certificate/cert_common.py +828 -0
  32. brg_certificate/cert_config.py +395 -0
  33. brg_certificate/cert_data_sim.py +188 -0
  34. brg_certificate/cert_defines.py +337 -0
  35. brg_certificate/cert_gw_sim.py +285 -0
  36. brg_certificate/cert_mqtt.py +373 -0
  37. brg_certificate/cert_prints.py +181 -0
  38. brg_certificate/cert_protobuf.py +88 -0
  39. brg_certificate/cert_results.py +300 -0
  40. brg_certificate/cert_utils.py +358 -0
  41. brg_certificate/certificate_sanity_test_list.txt +36 -0
  42. brg_certificate/certificate_test_list.txt +43 -0
  43. brg_certificate/config/eclipse.json +10 -0
  44. brg_certificate/config/hivemq.json +10 -0
  45. brg_certificate/config/mosquitto.json +10 -0
  46. brg_certificate/config/mosquitto.md +95 -0
  47. brg_certificate/config/wiliot-dev.json +10 -0
  48. brg_certificate/restore_brg.py +59 -0
  49. brg_certificate/tests/calibration/interval_test/interval_test.json +13 -0
  50. brg_certificate/tests/calibration/interval_test/interval_test.py +28 -0
  51. brg_certificate/tests/calibration/output_power_test/output_power_test.json +13 -0
  52. brg_certificate/tests/calibration/output_power_test/output_power_test.py +28 -0
  53. brg_certificate/tests/calibration/pattern_test/pattern_test.json +13 -0
  54. brg_certificate/tests/calibration/pattern_test/pattern_test.py +70 -0
  55. brg_certificate/tests/datapath/adaptive_pacer_algo_test/adaptive_pacer_algo_test.json +13 -0
  56. brg_certificate/tests/datapath/adaptive_pacer_algo_test/adaptive_pacer_algo_test.py +76 -0
  57. brg_certificate/tests/datapath/num_of_tags_test/num_of_tags_test.json +13 -0
  58. brg_certificate/tests/datapath/num_of_tags_test/num_of_tags_test.py +83 -0
  59. brg_certificate/tests/datapath/output_power_test/output_power_test.json +13 -0
  60. brg_certificate/tests/datapath/output_power_test/output_power_test.py +27 -0
  61. brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.json +13 -0
  62. brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +43 -0
  63. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.json +13 -0
  64. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.py +63 -0
  65. brg_certificate/tests/datapath/pacer_interval_test/pacer_interval_test.json +13 -0
  66. brg_certificate/tests/datapath/pacer_interval_test/pacer_interval_test.py +50 -0
  67. brg_certificate/tests/datapath/pattern_test/pattern_test.json +13 -0
  68. brg_certificate/tests/datapath/pattern_test/pattern_test.py +28 -0
  69. brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.json +13 -0
  70. brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +51 -0
  71. brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.json +13 -0
  72. brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.py +54 -0
  73. brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.json +13 -0
  74. brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.py +55 -0
  75. brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.json +13 -0
  76. brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.py +73 -0
  77. brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.json +13 -0
  78. brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.py +41 -0
  79. brg_certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.json +21 -0
  80. brg_certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +184 -0
  81. brg_certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.json +21 -0
  82. brg_certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.py +210 -0
  83. brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.json +30 -0
  84. brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.py +203 -0
  85. brg_certificate/tests/datapath/stress_test/stress_test.json +30 -0
  86. brg_certificate/tests/datapath/stress_test/stress_test.py +210 -0
  87. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.json +13 -0
  88. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.py +113 -0
  89. brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.json +13 -0
  90. brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.py +79 -0
  91. brg_certificate/tests/edge_mgmt/actions_test/actions_test.json +13 -0
  92. brg_certificate/tests/edge_mgmt/actions_test/actions_test.py +432 -0
  93. brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.json +13 -0
  94. brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.py +94 -0
  95. brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.json +13 -0
  96. brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.py +87 -0
  97. brg_certificate/tests/edge_mgmt/leds_test/leds_test.json +13 -0
  98. brg_certificate/tests/edge_mgmt/leds_test/leds_test.py +210 -0
  99. brg_certificate/tests/edge_mgmt/ota_test/ota_test.json +13 -0
  100. brg_certificate/tests/edge_mgmt/ota_test/ota_test.py +83 -0
  101. brg_certificate/tests/edge_mgmt/stat_test/stat_test.json +13 -0
  102. brg_certificate/tests/edge_mgmt/stat_test/stat_test.py +48 -0
  103. brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.json +13 -0
  104. brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.py +26 -0
  105. brg_certificate/tests/energy2400/output_power_test/output_power_test.json +13 -0
  106. brg_certificate/tests/energy2400/output_power_test/output_power_test.py +27 -0
  107. brg_certificate/tests/energy2400/pattern_test/pattern_test.json +13 -0
  108. brg_certificate/tests/energy2400/pattern_test/pattern_test.py +28 -0
  109. brg_certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.json +13 -0
  110. brg_certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.py +398 -0
  111. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.json +13 -0
  112. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.py +153 -0
  113. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +13 -0
  114. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +264 -0
  115. brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.json +13 -0
  116. brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.py +27 -0
  117. brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.json +13 -0
  118. brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.py +26 -0
  119. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.json +13 -0
  120. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.py +397 -0
  121. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.json +13 -0
  122. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.py +27 -0
  123. brg_certificate/wltPb_pb2.py +72 -0
  124. brg_certificate/wltPb_pb2.pyi +227 -0
  125. brg_certificate/wlt_types.py +114 -0
  126. gw_certificate/api/extended_api.py +7 -1531
  127. gw_certificate/api_if/200/data.json +106 -0
  128. gw_certificate/api_if/200/logs.json +12 -0
  129. gw_certificate/api_if/200/status.json +47 -0
  130. gw_certificate/api_if/201/data.json +98 -0
  131. gw_certificate/api_if/201/logs.json +12 -0
  132. gw_certificate/api_if/201/status.json +53 -0
  133. gw_certificate/api_if/202/data.json +83 -0
  134. gw_certificate/api_if/202/logs.json +12 -0
  135. gw_certificate/api_if/202/status.json +60 -0
  136. gw_certificate/api_if/203/data.json +85 -0
  137. gw_certificate/api_if/203/logs.json +12 -0
  138. gw_certificate/api_if/203/status.json +63 -0
  139. gw_certificate/api_if/204/data.json +85 -0
  140. gw_certificate/api_if/204/logs.json +12 -0
  141. gw_certificate/api_if/204/status.json +63 -0
  142. gw_certificate/api_if/205/data.json +85 -0
  143. gw_certificate/api_if/205/logs.json +12 -0
  144. gw_certificate/api_if/205/status.json +63 -0
  145. gw_certificate/api_if/api_validation.py +0 -2
  146. gw_certificate/common/analysis_data_bricks.py +18 -1413
  147. gw_certificate/common/debug.py +0 -21
  148. gw_certificate/common/utils.py +1 -212
  149. gw_certificate/common/utils_defines.py +0 -87
  150. gw_certificate/gw_certificate.py +9 -7
  151. gw_certificate/gw_certificate_cli.py +39 -23
  152. gw_certificate/interface/4.4.52_app.zip +0 -0
  153. gw_certificate/interface/4.4.52_sd_bl_app.zip +0 -0
  154. gw_certificate/interface/ble_simulator.py +0 -32
  155. gw_certificate/interface/if_defines.py +1 -0
  156. gw_certificate/interface/mqtt.py +96 -19
  157. gw_certificate/interface/nrfutil-linux +0 -0
  158. gw_certificate/interface/nrfutil-mac +0 -0
  159. gw_certificate/interface/nrfutil.exe +0 -0
  160. gw_certificate/interface/pkt_generator.py +0 -82
  161. gw_certificate/interface/uart_if.py +73 -43
  162. gw_certificate/templates/results.html +1 -1
  163. gw_certificate/tests/__init__.py +1 -2
  164. gw_certificate/tests/actions.py +134 -9
  165. gw_certificate/tests/connection.py +10 -5
  166. gw_certificate/tests/downlink.py +2 -4
  167. gw_certificate/tests/generic.py +62 -12
  168. gw_certificate/tests/registration.py +78 -27
  169. gw_certificate/tests/static/generated_packet_table.py +12 -48
  170. gw_certificate/tests/static/packet_table.csv +10048 -10048
  171. gw_certificate/tests/static/references.py +2 -1
  172. gw_certificate/tests/static/uplink_defines.py +0 -7
  173. gw_certificate/tests/throughput.py +7 -12
  174. gw_certificate/tests/uplink.py +83 -43
  175. {wiliot_certificate-1.3.0a1.dist-info → wiliot_certificate-1.4.0a1.dist-info}/METADATA +59 -8
  176. wiliot_certificate-1.4.0a1.dist-info/RECORD +198 -0
  177. {wiliot_certificate-1.3.0a1.dist-info → wiliot_certificate-1.4.0a1.dist-info}/WHEEL +1 -1
  178. wiliot_certificate-1.4.0a1.dist-info/entry_points.txt +3 -0
  179. wiliot_certificate-1.4.0a1.dist-info/top_level.txt +2 -0
  180. gw_certificate/interface/packet_error.py +0 -22
  181. wiliot_certificate-1.3.0a1.dist-info/RECORD +0 -51
  182. wiliot_certificate-1.3.0a1.dist-info/entry_points.txt +0 -2
  183. wiliot_certificate-1.3.0a1.dist-info/top_level.txt +0 -1
  184. {wiliot_certificate-1.3.0a1.dist-info → wiliot_certificate-1.4.0a1.dist-info}/LICENSE +0 -0
@@ -0,0 +1,227 @@
1
+ from google.protobuf.internal import containers as _containers
2
+ from google.protobuf import descriptor as _descriptor
3
+ from google.protobuf import message as _message
4
+ from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
5
+
6
+ DESCRIPTOR: _descriptor.FileDescriptor
7
+
8
+ class Location(_message.Message):
9
+ __slots__ = ("lat", "lng")
10
+ LAT_FIELD_NUMBER: _ClassVar[int]
11
+ LNG_FIELD_NUMBER: _ClassVar[int]
12
+ lat: float
13
+ lng: float
14
+ def __init__(self, lat: _Optional[float] = ..., lng: _Optional[float] = ...) -> None: ...
15
+
16
+ class Value(_message.Message):
17
+ __slots__ = ("integerValue", "numberValue", "stringValue", "boolValue")
18
+ INTEGERVALUE_FIELD_NUMBER: _ClassVar[int]
19
+ NUMBERVALUE_FIELD_NUMBER: _ClassVar[int]
20
+ STRINGVALUE_FIELD_NUMBER: _ClassVar[int]
21
+ BOOLVALUE_FIELD_NUMBER: _ClassVar[int]
22
+ integerValue: int
23
+ numberValue: float
24
+ stringValue: str
25
+ boolValue: bool
26
+ def __init__(self, integerValue: _Optional[int] = ..., numberValue: _Optional[float] = ..., stringValue: _Optional[str] = ..., boolValue: bool = ...) -> None: ...
27
+
28
+ class GatewayData(_message.Message):
29
+ __slots__ = ("gatewayId", "timestamp", "packets", "location")
30
+ class Packet(_message.Message):
31
+ __slots__ = ("payload", "timestamp", "sequenceId", "rssi", "aliasBridgeId")
32
+ PAYLOAD_FIELD_NUMBER: _ClassVar[int]
33
+ TIMESTAMP_FIELD_NUMBER: _ClassVar[int]
34
+ SEQUENCEID_FIELD_NUMBER: _ClassVar[int]
35
+ RSSI_FIELD_NUMBER: _ClassVar[int]
36
+ ALIASBRIDGEID_FIELD_NUMBER: _ClassVar[int]
37
+ payload: bytes
38
+ timestamp: int
39
+ sequenceId: int
40
+ rssi: int
41
+ aliasBridgeId: str
42
+ def __init__(self, payload: _Optional[bytes] = ..., timestamp: _Optional[int] = ..., sequenceId: _Optional[int] = ..., rssi: _Optional[int] = ..., aliasBridgeId: _Optional[str] = ...) -> None: ...
43
+ GATEWAYID_FIELD_NUMBER: _ClassVar[int]
44
+ TIMESTAMP_FIELD_NUMBER: _ClassVar[int]
45
+ PACKETS_FIELD_NUMBER: _ClassVar[int]
46
+ LOCATION_FIELD_NUMBER: _ClassVar[int]
47
+ gatewayId: str
48
+ timestamp: int
49
+ packets: _containers.RepeatedCompositeFieldContainer[GatewayData.Packet]
50
+ location: Location
51
+ def __init__(self, gatewayId: _Optional[str] = ..., timestamp: _Optional[int] = ..., packets: _Optional[_Iterable[_Union[GatewayData.Packet, _Mapping]]] = ..., location: _Optional[_Union[Location, _Mapping]] = ...) -> None: ...
52
+
53
+ class UplinkMessage(_message.Message):
54
+ __slots__ = ("gatewayStatus", "gatewayInfo", "gatewayLogs", "actionStatus")
55
+ GATEWAYSTATUS_FIELD_NUMBER: _ClassVar[int]
56
+ GATEWAYINFO_FIELD_NUMBER: _ClassVar[int]
57
+ GATEWAYLOGS_FIELD_NUMBER: _ClassVar[int]
58
+ ACTIONSTATUS_FIELD_NUMBER: _ClassVar[int]
59
+ gatewayStatus: GatewayStatus
60
+ gatewayInfo: GatewayInfo
61
+ gatewayLogs: GatewayLogs
62
+ actionStatus: ActionStatus
63
+ 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
+ class GatewayStatus(_message.Message):
66
+ __slots__ = ("gatewayId", "gatewayType", "downlinkSupported", "bridgeOtaUpgradeSupported", "apiVersion", "version", "bleSwVersion", "interfaceSwVersion", "location", "config", "bleAddress")
67
+ class ConfigEntry(_message.Message):
68
+ __slots__ = ("key", "value")
69
+ KEY_FIELD_NUMBER: _ClassVar[int]
70
+ VALUE_FIELD_NUMBER: _ClassVar[int]
71
+ key: str
72
+ value: Value
73
+ def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[Value, _Mapping]] = ...) -> None: ...
74
+ GATEWAYID_FIELD_NUMBER: _ClassVar[int]
75
+ GATEWAYTYPE_FIELD_NUMBER: _ClassVar[int]
76
+ DOWNLINKSUPPORTED_FIELD_NUMBER: _ClassVar[int]
77
+ BRIDGEOTAUPGRADESUPPORTED_FIELD_NUMBER: _ClassVar[int]
78
+ APIVERSION_FIELD_NUMBER: _ClassVar[int]
79
+ VERSION_FIELD_NUMBER: _ClassVar[int]
80
+ BLESWVERSION_FIELD_NUMBER: _ClassVar[int]
81
+ INTERFACESWVERSION_FIELD_NUMBER: _ClassVar[int]
82
+ LOCATION_FIELD_NUMBER: _ClassVar[int]
83
+ CONFIG_FIELD_NUMBER: _ClassVar[int]
84
+ BLEADDRESS_FIELD_NUMBER: _ClassVar[int]
85
+ gatewayId: str
86
+ gatewayType: str
87
+ downlinkSupported: bool
88
+ bridgeOtaUpgradeSupported: bool
89
+ apiVersion: int
90
+ version: str
91
+ bleSwVersion: str
92
+ interfaceSwVersion: str
93
+ location: Location
94
+ config: _containers.MessageMap[str, Value]
95
+ 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, Value]] = ..., bleAddress: _Optional[str] = ...) -> None: ...
97
+
98
+ class GatewayInfo(_message.Message):
99
+ __slots__ = ("entries",)
100
+ class EntriesEntry(_message.Message):
101
+ __slots__ = ("key", "value")
102
+ KEY_FIELD_NUMBER: _ClassVar[int]
103
+ VALUE_FIELD_NUMBER: _ClassVar[int]
104
+ key: str
105
+ value: Value
106
+ def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[Value, _Mapping]] = ...) -> None: ...
107
+ ENTRIES_FIELD_NUMBER: _ClassVar[int]
108
+ entries: _containers.MessageMap[str, Value]
109
+ def __init__(self, entries: _Optional[_Mapping[str, Value]] = ...) -> None: ...
110
+
111
+ class GatewayLogs(_message.Message):
112
+ __slots__ = ("logs",)
113
+ LOGS_FIELD_NUMBER: _ClassVar[int]
114
+ logs: _containers.RepeatedScalarFieldContainer[str]
115
+ def __init__(self, logs: _Optional[_Iterable[str]] = ...) -> None: ...
116
+
117
+ class ActionStatus(_message.Message):
118
+ __slots__ = ("action", "status")
119
+ ACTION_FIELD_NUMBER: _ClassVar[int]
120
+ STATUS_FIELD_NUMBER: _ClassVar[int]
121
+ action: int
122
+ status: int
123
+ def __init__(self, action: _Optional[int] = ..., status: _Optional[int] = ...) -> None: ...
124
+
125
+ class DownlinkMessage(_message.Message):
126
+ __slots__ = ("txPacket", "gatewayAction", "bridgeUpgrade", "gatewayConfig", "customBroker", "customMessage")
127
+ TXPACKET_FIELD_NUMBER: _ClassVar[int]
128
+ GATEWAYACTION_FIELD_NUMBER: _ClassVar[int]
129
+ BRIDGEUPGRADE_FIELD_NUMBER: _ClassVar[int]
130
+ GATEWAYCONFIG_FIELD_NUMBER: _ClassVar[int]
131
+ CUSTOMBROKER_FIELD_NUMBER: _ClassVar[int]
132
+ CUSTOMMESSAGE_FIELD_NUMBER: _ClassVar[int]
133
+ txPacket: TxPacket
134
+ gatewayAction: GatewayAction
135
+ bridgeUpgrade: BridgeUpgrade
136
+ gatewayConfig: GatewayConfig
137
+ customBroker: CustomBroker
138
+ 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]] = ..., customBroker: _Optional[_Union[CustomBroker, _Mapping]] = ..., customMessage: _Optional[_Union[CustomMessage, _Mapping]] = ...) -> None: ...
140
+
141
+ class TxPacket(_message.Message):
142
+ __slots__ = ("payload", "maxRetries", "maxDurationMs")
143
+ PAYLOAD_FIELD_NUMBER: _ClassVar[int]
144
+ MAXRETRIES_FIELD_NUMBER: _ClassVar[int]
145
+ MAXDURATIONMS_FIELD_NUMBER: _ClassVar[int]
146
+ payload: bytes
147
+ maxRetries: int
148
+ maxDurationMs: int
149
+ def __init__(self, payload: _Optional[bytes] = ..., maxRetries: _Optional[int] = ..., maxDurationMs: _Optional[int] = ...) -> None: ...
150
+
151
+ class GatewayAction(_message.Message):
152
+ __slots__ = ("action",)
153
+ ACTION_FIELD_NUMBER: _ClassVar[int]
154
+ action: str
155
+ def __init__(self, action: _Optional[str] = ...) -> None: ...
156
+
157
+ class BridgeUpgrade(_message.Message):
158
+ __slots__ = ("rebootPacket", "txMaxDurationMs", "txMaxRetries", "bridgeId", "versionUuid", "upgradeBlSd", "imageDirUrl")
159
+ REBOOTPACKET_FIELD_NUMBER: _ClassVar[int]
160
+ TXMAXDURATIONMS_FIELD_NUMBER: _ClassVar[int]
161
+ TXMAXRETRIES_FIELD_NUMBER: _ClassVar[int]
162
+ BRIDGEID_FIELD_NUMBER: _ClassVar[int]
163
+ VERSIONUUID_FIELD_NUMBER: _ClassVar[int]
164
+ UPGRADEBLSD_FIELD_NUMBER: _ClassVar[int]
165
+ IMAGEDIRURL_FIELD_NUMBER: _ClassVar[int]
166
+ rebootPacket: bytes
167
+ txMaxDurationMs: int
168
+ txMaxRetries: int
169
+ bridgeId: str
170
+ versionUuid: str
171
+ upgradeBlSd: bool
172
+ imageDirUrl: str
173
+ def __init__(self, rebootPacket: _Optional[bytes] = ..., txMaxDurationMs: _Optional[int] = ..., txMaxRetries: _Optional[int] = ..., bridgeId: _Optional[str] = ..., versionUuid: _Optional[str] = ..., upgradeBlSd: bool = ..., imageDirUrl: _Optional[str] = ...) -> None: ...
174
+
175
+ class GatewayConfig(_message.Message):
176
+ __slots__ = ("version", "bleSwVersion", "interfaceSwVersion", "location", "config")
177
+ class ConfigEntry(_message.Message):
178
+ __slots__ = ("key", "value")
179
+ KEY_FIELD_NUMBER: _ClassVar[int]
180
+ VALUE_FIELD_NUMBER: _ClassVar[int]
181
+ key: str
182
+ value: Value
183
+ def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[Value, _Mapping]] = ...) -> None: ...
184
+ VERSION_FIELD_NUMBER: _ClassVar[int]
185
+ BLESWVERSION_FIELD_NUMBER: _ClassVar[int]
186
+ INTERFACESWVERSION_FIELD_NUMBER: _ClassVar[int]
187
+ LOCATION_FIELD_NUMBER: _ClassVar[int]
188
+ CONFIG_FIELD_NUMBER: _ClassVar[int]
189
+ version: str
190
+ bleSwVersion: str
191
+ interfaceSwVersion: str
192
+ location: Location
193
+ config: _containers.MessageMap[str, Value]
194
+ def __init__(self, version: _Optional[str] = ..., bleSwVersion: _Optional[str] = ..., interfaceSwVersion: _Optional[str] = ..., location: _Optional[_Union[Location, _Mapping]] = ..., config: _Optional[_Mapping[str, Value]] = ...) -> None: ...
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: ...
215
+
216
+ class CustomMessage(_message.Message):
217
+ __slots__ = ("entries",)
218
+ class EntriesEntry(_message.Message):
219
+ __slots__ = ("key", "value")
220
+ KEY_FIELD_NUMBER: _ClassVar[int]
221
+ VALUE_FIELD_NUMBER: _ClassVar[int]
222
+ key: str
223
+ value: Value
224
+ def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[Value, _Mapping]] = ...) -> None: ...
225
+ ENTRIES_FIELD_NUMBER: _ClassVar[int]
226
+ entries: _containers.MessageMap[str, Value]
227
+ def __init__(self, entries: _Optional[_Mapping[str, Value]] = ...) -> None: ...
@@ -0,0 +1,114 @@
1
+ import brg_certificate.ag.wlt_types_ag as ag
2
+
3
+ def eval_pkt(string):
4
+ try:
5
+ return eval(f'ag.{string}')
6
+ except:
7
+ return None
8
+
9
+ def eval_one_param(string):
10
+ string = string.strip("' ")
11
+ if string in ag.__dict__:
12
+ return eval(f'ag.{string}')
13
+ try:
14
+ return eval(string)
15
+ except:
16
+ return string
17
+
18
+ def eval_param(string):
19
+ if "," in string:
20
+ return [eval_one_param(x) for x in string.strip("[]").split(",")]
21
+ else:
22
+ return eval_one_param(string)
23
+
24
+ class WltPkt():
25
+ supported_pkt_types = ag.WLT_PKT_TYPES
26
+
27
+ def __init__(self, raw='', hdr=None, data_hdr=None, generic=None, pkt=None):
28
+ self.hdr = ag.Hdr() if hdr is None else hdr
29
+ self.data_hdr = ag.DataHdr() if data_hdr is None else data_hdr
30
+ self.generic = generic
31
+ self.pkt = pkt
32
+ if raw:
33
+ self.set(raw)
34
+
35
+ def __repr__(self) -> str:
36
+ if isinstance(self.pkt, (ag.UnifiedEchoPktV0, ag.UnifiedEchoPktV1, ag.UnifiedEchoExtPkt)):
37
+ return f"{self.data_hdr}\n{self.pkt}"
38
+ return f"{self.hdr}\n{self.pkt}"
39
+
40
+ def __eq__(self, other):
41
+ if isinstance(other, WltPkt):
42
+ return (
43
+ (self.hdr == other.hdr or
44
+ self.data_hdr == other.data_hdr) and
45
+ self.generic == other.generic and
46
+ self.pkt == other.pkt
47
+ )
48
+ return False
49
+
50
+ def dump(self):
51
+ if self.pkt:
52
+ if isinstance(self.pkt, (ag.UnifiedEchoPktV0, ag.UnifiedEchoPktV1, ag.UnifiedEchoExtPkt)):
53
+ return self.data_hdr.dump() + self.pkt.dump()
54
+ else:
55
+ return self.hdr.dump() + self.pkt.dump()
56
+ return self.data_hdr.dump() + self.generic.dump()
57
+
58
+ def set(self, string):
59
+
60
+ self.hdr.set(string[0:14])
61
+ self.data_hdr.set(string[0:14])
62
+ if self.hdr.group_id == ag.GROUP_ID_BRG2GW or self.hdr.group_id == ag.GROUP_ID_GW2BRG:
63
+ # GROUP_ID_BRG2GW & GROUP_ID_GW2BRG
64
+ self.generic = eval_pkt(f'GenericV{ag.API_VERSION_LATEST}()')
65
+ self.generic.set(string[14:62])
66
+
67
+ # MEL modules
68
+ if self.generic.module_type:
69
+ self.pkt = eval_pkt(f'{ag.MODULES_DICT[self.generic.module_type]}{self.generic.api_version}()')
70
+ elif self.generic.module_type == ag.MODULE_GLOBAL:
71
+ # Action pkts
72
+ if self.generic.msg_type == ag.BRG_MGMT_MSG_TYPE_ACTION:
73
+ pkt = eval_pkt(f'ActionGenericV{self.generic.api_version}("{string[14:62]}")')
74
+ if self.generic.api_version >= ag.API_VERSION_V8:
75
+ pkt = eval_pkt(f'{ag.ACTIONS_DICT[pkt.action_id]}{self.generic.api_version}()')
76
+ self.pkt = pkt
77
+ # OLD global config (GW2BRG & BRG2GW)
78
+ elif self.hdr.group_id == ag.GROUP_ID_GW2BRG and self.generic.msg_type == ag.BRG_MGMT_MSG_TYPE_CFG_SET:
79
+ self.pkt = eval_pkt(f'Gw2BrgCfgV8()') # no api_version field in Gw2BrgCfg pkts - default parse as api version 8 (Latest Gw2BrgCfg)
80
+ elif self.hdr.group_id == ag.GROUP_ID_BRG2GW:
81
+ if self.generic.msg_type == ag.BRG_MGMT_MSG_TYPE_CFG_SET or self.generic.msg_type == ag.BRG_MGMT_MSG_TYPE_CFG_INFO:
82
+ self.pkt = eval_pkt(f'Brg2GwCfgV{self.generic.api_version}()')
83
+ elif self.generic.msg_type == ag.BRG_MGMT_MSG_TYPE_HB:
84
+ self.pkt = eval_pkt(f'Brg2GwHbV{self.generic.api_version}()')
85
+ elif self.generic.msg_type == ag.BRG_MGMT_MSG_TYPE_HB_SLEEP:
86
+ self.pkt = eval_pkt(f'Brg2GwHbSleepV{self.generic.api_version}()')
87
+ # Unified pkt
88
+ elif self.data_hdr.group_id_major in ag.UNIFIED_GROUP_ID_LIST:
89
+ if self.data_hdr.group_id_major == ag.GROUP_ID_UNIFIED_PKT_V0:
90
+ self.pkt = ag.UnifiedEchoPktV0()
91
+ elif self.data_hdr.group_id_major == ag.GROUP_ID_UNIFIED_PKT_V1 or self.data_hdr.group_id_major == ag.GROUP_ID_BLE5_PKT0:
92
+ self.pkt = ag.UnifiedEchoPktV1()
93
+ elif self.data_hdr.group_id_major == ag.GROUP_ID_BLE5_EXTENDED:
94
+ self.pkt = ag.UnifiedEchoExtPkt()
95
+ else:
96
+ print(f"Unidentified unified group id found: {hex(self.data_hdr.group_id_major)}")
97
+ # SideInfo pkts
98
+ elif self.hdr.group_id == ag.GROUP_ID_SIDE_INFO_SENSOR:
99
+ self.pkt = ag.SideInfoSensor()
100
+ elif self.hdr.group_id == ag.GROUP_ID_SIDE_INFO:
101
+ self.pkt = ag.SideInfo()
102
+ else:
103
+ print(f"Unidentified sensor group id found: {hex(self.data_hdr.group_id_major)}")
104
+
105
+ if self.pkt:
106
+ if self.data_hdr.group_id_major == ag.GROUP_ID_BLE5_EXTENDED:
107
+ self.pkt.set(string[14:84])
108
+ else:
109
+ self.pkt.set(string[14:62])
110
+ # Signal Indicator pkt
111
+ elif self.hdr.group_id == ag.GROUP_ID_SIGNAL_INDICATOR:
112
+ self.pkt = eval_pkt(f'SignalIndicatorDataV{ag.SIGNAL_INDICATOR_PACKET_VERSION_LATEST}')(string[8:62])
113
+ elif self.hdr.uuid_lsb == ag.HDR_DEFAULT_BRG_SENSOR_UUID_LSB and self.hdr.uuid_msb == ag.HDR_DEFAULT_BRG_SENSOR_UUID_MSB:
114
+ self.pkt = ag.SensorData(string)