wiliot-certificate 4.4.3__py3-none-any.whl → 4.5.0__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 (297) hide show
  1. {brg_certificate → certificate}/ag/wlt_cmd_if.html +10 -4
  2. {brg_certificate → certificate}/ag/wlt_types_ag.py +1878 -519
  3. certificate/cert_common.py +1488 -0
  4. certificate/cert_config.py +480 -0
  5. {brg_certificate → certificate}/cert_data_sim.py +134 -46
  6. {brg_certificate → certificate}/cert_defines.py +129 -128
  7. {brg_certificate → certificate}/cert_gw_sim.py +183 -53
  8. {brg_certificate → certificate}/cert_mqtt.py +179 -64
  9. {brg_certificate → certificate}/cert_prints.py +35 -33
  10. {brg_certificate → certificate}/cert_protobuf.py +15 -6
  11. {brg_certificate → certificate}/cert_results.py +240 -64
  12. certificate/cert_utils.py +634 -0
  13. certificate/certificate.py +205 -0
  14. certificate/certificate_cli.py +76 -0
  15. certificate/certificate_eth_test_list.txt +76 -0
  16. certificate/certificate_sanity_test_list.txt +66 -0
  17. certificate/certificate_test_list.txt +76 -0
  18. {brg_certificate → certificate}/tests/calibration/interval_test/interval_test.json +3 -2
  19. {brg_certificate → certificate}/tests/calibration/interval_test/interval_test.py +7 -6
  20. certificate/tests/calibration/output_power_test/output_power_test.json +23 -0
  21. certificate/tests/calibration/output_power_test/output_power_test.py +39 -0
  22. {brg_certificate → certificate}/tests/calibration/pattern_test/pattern_test.json +2 -1
  23. {brg_certificate → certificate}/tests/calibration/pattern_test/pattern_test.py +20 -15
  24. certificate/tests/cloud_connectivity/acl_ext_adv_test/acl_ext_adv_test.json +15 -0
  25. certificate/tests/cloud_connectivity/acl_ext_adv_test/acl_ext_adv_test.py +140 -0
  26. certificate/tests/cloud_connectivity/acl_test/acl_test.json +15 -0
  27. certificate/tests/cloud_connectivity/acl_test/acl_test.py +96 -0
  28. certificate/tests/cloud_connectivity/brg_ota_test/brg_ota_test.json +19 -0
  29. certificate/tests/cloud_connectivity/brg_ota_test/brg_ota_test.py +41 -0
  30. certificate/tests/cloud_connectivity/channel_scan_behaviour_test/channel_scan_behaviour_test.json +19 -0
  31. certificate/tests/cloud_connectivity/channel_scan_behaviour_test/channel_scan_behaviour_test.py +215 -0
  32. certificate/tests/cloud_connectivity/connection_test/connection_test.json +18 -0
  33. certificate/tests/cloud_connectivity/connection_test/connection_test.py +67 -0
  34. certificate/tests/cloud_connectivity/deduplication_test/deduplication_test.json +15 -0
  35. certificate/tests/cloud_connectivity/deduplication_test/deduplication_test.py +80 -0
  36. certificate/tests/cloud_connectivity/downlink_test/downlink_test.json +21 -0
  37. certificate/tests/cloud_connectivity/downlink_test/downlink_test.py +201 -0
  38. certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.json +17 -0
  39. certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.py +104 -0
  40. certificate/tests/cloud_connectivity/reboot_test/reboot_test.json +18 -0
  41. certificate/tests/cloud_connectivity/reboot_test/reboot_test.py +59 -0
  42. certificate/tests/cloud_connectivity/registration_test/registration_test.json +20 -0
  43. certificate/tests/cloud_connectivity/registration_test/registration_test.py +384 -0
  44. certificate/tests/cloud_connectivity/registration_test/registration_test_cli.py +90 -0
  45. certificate/tests/cloud_connectivity/stress_test/stress_test.json +17 -0
  46. certificate/tests/cloud_connectivity/stress_test/stress_test.py +101 -0
  47. certificate/tests/cloud_connectivity/uplink_ext_adv_test/uplink_ext_adv_test.json +25 -0
  48. certificate/tests/cloud_connectivity/uplink_ext_adv_test/uplink_ext_adv_test.py +92 -0
  49. certificate/tests/cloud_connectivity/uplink_test/uplink_test.json +20 -0
  50. certificate/tests/cloud_connectivity/uplink_test/uplink_test.py +169 -0
  51. {brg_certificate → certificate}/tests/datapath/aging_test/aging_test.json +2 -1
  52. certificate/tests/datapath/aging_test/aging_test.py +142 -0
  53. certificate/tests/datapath/event_ble5_test/event_ble5_test.json +17 -0
  54. certificate/tests/datapath/event_ble5_test/event_ble5_test.py +89 -0
  55. certificate/tests/datapath/event_test/event_test.json +17 -0
  56. certificate/tests/datapath/event_test/event_test.py +80 -0
  57. {brg_certificate → certificate}/tests/datapath/num_of_tags_test/num_of_tags_test.json +4 -3
  58. {brg_certificate → certificate}/tests/datapath/num_of_tags_test/num_of_tags_test.py +19 -13
  59. certificate/tests/datapath/output_power_test/output_power_test.json +23 -0
  60. {brg_certificate → certificate}/tests/datapath/output_power_test/output_power_test.py +17 -6
  61. {brg_certificate → certificate}/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.json +2 -1
  62. {brg_certificate → certificate}/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +13 -11
  63. {brg_certificate → certificate}/tests/datapath/pacer_interval_test/pacer_interval_test.json +2 -1
  64. {brg_certificate → certificate}/tests/datapath/pacer_interval_test/pacer_interval_test.py +9 -7
  65. {brg_certificate → certificate}/tests/datapath/pattern_test/pattern_test.json +3 -2
  66. {brg_certificate → certificate}/tests/datapath/pattern_test/pattern_test.py +18 -6
  67. certificate/tests/datapath/pkt_filter_ble5_chl21_test/pkt_filter_ble5_chl21_test.json +20 -0
  68. certificate/tests/datapath/pkt_filter_ble5_chl21_test/pkt_filter_ble5_chl21_test.py +61 -0
  69. {brg_certificate → certificate}/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.json +2 -1
  70. {brg_certificate → certificate}/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +15 -14
  71. certificate/tests/datapath/pkt_filter_brg2gw_ext_adv_test/pkt_filter_brg2gw_ext_adv_test.json +19 -0
  72. certificate/tests/datapath/pkt_filter_brg2gw_ext_adv_test/pkt_filter_brg2gw_ext_adv_test.py +85 -0
  73. {brg_certificate → certificate}/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.json +2 -1
  74. {brg_certificate → certificate}/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.py +10 -9
  75. {brg_certificate → certificate}/tests/datapath/pkt_filter_test/pkt_filter_test.json +2 -1
  76. {brg_certificate → certificate}/tests/datapath/pkt_filter_test/pkt_filter_test.py +10 -9
  77. {brg_certificate → certificate}/tests/datapath/rssi_threshold_test/rssi_threshold_test.json +3 -2
  78. {brg_certificate → certificate}/tests/datapath/rssi_threshold_test/rssi_threshold_test.py +9 -8
  79. brg_certificate/tests/datapath/output_power_test/output_power_test.json → certificate/tests/datapath/rx_channel_hopping_test/rx_channel_hopping_test.json +6 -4
  80. certificate/tests/datapath/rx_channel_hopping_test/rx_channel_hopping_test.py +77 -0
  81. {brg_certificate → certificate}/tests/datapath/rx_channel_test/rx_channel_test.json +3 -2
  82. {brg_certificate → certificate}/tests/datapath/rx_channel_test/rx_channel_test.py +7 -6
  83. {brg_certificate → certificate}/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.json +8 -7
  84. {brg_certificate → certificate}/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +113 -73
  85. {brg_certificate → certificate}/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.json +8 -7
  86. {brg_certificate → certificate}/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.py +112 -72
  87. {brg_certificate → certificate}/tests/datapath/stress_gen3_test/stress_gen3_test.json +4 -3
  88. {brg_certificate → certificate}/tests/datapath/stress_gen3_test/stress_gen3_test.py +15 -11
  89. {brg_certificate → certificate}/tests/datapath/stress_test/stress_test.json +4 -3
  90. {brg_certificate → certificate}/tests/datapath/stress_test/stress_test.py +15 -11
  91. {brg_certificate → certificate}/tests/datapath/tx_repetition_test/tx_repetition_test.json +3 -1
  92. {brg_certificate → certificate}/tests/datapath/tx_repetition_test/tx_repetition_test.py +14 -13
  93. certificate/tests/edge_mgmt/action_blink_test/action_blink_test.json +15 -0
  94. certificate/tests/edge_mgmt/action_blink_test/action_blink_test.py +24 -0
  95. certificate/tests/edge_mgmt/action_get_battery_sensor_test/action_get_battery_sensor_test.json +15 -0
  96. certificate/tests/edge_mgmt/action_get_battery_sensor_test/action_get_battery_sensor_test.py +43 -0
  97. certificate/tests/edge_mgmt/action_get_module_test/action_get_module_test.json +15 -0
  98. certificate/tests/edge_mgmt/action_get_module_test/action_get_module_test.py +42 -0
  99. certificate/tests/edge_mgmt/action_get_pof_data_test/action_get_pof_data_test.json +15 -0
  100. certificate/tests/edge_mgmt/action_get_pof_data_test/action_get_pof_data_test.py +44 -0
  101. certificate/tests/edge_mgmt/action_gw_hb_test/action_gw_hb_test.json +16 -0
  102. certificate/tests/edge_mgmt/action_gw_hb_test/action_gw_hb_test.py +42 -0
  103. certificate/tests/edge_mgmt/action_reboot_test/action_reboot_test.json +15 -0
  104. certificate/tests/edge_mgmt/action_reboot_test/action_reboot_test.py +49 -0
  105. certificate/tests/edge_mgmt/action_restore_defaults_test/action_restore_defaults_test.json +15 -0
  106. certificate/tests/edge_mgmt/action_restore_defaults_test/action_restore_defaults_test.py +102 -0
  107. certificate/tests/edge_mgmt/action_send_hb_test/action_send_hb_test.json +15 -0
  108. certificate/tests/edge_mgmt/action_send_hb_test/action_send_hb_test.py +45 -0
  109. {brg_certificate → certificate}/tests/edge_mgmt/periodic_msgs_test/periodic_msgs_test.json +3 -2
  110. {brg_certificate → certificate}/tests/edge_mgmt/periodic_msgs_test/periodic_msgs_test.py +22 -11
  111. {brg_certificate → certificate}/tests/energy2400/duty_cycle_test/duty_cycle_test.json +2 -1
  112. {brg_certificate → certificate}/tests/energy2400/duty_cycle_test/duty_cycle_test.py +7 -6
  113. certificate/tests/energy2400/output_power_test/output_power_test.json +23 -0
  114. {brg_certificate → certificate}/tests/energy2400/output_power_test/output_power_test.py +17 -6
  115. {brg_certificate → certificate}/tests/energy2400/pattern_test/pattern_test.json +2 -1
  116. {brg_certificate → certificate}/tests/energy2400/pattern_test/pattern_test.py +7 -6
  117. certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.json +26 -0
  118. certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.py +379 -0
  119. certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.json +20 -0
  120. certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.py +173 -0
  121. certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +24 -0
  122. certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +350 -0
  123. {brg_certificate → certificate}/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.json +2 -1
  124. {brg_certificate → certificate}/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.py +7 -6
  125. {brg_certificate → certificate}/tests/energy_sub1g/pattern_test/pattern_test.json +2 -1
  126. {brg_certificate → certificate}/tests/energy_sub1g/pattern_test/pattern_test.py +7 -6
  127. {brg_certificate → certificate}/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.json +2 -1
  128. {brg_certificate → certificate}/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.py +10 -10
  129. {brg_certificate → certificate}/tests/sensors/ext_sensor_test/ext_sensor_test.json +5 -4
  130. certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +450 -0
  131. certificate/wlt_types.py +122 -0
  132. {gw_certificate → common}/api_if/202/status.json +6 -0
  133. {gw_certificate → common}/api_if/203/status.json +6 -0
  134. {gw_certificate → common}/api_if/204/status.json +6 -0
  135. common/api_if/206/data.json +85 -0
  136. common/api_if/206/status.json +69 -0
  137. common/api_if/api_validation.py +91 -0
  138. common/web/templates/generator.html +210 -0
  139. common/web/templates/index.html +20 -0
  140. common/web/templates/menu.html +54 -0
  141. common/web/templates/parser.html +53 -0
  142. {brg_certificate/ag → common/web/templates}/wlt_types.html +1216 -191
  143. common/web/web_utils.py +399 -0
  144. {brg_certificate → common}/wltPb_pb2.py +14 -12
  145. {gw_certificate/common → common}/wltPb_pb2.pyi +16 -2
  146. gui_certificate/gui_certificate_cli.py +14 -0
  147. gui_certificate/server.py +1267 -0
  148. gui_certificate/templates/cert_run.html +1273 -0
  149. wiliot_certificate-4.5.0.dist-info/METADATA +99 -0
  150. wiliot_certificate-4.5.0.dist-info/RECORD +168 -0
  151. {wiliot_certificate-4.4.3.dist-info → wiliot_certificate-4.5.0.dist-info}/WHEEL +1 -1
  152. wiliot_certificate-4.5.0.dist-info/entry_points.txt +5 -0
  153. wiliot_certificate-4.5.0.dist-info/top_level.txt +3 -0
  154. brg_certificate/ag/energous_v0_defines.py +0 -925
  155. brg_certificate/ag/energous_v1_defines.py +0 -931
  156. brg_certificate/ag/energous_v2_defines.py +0 -925
  157. brg_certificate/ag/energous_v3_defines.py +0 -925
  158. brg_certificate/ag/energous_v4_defines.py +0 -925
  159. brg_certificate/ag/fanstel_lan_v0_defines.py +0 -925
  160. brg_certificate/ag/fanstel_lte_v0_defines.py +0 -925
  161. brg_certificate/ag/fanstel_wifi_v0_defines.py +0 -925
  162. brg_certificate/ag/minew_lte_v0_defines.py +0 -925
  163. brg_certificate/ag/wlt_types_ag_jsons/brg2brg_ota.json +0 -142
  164. brg_certificate/ag/wlt_types_ag_jsons/brg2gw_hb.json +0 -785
  165. brg_certificate/ag/wlt_types_ag_jsons/brg2gw_hb_sleep.json +0 -139
  166. brg_certificate/ag/wlt_types_ag_jsons/calibration.json +0 -394
  167. brg_certificate/ag/wlt_types_ag_jsons/custom.json +0 -515
  168. brg_certificate/ag/wlt_types_ag_jsons/datapath.json +0 -672
  169. brg_certificate/ag/wlt_types_ag_jsons/energy2400.json +0 -550
  170. brg_certificate/ag/wlt_types_ag_jsons/energySub1g.json +0 -595
  171. brg_certificate/ag/wlt_types_ag_jsons/externalSensor.json +0 -598
  172. brg_certificate/ag/wlt_types_ag_jsons/interface.json +0 -938
  173. brg_certificate/ag/wlt_types_ag_jsons/powerManagement.json +0 -1234
  174. brg_certificate/ag/wlt_types_ag_jsons/side_info_sensor.json +0 -105
  175. brg_certificate/ag/wlt_types_ag_jsons/signal_indicator_data.json +0 -77
  176. brg_certificate/ag/wlt_types_ag_jsons/unified_echo_ext_pkt.json +0 -61
  177. brg_certificate/ag/wlt_types_ag_jsons/unified_echo_pkt.json +0 -110
  178. brg_certificate/brg_certificate.py +0 -225
  179. brg_certificate/brg_certificate_cli.py +0 -63
  180. brg_certificate/cert_common.py +0 -923
  181. brg_certificate/cert_config.py +0 -402
  182. brg_certificate/cert_utils.py +0 -362
  183. brg_certificate/certificate_bcc_sanity_test_list.txt +0 -40
  184. brg_certificate/certificate_bcc_test_list.txt +0 -48
  185. brg_certificate/certificate_sanity_test_list.txt +0 -43
  186. brg_certificate/certificate_test_list.txt +0 -53
  187. brg_certificate/config/eclipse.json +0 -10
  188. brg_certificate/config/hivemq.json +0 -10
  189. brg_certificate/config/mosquitto.json +0 -10
  190. brg_certificate/config/mosquitto.md +0 -95
  191. brg_certificate/config/wiliot-dev.json +0 -10
  192. brg_certificate/restore_brg.py +0 -61
  193. brg_certificate/tests/calibration/output_power_test/output_power_test.json +0 -16
  194. brg_certificate/tests/calibration/output_power_test/output_power_test.py +0 -28
  195. brg_certificate/tests/datapath/aging_test/aging_test.py +0 -143
  196. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.json +0 -16
  197. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.py +0 -73
  198. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.json +0 -17
  199. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.py +0 -118
  200. brg_certificate/tests/edge_mgmt/actions_test/actions_test.json +0 -14
  201. brg_certificate/tests/edge_mgmt/actions_test/actions_test.py +0 -396
  202. brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.json +0 -20
  203. brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.py +0 -94
  204. brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.json +0 -19
  205. brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.py +0 -87
  206. brg_certificate/tests/edge_mgmt/leds_test/leds_test.json +0 -17
  207. brg_certificate/tests/edge_mgmt/leds_test/leds_test.py +0 -223
  208. brg_certificate/tests/edge_mgmt/ota_test/ota_test.json +0 -17
  209. brg_certificate/tests/edge_mgmt/ota_test/ota_test.py +0 -128
  210. brg_certificate/tests/energy2400/output_power_test/output_power_test.json +0 -16
  211. brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.json +0 -20
  212. brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.py +0 -321
  213. brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.json +0 -20
  214. brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.py +0 -321
  215. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.json +0 -20
  216. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.py +0 -141
  217. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +0 -20
  218. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +0 -276
  219. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.json +0 -20
  220. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.py +0 -390
  221. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.json +0 -16
  222. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.py +0 -28
  223. brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +0 -305
  224. brg_certificate/wltPb_pb2.pyi +0 -234
  225. brg_certificate/wlt_types.py +0 -113
  226. gw_certificate/ag/ut_defines.py +0 -364
  227. gw_certificate/ag/wlt_types.py +0 -85
  228. gw_certificate/ag/wlt_types_ag.py +0 -5310
  229. gw_certificate/ag/wlt_types_data.py +0 -64
  230. gw_certificate/api/extended_api.py +0 -23
  231. gw_certificate/api_if/200/data.json +0 -106
  232. gw_certificate/api_if/200/status.json +0 -47
  233. gw_certificate/api_if/201/data.json +0 -98
  234. gw_certificate/api_if/201/status.json +0 -53
  235. gw_certificate/api_if/205/logs.json +0 -12
  236. gw_certificate/api_if/api_validation.py +0 -38
  237. gw_certificate/api_if/gw_capabilities.py +0 -54
  238. gw_certificate/cert_results.py +0 -145
  239. gw_certificate/common/analysis_data_bricks.py +0 -60
  240. gw_certificate/common/debug.py +0 -42
  241. gw_certificate/common/serialization_formatter.py +0 -93
  242. gw_certificate/common/utils.py +0 -8
  243. gw_certificate/common/utils_defines.py +0 -15
  244. gw_certificate/common/wltPb_pb2.py +0 -84
  245. gw_certificate/gw_certificate.py +0 -154
  246. gw_certificate/gw_certificate_cli.py +0 -87
  247. gw_certificate/interface/4.4.93_app.zip +0 -0
  248. gw_certificate/interface/4.4.93_sd_bl_app.zip +0 -0
  249. gw_certificate/interface/ble_simulator.py +0 -61
  250. gw_certificate/interface/ble_sniffer.py +0 -189
  251. gw_certificate/interface/flash_fw.py +0 -90
  252. gw_certificate/interface/if_defines.py +0 -36
  253. gw_certificate/interface/mqtt.py +0 -563
  254. gw_certificate/interface/nrfutil-linux +0 -0
  255. gw_certificate/interface/nrfutil-mac +0 -0
  256. gw_certificate/interface/nrfutil.exe +0 -0
  257. gw_certificate/interface/pkt_generator.py +0 -594
  258. gw_certificate/interface/uart_if.py +0 -236
  259. gw_certificate/interface/uart_ports.py +0 -20
  260. gw_certificate/templates/results.html +0 -241
  261. gw_certificate/templates/stage.html +0 -22
  262. gw_certificate/templates/table.html +0 -6
  263. gw_certificate/templates/test.html +0 -38
  264. gw_certificate/tests/__init__.py +0 -10
  265. gw_certificate/tests/actions.py +0 -289
  266. gw_certificate/tests/bad_crc_to_PER_quantization.csv +0 -51
  267. gw_certificate/tests/connection.py +0 -188
  268. gw_certificate/tests/downlink.py +0 -172
  269. gw_certificate/tests/generic.py +0 -238
  270. gw_certificate/tests/registration.py +0 -340
  271. gw_certificate/tests/static/__init__.py +0 -0
  272. gw_certificate/tests/static/connection_defines.py +0 -9
  273. gw_certificate/tests/static/downlink_defines.py +0 -9
  274. gw_certificate/tests/static/generated_packet_table.py +0 -195
  275. gw_certificate/tests/static/packet_table.csv +0 -10067
  276. gw_certificate/tests/static/references.py +0 -5
  277. gw_certificate/tests/static/uplink_defines.py +0 -14
  278. gw_certificate/tests/throughput.py +0 -240
  279. gw_certificate/tests/uplink.py +0 -853
  280. wiliot_certificate-4.4.3.dist-info/METADATA +0 -211
  281. wiliot_certificate-4.4.3.dist-info/RECORD +0 -210
  282. wiliot_certificate-4.4.3.dist-info/entry_points.txt +0 -3
  283. wiliot_certificate-4.4.3.dist-info/top_level.txt +0 -3
  284. {brg_certificate → certificate}/__init__.py +0 -0
  285. {gw_certificate → common}/api_if/202/data.json +0 -0
  286. {gw_certificate/api_if/200 → common/api_if/202}/logs.json +0 -0
  287. {gw_certificate → common}/api_if/203/data.json +0 -0
  288. {gw_certificate/api_if/201 → common/api_if/203}/logs.json +0 -0
  289. {gw_certificate → common}/api_if/204/data.json +0 -0
  290. {gw_certificate/api_if/202 → common/api_if/204}/logs.json +0 -0
  291. {gw_certificate → common}/api_if/205/data.json +0 -0
  292. {gw_certificate/api_if/203 → common/api_if/205}/logs.json +0 -0
  293. {gw_certificate → common}/api_if/205/status.json +0 -0
  294. {gw_certificate/api_if/204 → common/api_if/206}/logs.json +0 -0
  295. {gw_certificate → common/api_if}/__init__.py +0 -0
  296. {gw_certificate/api_if → gui_certificate}/__init__.py +0 -0
  297. {wiliot_certificate-4.4.3.dist-info → wiliot_certificate-4.5.0.dist-info}/licenses/LICENSE +0 -0
@@ -4,21 +4,36 @@ import re
4
4
  import paho.mqtt.client as mqtt
5
5
  import serial
6
6
  import serial.tools.list_ports
7
- from brg_certificate.cert_mqtt import *
8
- from brg_certificate.cert_defines import *
9
- from brg_certificate.cert_prints import *
10
- import brg_certificate.cert_common as cert_common
11
- from brg_certificate.cert_data_sim import PIXEL_SIM_INDICATOR, write_to_data_sim_log_file
12
- import brg_certificate.cert_utils as cert_utils
7
+ from certificate.cert_mqtt import *
8
+ from certificate.cert_defines import *
9
+ from certificate.cert_prints import *
10
+ import certificate.cert_common as cert_common
11
+ from certificate.cert_data_sim import PIXEL_SIM_INDICATOR, write_to_data_sim_log_file
12
+ import certificate.cert_utils as cert_utils
13
13
 
14
14
  # Generic Defines
15
- SERIAL_TIMEOUT = 0.1 # TODO decide about the right value
15
+ SERIAL_TIMEOUT = 0.05 # TODO decide about the right value
16
16
  STOP_ADVERTISING = '!stop_advertising'
17
17
  RESET_GW = '!reset'
18
18
  DEDUPLICATION_PKTS = '!deduplication_pkts'
19
+ GW_CERT_TESTER = '!gw_cert_tester'
19
20
  SET_RX_CHANNEL = '!set_rx_channel'
20
21
  VERSION = '!version'
21
22
  CONNECTIVITY_STATUS = '!connectivity_status'
23
+ BLE_SIM_INIT = '!ble_sim_init'
24
+ BLE_SIM = '!ble_sim'
25
+ BLE_SIM_EXT_ADV = '!ble_sim_ext_adv'
26
+
27
+ # Received RX uarts
28
+ RX_NORDIC_RECOVER_RESET = "NORDIC_RECOVER 1"
29
+ RX_NORDIC_RECOVER_NORESET = "NORDIC_RECOVER 0"
30
+ RX_RESET = "reset"
31
+
32
+ GW_SIM_RESET_TS = None
33
+
34
+ # Slip related
35
+ SLIP_END = 0xC0
36
+ UART_PKT_PREFIX_BYTE = 0x70
22
37
 
23
38
  # Interference Analysis Defines
24
39
  DEFAULT_LOOKOUT_TIME = 2
@@ -34,6 +49,7 @@ CNTRS_KEYS = [NON_WLT_RX, WLT_RX, BAD_CRC
34
49
 
35
50
  GW_STATUS_MESSAGES = []
36
51
 
52
+
37
53
  ##############################################
38
54
  # UART PKT TYPES
39
55
  ##############################################
@@ -41,9 +57,9 @@ class UplinkPkt(): # p6
41
57
  def __init__(self, gw, seq_id, raw):
42
58
  self.gw = gw
43
59
  self.seq_id = seq_id
44
- self.alias_brg_id = raw[0:12]
45
- self.payload = raw[12:74]
46
- self.rssi = int(raw[74:76], 16)
60
+ self.alias_brg_id = raw[2:14]
61
+ self.payload = raw[14:76]
62
+ self.rssi = int(raw[0:2], 16)
47
63
  def dump(self):
48
64
  return {
49
65
  GW_ID: self.gw, TIMESTAMP: time.time()*1000,
@@ -58,9 +74,26 @@ class UplinkExtendedPkt(): # p7
58
74
  def __init__(self, gw, seq_id, raw):
59
75
  self.gw = gw
60
76
  self.seq_id = seq_id
61
- self.alias_brg_id = raw[0:12]
62
- self.payload = raw[12:96] # 39 payload + 3 side info
63
- self.rssi = int(raw[96:98], 16)
77
+ self.alias_brg_id = raw[2:14]
78
+ self.payload = raw[14:98] # 39 payload + 3 side info
79
+ self.rssi = int(raw[0:2], 16)
80
+ def dump(self):
81
+ return {
82
+ GW_ID: self.gw, TIMESTAMP: time.time()*1000,
83
+ "packets": [{ALIAS_BRIDGE_ID: self.alias_brg_id,
84
+ TIMESTAMP: time.time()*1000,
85
+ SEQUENCE_ID: self.seq_id,
86
+ RSSI: self.rssi,
87
+ PAYLOAD: self.payload}]
88
+ }
89
+
90
+ class UplinkAggregatedPkt(): # p8
91
+ def __init__(self, gw, seq_id, raw):
92
+ self.gw = gw
93
+ self.seq_id = seq_id
94
+ self.alias_brg_id = raw[2:14]
95
+ self.payload = raw[14:]
96
+ self.rssi = int(raw[0:2], 16)
64
97
  def dump(self):
65
98
  return {
66
99
  GW_ID: self.gw, TIMESTAMP: time.time()*1000,
@@ -74,20 +107,30 @@ class UplinkExtendedPkt(): # p7
74
107
  ##############################################
75
108
  # UT HELPER FUNCTIONS
76
109
  ##############################################
77
- def prep_gw(args, mqttc, start_time):
78
- # Check GW is online and configure to defaults
79
- utPrint(SEP)
80
- utPrint("Checking UART response and configure internal brg to defaults", "BLUE")
81
- gw = args.gw
82
- protobuf = False
83
- internal_brg_mac_addr = os.getenv(GW_SIM_BLE_MAC_ADDRESS)
84
- internal_brg_ble_ver = os.getenv(GW_APP_VERSION_HEADER)
85
- if not internal_brg_mac_addr:
86
- cert_utils.handle_error(f"ERROR: Didn't receive {GW_SIM_BLE_MAC_ADDRESS} response!", start_time)
87
- internal_brg = cert_utils.ut_prep_brg(args, mqttc, start_time, gw, internal_brg_mac_addr, "prod", protobuf)
88
- if internal_brg.api_version != ag.API_VERSION_LATEST:
89
- cert_utils.handle_error(f"ERROR: Certificate FW api_version={internal_brg.api_version} instead of api_version={ag.API_VERSION_LATEST}! Please upgrade the FW!", start_time)
90
- return gw, internal_brg, "prod", {BLE_VERSION:internal_brg_ble_ver, WIFI_VERSION:"0.0.0"}, protobuf
110
+
111
+ def slip_decode(data: bytes) -> bytes:
112
+ SLIP_ESC = 0xDB
113
+ SLIP_ESC_END = 0xDC
114
+ SLIP_ESC_ESC = 0xDD
115
+
116
+ decoded = bytearray()
117
+ i = 0
118
+ while i < len(data):
119
+ byte = data[i]
120
+ if byte == SLIP_END:
121
+ i += 1
122
+ continue
123
+ elif byte == SLIP_ESC:
124
+ i += 1
125
+ if i < len(data):
126
+ if data[i] == SLIP_ESC_END:
127
+ decoded.append(SLIP_END)
128
+ elif data[i] == SLIP_ESC_ESC:
129
+ decoded.append(SLIP_ESC)
130
+ else:
131
+ decoded.append(byte)
132
+ i += 1
133
+ return bytes(decoded)
91
134
 
92
135
  ##############################################
93
136
  # UART FUNCTIONS
@@ -97,11 +140,55 @@ def write_to_ble(ble_serial, txt, print_enable=True, sleep=0):
97
140
  # print('\n' + txt)
98
141
  ble_serial.write(bytes(txt, encoding='utf-8') + b'\r\n')
99
142
  if sleep:
100
- cert_common.wait_time_n_print(sleep)
143
+ wait_time_n_print(sleep)
144
+
145
+ def read_frame(ble_serial: serial.Serial, frame_max_read_attempts: int = 5):
146
+ """
147
+ Read either [0xC0][data][0xC0] uart messages, or [data] message (for !version reply)
148
+
149
+ :return str/None: ascii string if read successfully. None otherwise
150
+ """
151
+ opening_delim_received = False
152
+ closing_delim_received = False
153
+ read_attempts = 0
154
+
155
+ input = ble_serial.read_until(expected=bytes([SLIP_END]))
156
+ # We got the opening SLIP_END delimiter, read the message.
157
+ # It's in a while loop to skip empty frames.
158
+ while len(input) == 1 and input[0] == SLIP_END:
159
+ opening_delim_received = True
160
+ if read_attempts > frame_max_read_attempts:
161
+ return None
162
+ input = ble_serial.read_until(expected=bytes([SLIP_END]))
163
+ read_attempts += 1
164
+
165
+ while opening_delim_received and not closing_delim_received:
166
+ # Keep reading until we get the closing delimiter
167
+ if input[-1] == SLIP_END:
168
+ closing_delim_received = True
169
+ break
170
+ if read_attempts > frame_max_read_attempts:
171
+ print(f'WARNING: Dropped pkt with partial frame: {input}')
172
+ return None
173
+ chunk = ble_serial.read_until(expected=bytes([SLIP_END]))
174
+ if not chunk:
175
+ read_attempts += 1
176
+ continue
177
+ input += chunk
178
+
179
+ return input
101
180
 
102
- def read_from_ble(ble_serial):
103
- ble_serial_bytes = ble_serial.readline()
104
- input = ble_serial_bytes.decode("utf-8", "ignore").strip()
181
+ def read_from_ble(ble_serial: serial.Serial):
182
+ input = read_frame(ble_serial)
183
+ if input == None or len(input) == 0:
184
+ return None
185
+
186
+ input = slip_decode(input)
187
+ input_len = len(input)
188
+ if input_len > 3 and input[0] == UART_PKT_PREFIX_BYTE:
189
+ input = input[0:3].decode("utf-8", "ignore") + input[3:].hex().upper()
190
+ else:
191
+ input = input.decode("utf-8", "ignore").strip()
105
192
  # if input:
106
193
  # print(input)
107
194
  return input
@@ -111,7 +198,7 @@ def gw_app_reponse(ble_serial):
111
198
  start_time = datetime.datetime.now()
112
199
  while (datetime.datetime.now() - start_time).seconds < 2:
113
200
  input = read_from_ble(ble_serial)
114
- if GW_APP_VERSION_HEADER in input:
201
+ if input is not None and GW_APP_VERSION_HEADER in input:
115
202
  print(input)
116
203
  ble_chip_sw_ver = re.search(r'WILIOT_GW_BLE_CHIP_SW_VER=(\d+\.\d+\.\d+)', input).group(1)
117
204
  ble_mac_address = re.search(r'WILIOT_GW_BLE_CHIP_MAC_ADDRESS=([0-9A-F]{12})', input).group(1)
@@ -155,7 +242,7 @@ def interference_analysis(ble_serial):
155
242
  print('\n' + '#' * 30 + f'\nAnalyzing channel {channel[0]}\n' + '#' * 30)
156
243
  # Send the sniffer a command to retrieve the counters and convert them to dict
157
244
  start_cntrs = get_pkts_cntrs(ble_serial, channel[0], set_rx_ch=True)
158
- cert_common.wait_time_n_print(CNTRS_LISTEN_TIME_SEC)
245
+ wait_time_n_print(CNTRS_LISTEN_TIME_SEC)
159
246
  end_cntrs = get_pkts_cntrs(ble_serial, channel[0])
160
247
 
161
248
  if start_cntrs is None or end_cntrs is None:
@@ -168,6 +255,9 @@ def interference_analysis(ble_serial):
168
255
  for key in CNTRS_KEYS:
169
256
  diff_dict[key] = handle_wrap_around(end_cntrs[key] - start_cntrs[key])
170
257
  bad_crc_percentage = round((diff_dict[BAD_CRC] / (diff_dict[WLT_RX] + diff_dict[NON_WLT_RX])) * 100)
258
+ notes_file_path = os.path.join(ARTIFACTS_DIR, RESULT_NOTES_FILE)
259
+ with open(notes_file_path, "a") as f:
260
+ f.write(f'Channel {channel[0]} ({channel[1]} MHz) Ambient Interference (bad CRC percentage): {bad_crc_percentage}%\n')
171
261
  print(color('WARNING', f'Channel {channel[0]} ({channel[1]} MHz) Ambient Interference (bad CRC percentage) is: {bad_crc_percentage}%'))
172
262
  print(f'Good CRC packets = {diff_dict[NON_WLT_RX] + diff_dict[WLT_RX] - diff_dict[BAD_CRC]}, bad CRC packets: {diff_dict[BAD_CRC]}')
173
263
 
@@ -193,10 +283,6 @@ def on_unsubscribe(mqttc, userdata, mid):
193
283
  def on_message(client, userdata, message):
194
284
  data = json.loads(message.payload.decode("utf-8"))
195
285
  print_enable = True if not PIXEL_SIM_INDICATOR in str(message.payload.decode("utf-8")) else False
196
- # if print_enable:
197
- # print("##########\n// Message received at {}, topic={}:\n{}\n".format(datetime.datetime.now().strftime("%d/%m/%Y, %H:%M:%S"), message.topic, str(message.payload.decode("utf-8"))))
198
- # #TODO: logging print
199
- # # print("##########\n// Message received at {}, topic={}:\n{}\n".format(datetime.datetime.now().strftime("%d/%m/%Y, %H:%M:%S"), message.topic, str(message.payload.decode("utf-8"))))
200
286
  # Send packet to UART
201
287
  if TX_PKT in data:
202
288
  # Downlink packet
@@ -215,36 +301,75 @@ def on_message(client, userdata, message):
215
301
  # GW SIMULATOR
216
302
  ##############################################
217
303
  def parse_uart_pkts(input, mqttc, custom_broker, gw_id, seq_id):
218
- # 3 for p6, 12 for alias_brg_id, 62 for payload, 2 for rssi
304
+ # 3 for p6, 2 for rssi, 12 for alias_brg_id, 62 for payload
219
305
  if input.startswith("p6 ") and len(input) == (3 + 12 + 62 + 2):
220
- # p6 1234567898761E16C6FC0000EE02093E3C71BF6DFA3C006648001CB8003A730160000E010031
306
+ # p6 301234567898761E16C6FC0000EE02093E3C71BF6DFA3C006648001CB8003A730160000E0100
221
307
  pkt = UplinkPkt(gw_id, seq_id, input.split()[1])
222
308
  mqttc.publish(custom_broker[CUSTOM_BROKER_DATA_TOPIC], payload=json.dumps(pkt.dump(), indent=4))
223
309
  return True
224
- # 3 for p7, 12 for alias_brg_id, 78 for payload, 6 for side info, 2 for rssi
310
+ # 3 for p7, 2 for rssi, 12 for alias_brg_id, 78 for payload, 6 for side info
225
311
  elif input.startswith("p7 ") and len(input) == (3 + 12 + 78 + 6 + 2):
226
- # p7 1234567898762616C6FC05000002093E3C71BF6DFA3C006648001CB8003A730160000E0100112233445566778831
312
+ # p7 301234567898762616C6FC05000002093E3C71BF6DFA3C006648001CB8003A730160000E01001122334455667788
227
313
  pkt = UplinkExtendedPkt(gw_id, seq_id, input.split()[1])
228
314
  mqttc.publish(custom_broker[CUSTOM_BROKER_DATA_TOPIC], payload=json.dumps(pkt.dump(), indent=4))
229
315
  return True
316
+ # 3 for p8, 2 for rssi, 12 for alias_brg_id, the rest for payload of multiple packets
317
+ elif input.startswith("p8 "):
318
+ # p8 301234567898762616C6FC05000002093E3C71BF6DFA3C006648001CB8003A730160000E01001122334455667788....
319
+ pkt = UplinkAggregatedPkt(gw_id, seq_id, input.split()[1])
320
+ mqttc.publish(custom_broker[CUSTOM_BROKER_DATA_TOPIC], payload=json.dumps(pkt.dump(), indent=4))
321
+ return True
230
322
  elif GW_STATUS_MESSAGES:
231
323
  pkt = GW_STATUS_MESSAGES.pop(0)
232
324
  mqttc.publish(custom_broker[CUSTOM_BROKER_STATUS_TOPIC], payload=json.dumps(pkt, indent=4))
233
325
  return False
234
326
 
235
- def gw_sim_run(port, gw_id, analyze_interference=False):
327
+ def handle_cmds(input, ble_serial):
328
+ if input.startswith(RX_NORDIC_RECOVER_RESET):
329
+ utPrint(f"Simulator received reboot packet", "CYAN")
330
+ global GW_SIM_RESET_TS
331
+ GW_SIM_RESET_TS = datetime.datetime.now()
332
+ write_to_ble(ble_serial, RESET_GW, sleep=0)
333
+ if input.startswith(RX_NORDIC_RECOVER_NORESET):
334
+ utPrint(f"COM tester recovered", "CYAN")
335
+ write_to_ble(ble_serial, f"{CONNECTIVITY_STATUS} 1 1")
336
+
337
+ def validate_port(port):
338
+ try:
339
+ with serial.serial_for_url(url=port, baudrate=921600, timeout=SERIAL_TIMEOUT,
340
+ write_timeout=SERIAL_TIMEOUT * 10) as ser:
341
+ ser.flushInput()
342
+ write_to_ble(ser, txt=VERSION, print_enable=True)
343
+ start_time = datetime.datetime.now()
344
+ while (datetime.datetime.now() - start_time).seconds < 2:
345
+ input = read_from_ble(ser)
346
+ if input is not None and GW_APP_VERSION_HEADER in input:
347
+ return True
348
+ return False
349
+ except Exception as e:
350
+ utPrint(f"Failed to open serial: {e}", "RED")
351
+ return False
236
352
 
237
- print(f"###>>> GW SIM STARTED WITH PORT {port}")
353
+
354
+ def gw_sim_run(port, gw_id, custom_broker, disable_interference_analyzer=False):
238
355
 
239
356
  # Init serial side
240
- print("\nAvailable ports:")
241
- for port, desc, hwid in sorted(serial.tools.list_ports.comports()):
242
- print("{}: {} [{}]".format(port, desc, hwid))
243
- ble_serial = serial.Serial(port=port, baudrate=921600, timeout=SERIAL_TIMEOUT)
357
+ if not port:
358
+ print("\nNo COM port given. Scanning for available ports:")
359
+ for port, desc, hwid in sorted(serial.tools.list_ports.comports()):
360
+ print("{}: {} [{}]".format(port, desc, hwid))
361
+ if validate_port(port):
362
+ utPrint(f"Found the tester's port ({port})", "GREEN")
363
+ break
364
+ if not port:
365
+ print("\nNo available COM port found! Please verify a tester is connected and set the correct --port parameter.")
366
+ sys.exit(-1)
367
+ print(f"###>>> GW SIM STARTED WITH PORT {port}")
368
+ ble_serial = serial.serial_for_url(url=port, baudrate=921600, timeout=SERIAL_TIMEOUT)
244
369
  ble_serial.flushInput()
245
370
 
246
371
  # Init mqtt side
247
- custom_broker = load_custom_broker(gw_id)
372
+ custom_broker = load_custom_broker(custom_broker, gw_id)
248
373
  client_id = '{}-republish2'.format(gw_id)
249
374
  userdata = {'serial': ble_serial}
250
375
  mqttc = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1, client_id, userdata=userdata)
@@ -266,15 +391,19 @@ def gw_sim_run(port, gw_id, analyze_interference=False):
266
391
  write_to_ble(ble_serial, RESET_GW, sleep=5)
267
392
  gw_app_res = gw_app_reponse(ble_serial)
268
393
  if gw_app_res[0] == TEST_FAILED:
269
- print("ERROR: didn't get version response!")
270
- return
394
+ utPrint("ERROR: didn't get version response! Please verify a tester is connected and set the correct --port parameter.", "RED")
395
+ sys.exit(1)
396
+ if gw_app_res[2] not in cert_utils.TESTER_FW_VERSIONS:
397
+ utPrint(f"ERROR: Tester FW version={gw_app_res[2]} instead of versions={cert_utils.TESTER_FW_VERSIONS}!\n"
398
+ f"Please run the command wlt-cert-tester-upgrade to upgrade the tester firmware!", "RED")
399
+ sys.exit(1)
271
400
  os.environ[GW_SIM_BLE_MAC_ADDRESS] = gw_app_res[1]
272
401
  os.environ[GW_APP_VERSION_HEADER] = gw_app_res[2]
273
402
  write_to_ble(ble_serial, STOP_ADVERTISING, sleep=2)
274
403
  write_to_ble(ble_serial, f"{CONNECTIVITY_STATUS} 1 1")
275
404
 
276
405
  # Run interference analysis
277
- if analyze_interference:
406
+ if not disable_interference_analyzer:
278
407
  print(color("BLUE", f"\nStarting interference analysis for channels {[ch[0] for ch in CHANNELS_TO_ANALYZE]}. This will take {30 * len(CHANNELS_TO_ANALYZE)} seconds (total)"))
279
408
  interference_analysis(ble_serial)
280
409
 
@@ -282,10 +411,11 @@ def gw_sim_run(port, gw_id, analyze_interference=False):
282
411
  seq_id = 100
283
412
  while True:
284
413
  input = read_from_ble(ble_serial)
285
- if input and input[0] == "p" and input[2] == " ":
414
+ if input and len(input) >= 3 and input[0] == "p" and input[2] == " ":
286
415
  seq_id += 1
287
416
  # input = ""
288
- if not parse_uart_pkts(input, mqttc, custom_broker, gw_id, seq_id):
417
+ if input and not parse_uart_pkts(input, mqttc, custom_broker, gw_id, seq_id):
418
+ handle_cmds(input, ble_serial)
289
419
  # if input:
290
420
  if 0:
291
421
  print(f"###>>> IGNORED: {input}")