wiliot-certificate 4.4.3__py3-none-any.whl → 4.5.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 (295) 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. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/brg2brg_ota.json +69 -0
  4. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/brg2gw_hb.json +109 -0
  5. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/brg2gw_hb_sleep.json +45 -0
  6. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/calibration.json +96 -0
  7. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/custom.json +99 -0
  8. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/datapath.json +241 -13
  9. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/energy2400.json +120 -0
  10. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/energySub1g.json +96 -0
  11. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/externalSensor.json +135 -6
  12. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/interface.json +157 -0
  13. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/powerManagement.json +205 -0
  14. brg_certificate/ag/wlt_types_ag_jsons/unified_echo_pkt.json → certificate/ag/wlt_types_ag_jsons/unified_echo_ext_pkt.json +27 -11
  15. certificate/ag/wlt_types_ag_jsons/unified_echo_pkt.json +175 -0
  16. certificate/ag/wlt_types_ag_jsons/unified_sensor_pkt.json +65 -0
  17. certificate/cert_common.py +1459 -0
  18. certificate/cert_config.py +455 -0
  19. {brg_certificate → certificate}/cert_data_sim.py +131 -46
  20. {brg_certificate → certificate}/cert_defines.py +120 -128
  21. {brg_certificate → certificate}/cert_gw_sim.py +151 -49
  22. {brg_certificate → certificate}/cert_mqtt.py +164 -59
  23. {brg_certificate → certificate}/cert_prints.py +34 -33
  24. {brg_certificate → certificate}/cert_protobuf.py +15 -6
  25. {brg_certificate → certificate}/cert_results.py +205 -48
  26. certificate/cert_utils.py +622 -0
  27. certificate/certificate.py +198 -0
  28. certificate/certificate_cli.py +79 -0
  29. certificate/certificate_eth_test_list.txt +74 -0
  30. certificate/certificate_sanity_test_list.txt +65 -0
  31. certificate/certificate_test_list.txt +75 -0
  32. {brg_certificate → certificate}/tests/calibration/interval_test/interval_test.json +2 -2
  33. {brg_certificate → certificate}/tests/calibration/interval_test/interval_test.py +7 -6
  34. certificate/tests/calibration/output_power_test/output_power_test.json +22 -0
  35. certificate/tests/calibration/output_power_test/output_power_test.py +39 -0
  36. {brg_certificate → certificate}/tests/calibration/pattern_test/pattern_test.json +1 -1
  37. {brg_certificate → certificate}/tests/calibration/pattern_test/pattern_test.py +20 -15
  38. certificate/tests/cloud_connectivity/acl_ext_adv_test/acl_ext_adv_test.json +14 -0
  39. certificate/tests/cloud_connectivity/acl_ext_adv_test/acl_ext_adv_test.py +140 -0
  40. certificate/tests/cloud_connectivity/acl_test/acl_test.json +14 -0
  41. certificate/tests/cloud_connectivity/acl_test/acl_test.py +98 -0
  42. certificate/tests/cloud_connectivity/brg_ota_test/brg_ota_test.json +18 -0
  43. certificate/tests/cloud_connectivity/brg_ota_test/brg_ota_test.py +39 -0
  44. certificate/tests/cloud_connectivity/channel_scan_behaviour_test/channel_scan_behaviour_test.json +18 -0
  45. certificate/tests/cloud_connectivity/channel_scan_behaviour_test/channel_scan_behaviour_test.py +215 -0
  46. certificate/tests/cloud_connectivity/connection_test/connection_test.json +17 -0
  47. certificate/tests/cloud_connectivity/connection_test/connection_test.py +74 -0
  48. certificate/tests/cloud_connectivity/downlink_test/downlink_test.json +20 -0
  49. certificate/tests/cloud_connectivity/downlink_test/downlink_test.py +204 -0
  50. certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.json +16 -0
  51. certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.py +98 -0
  52. certificate/tests/cloud_connectivity/reboot_test/reboot_test.json +17 -0
  53. certificate/tests/cloud_connectivity/reboot_test/reboot_test.py +57 -0
  54. certificate/tests/cloud_connectivity/registration_test/registration_test.json +19 -0
  55. certificate/tests/cloud_connectivity/registration_test/registration_test.py +384 -0
  56. certificate/tests/cloud_connectivity/registration_test/registration_test_cli.py +90 -0
  57. certificate/tests/cloud_connectivity/stress_test/stress_test.json +16 -0
  58. certificate/tests/cloud_connectivity/stress_test/stress_test.py +97 -0
  59. certificate/tests/cloud_connectivity/uplink_ext_adv_test/uplink_ext_adv_test.json +24 -0
  60. certificate/tests/cloud_connectivity/uplink_ext_adv_test/uplink_ext_adv_test.py +93 -0
  61. certificate/tests/cloud_connectivity/uplink_test/uplink_test.json +19 -0
  62. certificate/tests/cloud_connectivity/uplink_test/uplink_test.py +161 -0
  63. {brg_certificate → certificate}/tests/datapath/aging_test/aging_test.json +1 -1
  64. certificate/tests/datapath/aging_test/aging_test.py +138 -0
  65. certificate/tests/datapath/event_ble5_test/event_ble5_test.json +16 -0
  66. certificate/tests/datapath/event_ble5_test/event_ble5_test.py +95 -0
  67. certificate/tests/datapath/event_test/event_test.json +16 -0
  68. certificate/tests/datapath/event_test/event_test.py +85 -0
  69. {brg_certificate → certificate}/tests/datapath/num_of_tags_test/num_of_tags_test.json +1 -1
  70. {brg_certificate → certificate}/tests/datapath/num_of_tags_test/num_of_tags_test.py +10 -8
  71. certificate/tests/datapath/output_power_test/output_power_test.json +22 -0
  72. {brg_certificate → certificate}/tests/datapath/output_power_test/output_power_test.py +17 -6
  73. {brg_certificate → certificate}/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.json +1 -1
  74. {brg_certificate → certificate}/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +10 -8
  75. {brg_certificate → certificate}/tests/datapath/pacer_interval_test/pacer_interval_test.json +1 -1
  76. {brg_certificate → certificate}/tests/datapath/pacer_interval_test/pacer_interval_test.py +9 -7
  77. {brg_certificate → certificate}/tests/datapath/pattern_test/pattern_test.json +2 -2
  78. {brg_certificate → certificate}/tests/datapath/pattern_test/pattern_test.py +18 -6
  79. certificate/tests/datapath/pkt_filter_ble5_chl21_test/pkt_filter_ble5_chl21_test.json +19 -0
  80. certificate/tests/datapath/pkt_filter_ble5_chl21_test/pkt_filter_ble5_chl21_test.py +61 -0
  81. {brg_certificate → certificate}/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.json +1 -1
  82. {brg_certificate → certificate}/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +11 -10
  83. certificate/tests/datapath/pkt_filter_brg2gw_ext_adv_test/pkt_filter_brg2gw_ext_adv_test.json +18 -0
  84. certificate/tests/datapath/pkt_filter_brg2gw_ext_adv_test/pkt_filter_brg2gw_ext_adv_test.py +83 -0
  85. {brg_certificate → certificate}/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.json +1 -1
  86. {brg_certificate → certificate}/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.py +10 -9
  87. {brg_certificate → certificate}/tests/datapath/pkt_filter_test/pkt_filter_test.json +1 -1
  88. {brg_certificate → certificate}/tests/datapath/pkt_filter_test/pkt_filter_test.py +10 -9
  89. {brg_certificate → certificate}/tests/datapath/rssi_threshold_test/rssi_threshold_test.json +1 -1
  90. {brg_certificate → certificate}/tests/datapath/rssi_threshold_test/rssi_threshold_test.py +9 -8
  91. brg_certificate/tests/datapath/output_power_test/output_power_test.json → certificate/tests/datapath/rx_channel_hopping_test/rx_channel_hopping_test.json +5 -4
  92. certificate/tests/datapath/rx_channel_hopping_test/rx_channel_hopping_test.py +77 -0
  93. {brg_certificate → certificate}/tests/datapath/rx_channel_test/rx_channel_test.json +2 -2
  94. {brg_certificate → certificate}/tests/datapath/rx_channel_test/rx_channel_test.py +7 -6
  95. {brg_certificate → certificate}/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.json +7 -7
  96. {brg_certificate → certificate}/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +112 -72
  97. {brg_certificate → certificate}/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.json +7 -7
  98. {brg_certificate → certificate}/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.py +112 -72
  99. {brg_certificate → certificate}/tests/datapath/stress_gen3_test/stress_gen3_test.json +3 -3
  100. {brg_certificate → certificate}/tests/datapath/stress_gen3_test/stress_gen3_test.py +12 -11
  101. {brg_certificate → certificate}/tests/datapath/stress_test/stress_test.json +3 -3
  102. {brg_certificate → certificate}/tests/datapath/stress_test/stress_test.py +12 -11
  103. {brg_certificate → certificate}/tests/datapath/tx_repetition_test/tx_repetition_test.json +2 -1
  104. {brg_certificate → certificate}/tests/datapath/tx_repetition_test/tx_repetition_test.py +14 -13
  105. certificate/tests/edge_mgmt/action_blink_test/action_blink_test.json +14 -0
  106. certificate/tests/edge_mgmt/action_blink_test/action_blink_test.py +24 -0
  107. certificate/tests/edge_mgmt/action_get_battery_sensor_test/action_get_battery_sensor_test.json +14 -0
  108. certificate/tests/edge_mgmt/action_get_battery_sensor_test/action_get_battery_sensor_test.py +43 -0
  109. certificate/tests/edge_mgmt/action_get_module_test/action_get_module_test.json +14 -0
  110. certificate/tests/edge_mgmt/action_get_module_test/action_get_module_test.py +42 -0
  111. certificate/tests/edge_mgmt/action_get_pof_data_test/action_get_pof_data_test.json +14 -0
  112. certificate/tests/edge_mgmt/action_get_pof_data_test/action_get_pof_data_test.py +44 -0
  113. certificate/tests/edge_mgmt/action_gw_hb_test/action_gw_hb_test.json +15 -0
  114. certificate/tests/edge_mgmt/action_gw_hb_test/action_gw_hb_test.py +42 -0
  115. certificate/tests/edge_mgmt/action_reboot_test/action_reboot_test.json +14 -0
  116. certificate/tests/edge_mgmt/action_reboot_test/action_reboot_test.py +49 -0
  117. certificate/tests/edge_mgmt/action_restore_defaults_test/action_restore_defaults_test.json +14 -0
  118. certificate/tests/edge_mgmt/action_restore_defaults_test/action_restore_defaults_test.py +102 -0
  119. certificate/tests/edge_mgmt/action_send_hb_test/action_send_hb_test.json +14 -0
  120. certificate/tests/edge_mgmt/action_send_hb_test/action_send_hb_test.py +41 -0
  121. {brg_certificate → certificate}/tests/edge_mgmt/periodic_msgs_test/periodic_msgs_test.json +2 -2
  122. {brg_certificate → certificate}/tests/edge_mgmt/periodic_msgs_test/periodic_msgs_test.py +22 -11
  123. {brg_certificate → certificate}/tests/energy2400/duty_cycle_test/duty_cycle_test.json +1 -1
  124. {brg_certificate → certificate}/tests/energy2400/duty_cycle_test/duty_cycle_test.py +7 -6
  125. certificate/tests/energy2400/output_power_test/output_power_test.json +22 -0
  126. {brg_certificate → certificate}/tests/energy2400/output_power_test/output_power_test.py +17 -6
  127. {brg_certificate → certificate}/tests/energy2400/pattern_test/pattern_test.json +1 -1
  128. {brg_certificate → certificate}/tests/energy2400/pattern_test/pattern_test.py +7 -6
  129. certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.json +25 -0
  130. certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.py +378 -0
  131. brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.json → certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.json +3 -3
  132. brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.py → certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.py +97 -87
  133. certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +23 -0
  134. certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +350 -0
  135. {brg_certificate → certificate}/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.json +1 -1
  136. {brg_certificate → certificate}/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.py +7 -6
  137. {brg_certificate → certificate}/tests/energy_sub1g/pattern_test/pattern_test.json +1 -1
  138. {brg_certificate → certificate}/tests/energy_sub1g/pattern_test/pattern_test.py +7 -6
  139. {brg_certificate → certificate}/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.json +1 -1
  140. {brg_certificate → certificate}/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.py +10 -10
  141. {brg_certificate → certificate}/tests/sensors/ext_sensor_test/ext_sensor_test.json +4 -4
  142. certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +455 -0
  143. certificate/wlt_types.py +122 -0
  144. {gw_certificate → common}/api_if/202/status.json +6 -0
  145. {gw_certificate → common}/api_if/203/status.json +6 -0
  146. {gw_certificate → common}/api_if/204/status.json +6 -0
  147. common/api_if/206/data.json +85 -0
  148. common/api_if/206/status.json +69 -0
  149. common/api_if/api_validation.py +85 -0
  150. common/web/templates/generator.html +148 -0
  151. common/web/templates/index.html +20 -0
  152. common/web/templates/menu.html +54 -0
  153. common/web/templates/parser.html +53 -0
  154. {brg_certificate/ag → common/web/templates}/wlt_types.html +1216 -191
  155. common/web/web_utils.py +377 -0
  156. {brg_certificate → common}/wltPb_pb2.py +14 -12
  157. {gw_certificate/common → common}/wltPb_pb2.pyi +16 -2
  158. gui_certificate/gui_certificate_cli.py +14 -0
  159. gui_certificate/server.py +1062 -0
  160. gui_certificate/templates/cert_run.html +1207 -0
  161. wiliot_certificate-4.5.0a1.dist-info/METADATA +110 -0
  162. wiliot_certificate-4.5.0a1.dist-info/RECORD +182 -0
  163. {wiliot_certificate-4.4.3.dist-info → wiliot_certificate-4.5.0a1.dist-info}/WHEEL +1 -1
  164. wiliot_certificate-4.5.0a1.dist-info/entry_points.txt +5 -0
  165. wiliot_certificate-4.5.0a1.dist-info/top_level.txt +3 -0
  166. brg_certificate/ag/energous_v0_defines.py +0 -925
  167. brg_certificate/ag/energous_v1_defines.py +0 -931
  168. brg_certificate/ag/energous_v2_defines.py +0 -925
  169. brg_certificate/ag/energous_v3_defines.py +0 -925
  170. brg_certificate/ag/energous_v4_defines.py +0 -925
  171. brg_certificate/ag/fanstel_lan_v0_defines.py +0 -925
  172. brg_certificate/ag/fanstel_lte_v0_defines.py +0 -925
  173. brg_certificate/ag/fanstel_wifi_v0_defines.py +0 -925
  174. brg_certificate/ag/minew_lte_v0_defines.py +0 -925
  175. brg_certificate/ag/wlt_types_ag_jsons/unified_echo_ext_pkt.json +0 -61
  176. brg_certificate/brg_certificate.py +0 -225
  177. brg_certificate/brg_certificate_cli.py +0 -63
  178. brg_certificate/cert_common.py +0 -923
  179. brg_certificate/cert_config.py +0 -402
  180. brg_certificate/cert_utils.py +0 -362
  181. brg_certificate/certificate_bcc_sanity_test_list.txt +0 -40
  182. brg_certificate/certificate_bcc_test_list.txt +0 -48
  183. brg_certificate/certificate_sanity_test_list.txt +0 -43
  184. brg_certificate/certificate_test_list.txt +0 -53
  185. brg_certificate/config/eclipse.json +0 -10
  186. brg_certificate/config/hivemq.json +0 -10
  187. brg_certificate/config/mosquitto.json +0 -10
  188. brg_certificate/config/mosquitto.md +0 -95
  189. brg_certificate/config/wiliot-dev.json +0 -10
  190. brg_certificate/restore_brg.py +0 -61
  191. brg_certificate/tests/calibration/output_power_test/output_power_test.json +0 -16
  192. brg_certificate/tests/calibration/output_power_test/output_power_test.py +0 -28
  193. brg_certificate/tests/datapath/aging_test/aging_test.py +0 -143
  194. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.json +0 -16
  195. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.py +0 -73
  196. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.json +0 -17
  197. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.py +0 -118
  198. brg_certificate/tests/edge_mgmt/actions_test/actions_test.json +0 -14
  199. brg_certificate/tests/edge_mgmt/actions_test/actions_test.py +0 -396
  200. brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.json +0 -20
  201. brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.py +0 -94
  202. brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.json +0 -19
  203. brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.py +0 -87
  204. brg_certificate/tests/edge_mgmt/leds_test/leds_test.json +0 -17
  205. brg_certificate/tests/edge_mgmt/leds_test/leds_test.py +0 -223
  206. brg_certificate/tests/edge_mgmt/ota_test/ota_test.json +0 -17
  207. brg_certificate/tests/edge_mgmt/ota_test/ota_test.py +0 -128
  208. brg_certificate/tests/energy2400/output_power_test/output_power_test.json +0 -16
  209. brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.json +0 -20
  210. brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.py +0 -321
  211. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.json +0 -20
  212. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.py +0 -141
  213. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +0 -20
  214. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +0 -276
  215. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.json +0 -20
  216. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.py +0 -390
  217. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.json +0 -16
  218. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.py +0 -28
  219. brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +0 -305
  220. brg_certificate/wltPb_pb2.pyi +0 -234
  221. brg_certificate/wlt_types.py +0 -113
  222. gw_certificate/ag/ut_defines.py +0 -364
  223. gw_certificate/ag/wlt_types.py +0 -85
  224. gw_certificate/ag/wlt_types_ag.py +0 -5310
  225. gw_certificate/ag/wlt_types_data.py +0 -64
  226. gw_certificate/api/extended_api.py +0 -23
  227. gw_certificate/api_if/200/data.json +0 -106
  228. gw_certificate/api_if/200/status.json +0 -47
  229. gw_certificate/api_if/201/data.json +0 -98
  230. gw_certificate/api_if/201/status.json +0 -53
  231. gw_certificate/api_if/205/logs.json +0 -12
  232. gw_certificate/api_if/api_validation.py +0 -38
  233. gw_certificate/api_if/gw_capabilities.py +0 -54
  234. gw_certificate/cert_results.py +0 -145
  235. gw_certificate/common/analysis_data_bricks.py +0 -60
  236. gw_certificate/common/debug.py +0 -42
  237. gw_certificate/common/serialization_formatter.py +0 -93
  238. gw_certificate/common/utils.py +0 -8
  239. gw_certificate/common/utils_defines.py +0 -15
  240. gw_certificate/common/wltPb_pb2.py +0 -84
  241. gw_certificate/gw_certificate.py +0 -154
  242. gw_certificate/gw_certificate_cli.py +0 -87
  243. gw_certificate/interface/4.4.93_app.zip +0 -0
  244. gw_certificate/interface/4.4.93_sd_bl_app.zip +0 -0
  245. gw_certificate/interface/ble_simulator.py +0 -61
  246. gw_certificate/interface/ble_sniffer.py +0 -189
  247. gw_certificate/interface/flash_fw.py +0 -90
  248. gw_certificate/interface/if_defines.py +0 -36
  249. gw_certificate/interface/mqtt.py +0 -563
  250. gw_certificate/interface/nrfutil-linux +0 -0
  251. gw_certificate/interface/nrfutil-mac +0 -0
  252. gw_certificate/interface/nrfutil.exe +0 -0
  253. gw_certificate/interface/pkt_generator.py +0 -594
  254. gw_certificate/interface/uart_if.py +0 -236
  255. gw_certificate/interface/uart_ports.py +0 -20
  256. gw_certificate/templates/results.html +0 -241
  257. gw_certificate/templates/stage.html +0 -22
  258. gw_certificate/templates/table.html +0 -6
  259. gw_certificate/templates/test.html +0 -38
  260. gw_certificate/tests/__init__.py +0 -10
  261. gw_certificate/tests/actions.py +0 -289
  262. gw_certificate/tests/bad_crc_to_PER_quantization.csv +0 -51
  263. gw_certificate/tests/connection.py +0 -188
  264. gw_certificate/tests/downlink.py +0 -172
  265. gw_certificate/tests/generic.py +0 -238
  266. gw_certificate/tests/registration.py +0 -340
  267. gw_certificate/tests/static/__init__.py +0 -0
  268. gw_certificate/tests/static/connection_defines.py +0 -9
  269. gw_certificate/tests/static/downlink_defines.py +0 -9
  270. gw_certificate/tests/static/generated_packet_table.py +0 -195
  271. gw_certificate/tests/static/packet_table.csv +0 -10067
  272. gw_certificate/tests/static/references.py +0 -5
  273. gw_certificate/tests/static/uplink_defines.py +0 -14
  274. gw_certificate/tests/throughput.py +0 -240
  275. gw_certificate/tests/uplink.py +0 -853
  276. wiliot_certificate-4.4.3.dist-info/METADATA +0 -211
  277. wiliot_certificate-4.4.3.dist-info/RECORD +0 -210
  278. wiliot_certificate-4.4.3.dist-info/entry_points.txt +0 -3
  279. wiliot_certificate-4.4.3.dist-info/top_level.txt +0 -3
  280. {brg_certificate → certificate}/__init__.py +0 -0
  281. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/side_info_sensor.json +0 -0
  282. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/signal_indicator_data.json +0 -0
  283. {gw_certificate → common}/api_if/202/data.json +0 -0
  284. {gw_certificate/api_if/200 → common/api_if/202}/logs.json +0 -0
  285. {gw_certificate → common}/api_if/203/data.json +0 -0
  286. {gw_certificate/api_if/201 → common/api_if/203}/logs.json +0 -0
  287. {gw_certificate → common}/api_if/204/data.json +0 -0
  288. {gw_certificate/api_if/202 → common/api_if/204}/logs.json +0 -0
  289. {gw_certificate → common}/api_if/205/data.json +0 -0
  290. {gw_certificate/api_if/203 → common/api_if/205}/logs.json +0 -0
  291. {gw_certificate → common}/api_if/205/status.json +0 -0
  292. {gw_certificate/api_if/204 → common/api_if/206}/logs.json +0 -0
  293. {gw_certificate → common/api_if}/__init__.py +0 -0
  294. {gw_certificate/api_if → gui_certificate}/__init__.py +0 -0
  295. {wiliot_certificate-4.4.3.dist-info → wiliot_certificate-4.5.0a1.dist-info}/licenses/LICENSE +0 -0
@@ -1,931 +0,0 @@
1
- # This is an auto generated file! Don't edit this file manually!!!
2
-
3
- import bitstruct
4
- import binascii
5
- import tabulate
6
- from brg_certificate.ag.wlt_types_ag import API_VERSION_V0, API_VERSION_V1, API_VERSION_V2, API_VERSION_V5, API_VERSION_V6, API_VERSION_V7, API_VERSION_V8, API_VERSION_V9, API_VERSION_V10, API_VERSION_V11, API_VERSION_V12, API_VERSION_LATEST, MODULE_EMPTY, MODULE_GLOBAL, MODULE_IF, MODULE_DATAPATH, MODULE_ENERGY_2400, MODULE_ENERGY_SUB1G, MODULE_CALIBRATION, MODULE_PWR_MGMT, MODULE_EXT_SENSORS, MODULE_CUSTOM, SUB1G_ENERGY_PATTERN_NO_ENERGIZING, SUB1G_ENERGY_PATTERN_SINGLE_TONE_915000, SUB1G_ENERGY_PATTERN_FCC_HOPPING, SUB1G_ENERGY_PATTERN_JAPAN_1W, SUB1G_ENERGY_PATTERN_JAPAN_350MW, SUB1G_ENERGY_PATTERN_KOREA, SUB1G_ENERGY_PATTERN_SINGLE_TONE_916300, SUB1G_ENERGY_PATTERN_SINGLE_TONE_917500, SUB1G_ENERGY_PATTERN_AUSTRALIA, SUB1G_ENERGY_PATTERN_ISRAEL, SUB1G_ENERGY_PATTERN_NZ_HOPPING, SUB1G_ENERGY_PATTERN_LAST, CHANNEL_FREQ_37, CHANNEL_FREQ_38, CHANNEL_FREQ_39, CHANNEL_37, CHANNEL_38, CHANNEL_39, OUTPUT_POWER_2_4_NEG_12, OUTPUT_POWER_2_4_NEG_8, OUTPUT_POWER_2_4_NEG_4, OUTPUT_POWER_2_4_POS_0, OUTPUT_POWER_2_4_POS_2, OUTPUT_POWER_2_4_POS_3, OUTPUT_POWER_2_4_POS_4, OUTPUT_POWER_2_4_POS_5, OUTPUT_POWER_2_4_POS_6, OUTPUT_POWER_2_4_POS_7, OUTPUT_POWER_2_4_POS_8, RX_CHANNEL_37, RX_CHANNEL_38, RX_CHANNEL_39, RX_CHANNEL_10_250K, RX_CHANNEL_10_500K, RX_CHANNEL_V11_37, RX_CHANNEL_V11_38, RX_CHANNEL_V11_39, RX_CHANNEL_V11_4_1MBPS, RX_CHANNEL_V11_10_1MBPS, RX_CHANNEL_V11_4_2MBPS, RX_CHANNEL_V11_10_2MBPS, SECONDARY_RX_CHANNEL_10, SUB1G_OUTPUT_POWER_11, SUB1G_OUTPUT_POWER_14, SUB1G_OUTPUT_POWER_17, SUB1G_OUTPUT_POWER_19, SUB1G_OUTPUT_POWER_20, SUB1G_OUTPUT_POWER_23, SUB1G_OUTPUT_POWER_25, SUB1G_OUTPUT_POWER_26, SUB1G_OUTPUT_POWER_27, SUB1G_OUTPUT_POWER_29, SUB1G_OUTPUT_POWER_32, SUB1G_OUTPUT_POWER_PROFILE_14, SUB1G_OUTPUT_POWER_PROFILE_17, SUB1G_OUTPUT_POWER_PROFILE_20, SUB1G_OUTPUT_POWER_PROFILE_23, SUB1G_OUTPUT_POWER_PROFILE_26, SUB1G_OUTPUT_POWER_PROFILE_29, SUB1G_OUTPUT_POWER_PROFILE_32, SIGNAL_INDICATOR_REP_1, SIGNAL_INDICATOR_REP_2, SIGNAL_INDICATOR_REP_3, SIGNAL_INDICATOR_REP_4, SIGNAL_INDICATOR_SUB1G_REP_1, SIGNAL_INDICATOR_SUB1G_REP_2, SIGNAL_INDICATOR_SUB1G_REP_3, SIGNAL_INDICATOR_SUB1G_REP_4, SIGNAL_INDICATOR_REP_PROFILE_1, SIGNAL_INDICATOR_REP_PROFILE_2, SIGNAL_INDICATOR_REP_PROFILE_3, SIGNAL_INDICATOR_REP_PROFILE_4, SIGNAL_INDICATOR_SUB1G_REP_PROFILE_1, SIGNAL_INDICATOR_SUB1G_REP_PROFILE_2, SIGNAL_INDICATOR_SUB1G_REP_PROFILE_3, SIGNAL_INDICATOR_SUB1G_REP_PROFILE_4, BRG_DEFAULT_CALIBRATION_INTERVAL, BRG_DEFAULT_CALIBRATION_OUTPUT_POWER, BRG_DEFAULT_CALIBRATION_PATTERN, BRG_DEFAULT_DATAPATH_PATTERN, BRG_DEFAULT_PKT_FILTER, BRG_DEFAULT_RX_CHANNEL_OR_FREQ, BRG_DEFAULT_DATAPATH_OUTPUT_POWER, BRG_DEFAULT_TX_REPETITION, BRG_DEFAULT_PACER_INTERVAL, BRG_DEFAULT_RSSI_THRESHOLD, BRG_DEFAULT_RX_CHANNEL, BRG_DEFAULT_ENERGY_PATTERN_2_4, BRG_DEFAULT_ENERGY_DUTY_CYCLE_2_4, BRG_DEFAULT_OUTPUT_POWER_2_4, BRG_DEFAULT_SIGNAL_INDICATOR_REP, BRG_DEFAULT_SIGNAL_INDICATOR_REP_PROFILE, BRG_DEFAULT_SIGNAL_INDICATOR_CYCLE, BRG_DEFAULT_SUB1G_DUTY_CYCLE, BRG_DEFAULT_OUTPUT_POWER_SUB1G, BRG_DEFAULT_OUTPUT_POWER_SUB1G_PROFILE, BRG_DEFAULT_SUB1G_ENERGY_PATTERN, BRG_DEFAULT_SIGNAL_INDICATOR_SUB1G_REP, BRG_DEFAULT_SIGNAL_INDICATOR_SUB1G_REP_PROFILE, BRG_DEFAULT_SIGNAL_INDICATOR_SUB1G_CYCLE, BRG_DEFAULT_EXTERNAL_SENSOR_CFG, BRG_DEFAULT_TX_PERIOD, BRG_DEFAULT_TRANSMIT_TIME_SUB1G, BRG_DEFAULT_SUB1G_FREQ, BRG_DEFAULT_SUB1G_FREQ_PROFILE, BRG_DEFAULT_ENERGY_PATTERN_IDX_OLD, BRG_DEFAULT_RXTX_PERIOD, BRG_DEFAULT_PKT_TYPES_MASK, BRG_MGMT_MSG_TYPE_CFG_INFO, BRG_MGMT_MSG_TYPE_OTA_UPDATE, BRG_MGMT_MSG_TYPE_HB, BRG_MGMT_MSG_TYPE_REBOOT, BRG_MGMT_MSG_TYPE_CFG_SET, BRG_MGMT_MSG_TYPE_ACTION, BRG_MGMT_MSG_TYPE_BRG2BRG, BRG_MGMT_MSG_TYPE_HB_SLEEP, PWR_MGMT_DEFAULTS_LEDS_ON, PWR_MGMT_DEFAULTS_KEEP_ALIVE_PERIOD, PWR_MGMT_DEFAULTS_KEEP_ALIVE_SCAN, PWR_MGMT_DEFAULTS_ON_DURATION, PWR_MGMT_DEFAULTS_SLEEP_DURATION, LIS2DW12_DEFAULTS_PACKET_VERSION, LIS2DW12_DEFAULTS_MOTION_SENSITIVITY_THRESHOLD, LIS2DW12_DEFAULTS_S2D_TRANSITION_TIME, LIS2DW12_DEFAULTS_D2S_TRANSITION_TIME
7
-
8
- # Board Overwritten defines
9
- BRG_DEFAULT_CALIBRATION_OUTPUT_POWER = OUTPUT_POWER_2_4_POS_3
10
- BRG_DEFAULT_DATAPATH_OUTPUT_POWER = OUTPUT_POWER_2_4_POS_3
11
- BRG_DEFAULT_OUTPUT_POWER_2_4 = OUTPUT_POWER_2_4_POS_6
12
- BRG_DEFAULT_SUB1G_DUTY_CYCLE = 40
13
- BRG_DEFAULT_OUTPUT_POWER_SUB1G = 29
14
- BRG_DEFAULT_OUTPUT_POWER_SUB1G_PROFILE = 5
15
- BRG_DEFAULT_TX_PERIOD = 40
16
- BRG_DEFAULT_ENERGY_PATTERN_IDX_OLD = 71
17
- BRG_DEFAULT_RXTX_PERIOD = 100
18
-
19
- class ModuleIfV12():
20
- def __init__(self, raw='', module_type=MODULE_IF, msg_type=BRG_MGMT_MSG_TYPE_CFG_INFO, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, board_type=0, bl_version=0, major_ver=0, minor_ver=0, patch_ver=0, sup_cap_glob=0, sup_cap_datapath=0, sup_cap_energy2400=0, sup_cap_energy_sub1g=0, sup_cap_calibration=0, sup_cap_pwr_mgmt=0, sup_cap_sensors=0, sup_cap_custom=0, cfg_hash=0, unused0=0):
21
- self.module_type = module_type
22
- self.msg_type = msg_type
23
- self.api_version = api_version
24
- self.seq_id = seq_id
25
- self.brg_mac = brg_mac
26
- self.board_type = board_type
27
- self.bl_version = bl_version
28
- self.major_ver = major_ver
29
- self.minor_ver = minor_ver
30
- self.patch_ver = patch_ver
31
- self.sup_cap_glob = sup_cap_glob
32
- self.sup_cap_datapath = sup_cap_datapath
33
- self.sup_cap_energy2400 = sup_cap_energy2400
34
- self.sup_cap_energy_sub1g = sup_cap_energy_sub1g
35
- self.sup_cap_calibration = sup_cap_calibration
36
- self.sup_cap_pwr_mgmt = sup_cap_pwr_mgmt
37
- self.sup_cap_sensors = sup_cap_sensors
38
- self.sup_cap_custom = sup_cap_custom
39
- self.cfg_hash = cfg_hash
40
- self.unused0 = unused0
41
- if raw:
42
- self.set(raw)
43
-
44
- def __repr__(self) -> str:
45
- return "\n==> Packet module_if_v12 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X}", self.module_type],['msg_type', f"0x{self.msg_type:X}", self.msg_type],['api_version', f"0x{self.api_version:X}", self.api_version],['seq_id', f"0x{self.seq_id:X}", self.seq_id],['brg_mac', f"0x{self.brg_mac:X}", self.brg_mac],['board_type', f"0x{self.board_type:X}", self.board_type],['bl_version', f"0x{self.bl_version:X}", self.bl_version],['major_ver', f"0x{self.major_ver:X}", self.major_ver],['minor_ver', f"0x{self.minor_ver:X}", self.minor_ver],['patch_ver', f"0x{self.patch_ver:X}", self.patch_ver],['sup_cap_glob', f"0x{self.sup_cap_glob:X}", self.sup_cap_glob],['sup_cap_datapath', f"0x{self.sup_cap_datapath:X}", self.sup_cap_datapath],['sup_cap_energy2400', f"0x{self.sup_cap_energy2400:X}", self.sup_cap_energy2400],['sup_cap_energy_sub1g', f"0x{self.sup_cap_energy_sub1g:X}", self.sup_cap_energy_sub1g],['sup_cap_calibration', f"0x{self.sup_cap_calibration:X}", self.sup_cap_calibration],['sup_cap_pwr_mgmt', f"0x{self.sup_cap_pwr_mgmt:X}", self.sup_cap_pwr_mgmt],['sup_cap_sensors', f"0x{self.sup_cap_sensors:X}", self.sup_cap_sensors],['sup_cap_custom', f"0x{self.sup_cap_custom:X}", self.sup_cap_custom],['cfg_hash', f"0x{self.cfg_hash:X}", self.cfg_hash]], tablefmt="texttable")
46
-
47
- def __eq__(self, other):
48
- if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
49
- return (
50
- self.module_type == other.module_type and
51
- self.msg_type == other.msg_type and
52
- self.api_version == other.api_version and
53
- self.brg_mac == other.brg_mac and
54
- self.board_type == other.board_type and
55
- self.bl_version == other.bl_version and
56
- self.major_ver == other.major_ver and
57
- self.minor_ver == other.minor_ver and
58
- self.patch_ver == other.patch_ver and
59
- self.sup_cap_glob == other.sup_cap_glob and
60
- self.sup_cap_datapath == other.sup_cap_datapath and
61
- self.sup_cap_energy2400 == other.sup_cap_energy2400 and
62
- self.sup_cap_energy_sub1g == other.sup_cap_energy_sub1g and
63
- self.sup_cap_calibration == other.sup_cap_calibration and
64
- self.sup_cap_pwr_mgmt == other.sup_cap_pwr_mgmt and
65
- self.sup_cap_sensors == other.sup_cap_sensors and
66
- self.sup_cap_custom == other.sup_cap_custom and
67
- self.cfg_hash == other.cfg_hash
68
- )
69
- return False
70
-
71
- def dump(self):
72
- string = bitstruct.pack("u4u4u8u8u48u8u8u8u8u8u1u1u1u1u1u1u1u1u32u40", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.board_type, self.bl_version, self.major_ver, self.minor_ver, self.patch_ver, self.sup_cap_glob, self.sup_cap_datapath, self.sup_cap_energy2400, self.sup_cap_energy_sub1g, self.sup_cap_calibration, self.sup_cap_pwr_mgmt, self.sup_cap_sensors, self.sup_cap_custom, self.cfg_hash, self.unused0)
73
- return string.hex().upper()
74
-
75
- def set(self, string):
76
- d = bitstruct.unpack("u4u4u8u8u48u8u8u8u8u8u1u1u1u1u1u1u1u1u32u40", binascii.unhexlify(string))
77
- self.module_type = d[0]
78
- self.msg_type = d[1]
79
- self.api_version = d[2]
80
- self.seq_id = d[3]
81
- self.brg_mac = d[4]
82
- self.board_type = d[5]
83
- self.bl_version = d[6]
84
- self.major_ver = d[7]
85
- self.minor_ver = d[8]
86
- self.patch_ver = d[9]
87
- self.sup_cap_glob = d[10]
88
- self.sup_cap_datapath = d[11]
89
- self.sup_cap_energy2400 = d[12]
90
- self.sup_cap_energy_sub1g = d[13]
91
- self.sup_cap_calibration = d[14]
92
- self.sup_cap_pwr_mgmt = d[15]
93
- self.sup_cap_sensors = d[16]
94
- self.sup_cap_custom = d[17]
95
- self.cfg_hash = d[18]
96
- self.unused0 = d[19]
97
-
98
- class ModuleIfV11():
99
- def __init__(self, raw='', module_type=MODULE_IF, msg_type=BRG_MGMT_MSG_TYPE_CFG_INFO, api_version=API_VERSION_V11, seq_id=0, brg_mac=0, board_type=0, bl_version=0, major_ver=0, minor_ver=0, patch_ver=0, sup_cap_glob=0, sup_cap_datapath=0, sup_cap_energy2400=0, sup_cap_energy_sub1g=0, sup_cap_calibration=0, sup_cap_pwr_mgmt=0, sup_cap_sensors=0, sup_cap_custom=0, cfg_hash=0, unused0=0):
100
- self.module_type = module_type
101
- self.msg_type = msg_type
102
- self.api_version = api_version
103
- self.seq_id = seq_id
104
- self.brg_mac = brg_mac
105
- self.board_type = board_type
106
- self.bl_version = bl_version
107
- self.major_ver = major_ver
108
- self.minor_ver = minor_ver
109
- self.patch_ver = patch_ver
110
- self.sup_cap_glob = sup_cap_glob
111
- self.sup_cap_datapath = sup_cap_datapath
112
- self.sup_cap_energy2400 = sup_cap_energy2400
113
- self.sup_cap_energy_sub1g = sup_cap_energy_sub1g
114
- self.sup_cap_calibration = sup_cap_calibration
115
- self.sup_cap_pwr_mgmt = sup_cap_pwr_mgmt
116
- self.sup_cap_sensors = sup_cap_sensors
117
- self.sup_cap_custom = sup_cap_custom
118
- self.cfg_hash = cfg_hash
119
- self.unused0 = unused0
120
- if raw:
121
- self.set(raw)
122
-
123
- def __repr__(self) -> str:
124
- return "\n==> Packet module_if_v11 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X}", self.module_type],['msg_type', f"0x{self.msg_type:X}", self.msg_type],['api_version', f"0x{self.api_version:X}", self.api_version],['seq_id', f"0x{self.seq_id:X}", self.seq_id],['brg_mac', f"0x{self.brg_mac:X}", self.brg_mac],['board_type', f"0x{self.board_type:X}", self.board_type],['bl_version', f"0x{self.bl_version:X}", self.bl_version],['major_ver', f"0x{self.major_ver:X}", self.major_ver],['minor_ver', f"0x{self.minor_ver:X}", self.minor_ver],['patch_ver', f"0x{self.patch_ver:X}", self.patch_ver],['sup_cap_glob', f"0x{self.sup_cap_glob:X}", self.sup_cap_glob],['sup_cap_datapath', f"0x{self.sup_cap_datapath:X}", self.sup_cap_datapath],['sup_cap_energy2400', f"0x{self.sup_cap_energy2400:X}", self.sup_cap_energy2400],['sup_cap_energy_sub1g', f"0x{self.sup_cap_energy_sub1g:X}", self.sup_cap_energy_sub1g],['sup_cap_calibration', f"0x{self.sup_cap_calibration:X}", self.sup_cap_calibration],['sup_cap_pwr_mgmt', f"0x{self.sup_cap_pwr_mgmt:X}", self.sup_cap_pwr_mgmt],['sup_cap_sensors', f"0x{self.sup_cap_sensors:X}", self.sup_cap_sensors],['sup_cap_custom', f"0x{self.sup_cap_custom:X}", self.sup_cap_custom],['cfg_hash', f"0x{self.cfg_hash:X}", self.cfg_hash]], tablefmt="texttable")
125
-
126
- def __eq__(self, other):
127
- if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
128
- return (
129
- self.module_type == other.module_type and
130
- self.msg_type == other.msg_type and
131
- self.api_version == other.api_version and
132
- self.brg_mac == other.brg_mac and
133
- self.board_type == other.board_type and
134
- self.bl_version == other.bl_version and
135
- self.major_ver == other.major_ver and
136
- self.minor_ver == other.minor_ver and
137
- self.patch_ver == other.patch_ver and
138
- self.sup_cap_glob == other.sup_cap_glob and
139
- self.sup_cap_datapath == other.sup_cap_datapath and
140
- self.sup_cap_energy2400 == other.sup_cap_energy2400 and
141
- self.sup_cap_energy_sub1g == other.sup_cap_energy_sub1g and
142
- self.sup_cap_calibration == other.sup_cap_calibration and
143
- self.sup_cap_pwr_mgmt == other.sup_cap_pwr_mgmt and
144
- self.sup_cap_sensors == other.sup_cap_sensors and
145
- self.sup_cap_custom == other.sup_cap_custom and
146
- self.cfg_hash == other.cfg_hash
147
- )
148
- return False
149
-
150
- def dump(self):
151
- string = bitstruct.pack("u4u4u8u8u48u8u8u8u8u8u1u1u1u1u1u1u1u1u32u40", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.board_type, self.bl_version, self.major_ver, self.minor_ver, self.patch_ver, self.sup_cap_glob, self.sup_cap_datapath, self.sup_cap_energy2400, self.sup_cap_energy_sub1g, self.sup_cap_calibration, self.sup_cap_pwr_mgmt, self.sup_cap_sensors, self.sup_cap_custom, self.cfg_hash, self.unused0)
152
- return string.hex().upper()
153
-
154
- def set(self, string):
155
- d = bitstruct.unpack("u4u4u8u8u48u8u8u8u8u8u1u1u1u1u1u1u1u1u32u40", binascii.unhexlify(string))
156
- self.module_type = d[0]
157
- self.msg_type = d[1]
158
- self.api_version = d[2]
159
- self.seq_id = d[3]
160
- self.brg_mac = d[4]
161
- self.board_type = d[5]
162
- self.bl_version = d[6]
163
- self.major_ver = d[7]
164
- self.minor_ver = d[8]
165
- self.patch_ver = d[9]
166
- self.sup_cap_glob = d[10]
167
- self.sup_cap_datapath = d[11]
168
- self.sup_cap_energy2400 = d[12]
169
- self.sup_cap_energy_sub1g = d[13]
170
- self.sup_cap_calibration = d[14]
171
- self.sup_cap_pwr_mgmt = d[15]
172
- self.sup_cap_sensors = d[16]
173
- self.sup_cap_custom = d[17]
174
- self.cfg_hash = d[18]
175
- self.unused0 = d[19]
176
-
177
- class ModuleCalibrationV12():
178
- def __init__(self, raw='', module_type=MODULE_CALIBRATION, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, interval=BRG_DEFAULT_CALIBRATION_INTERVAL, output_power=BRG_DEFAULT_OUTPUT_POWER_2_4, pattern=BRG_DEFAULT_CALIBRATION_PATTERN, unused0=0, unused1=0):
179
- self.module_type = module_type
180
- self.msg_type = msg_type
181
- self.api_version = api_version
182
- self.seq_id = seq_id
183
- self.brg_mac = brg_mac
184
- self.interval = interval
185
- self.output_power = output_power
186
- self.pattern = pattern
187
- self.unused0 = unused0
188
- self.unused1 = unused1
189
- if raw:
190
- self.set(raw)
191
-
192
- def __repr__(self) -> str:
193
- return "\n==> Packet module_calibration_v12 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X}", self.module_type],['msg_type', f"0x{self.msg_type:X}", self.msg_type],['api_version', f"0x{self.api_version:X}", self.api_version],['seq_id', f"0x{self.seq_id:X}", self.seq_id],['brg_mac', f"0x{self.brg_mac:X}", self.brg_mac],['interval', f"0x{self.interval:X}", self.interval],['output_power', f"0x{self.output_power:X}", self.output_power],['pattern', f"0x{self.pattern:X}", self.pattern]], tablefmt="texttable")
194
-
195
- def __eq__(self, other):
196
- if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
197
- return (
198
- self.module_type == other.module_type and
199
- self.msg_type == other.msg_type and
200
- self.api_version == other.api_version and
201
- self.brg_mac == other.brg_mac and
202
- self.interval == other.interval and
203
- self.output_power == other.output_power and
204
- self.pattern == other.pattern
205
- )
206
- return False
207
-
208
- def dump(self):
209
- string = bitstruct.pack("u4u4u8u8u48u8s8u4u4u96", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.interval, self.output_power, self.pattern, self.unused0, self.unused1)
210
- return string.hex().upper()
211
-
212
- def set(self, string):
213
- d = bitstruct.unpack("u4u4u8u8u48u8s8u4u4u96", binascii.unhexlify(string))
214
- self.module_type = d[0]
215
- self.msg_type = d[1]
216
- self.api_version = d[2]
217
- self.seq_id = d[3]
218
- self.brg_mac = d[4]
219
- self.interval = d[5]
220
- self.output_power = d[6]
221
- self.pattern = d[7]
222
- self.unused0 = d[8]
223
- self.unused1 = d[9]
224
-
225
- class ModuleCalibrationV11():
226
- def __init__(self, raw='', module_type=MODULE_CALIBRATION, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V11, seq_id=0, brg_mac=0, interval=BRG_DEFAULT_CALIBRATION_INTERVAL, output_power=BRG_DEFAULT_OUTPUT_POWER_2_4, pattern=BRG_DEFAULT_CALIBRATION_PATTERN, unused0=0, unused1=0):
227
- self.module_type = module_type
228
- self.msg_type = msg_type
229
- self.api_version = api_version
230
- self.seq_id = seq_id
231
- self.brg_mac = brg_mac
232
- self.interval = interval
233
- self.output_power = output_power
234
- self.pattern = pattern
235
- self.unused0 = unused0
236
- self.unused1 = unused1
237
- if raw:
238
- self.set(raw)
239
-
240
- def __repr__(self) -> str:
241
- return "\n==> Packet module_calibration_v11 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X}", self.module_type],['msg_type', f"0x{self.msg_type:X}", self.msg_type],['api_version', f"0x{self.api_version:X}", self.api_version],['seq_id', f"0x{self.seq_id:X}", self.seq_id],['brg_mac', f"0x{self.brg_mac:X}", self.brg_mac],['interval', f"0x{self.interval:X}", self.interval],['output_power', f"0x{self.output_power:X}", self.output_power],['pattern', f"0x{self.pattern:X}", self.pattern]], tablefmt="texttable")
242
-
243
- def __eq__(self, other):
244
- if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
245
- return (
246
- self.module_type == other.module_type and
247
- self.msg_type == other.msg_type and
248
- self.api_version == other.api_version and
249
- self.brg_mac == other.brg_mac and
250
- self.interval == other.interval and
251
- self.output_power == other.output_power and
252
- self.pattern == other.pattern
253
- )
254
- return False
255
-
256
- def dump(self):
257
- string = bitstruct.pack("u4u4u8u8u48u8s8u4u4u96", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.interval, self.output_power, self.pattern, self.unused0, self.unused1)
258
- return string.hex().upper()
259
-
260
- def set(self, string):
261
- d = bitstruct.unpack("u4u4u8u8u48u8s8u4u4u96", binascii.unhexlify(string))
262
- self.module_type = d[0]
263
- self.msg_type = d[1]
264
- self.api_version = d[2]
265
- self.seq_id = d[3]
266
- self.brg_mac = d[4]
267
- self.interval = d[5]
268
- self.output_power = d[6]
269
- self.pattern = d[7]
270
- self.unused0 = d[8]
271
- self.unused1 = d[9]
272
-
273
- class ModuleDatapathV12():
274
- def __init__(self, raw='', module_type=MODULE_DATAPATH, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, rssi_threshold=BRG_DEFAULT_RSSI_THRESHOLD, pacer_interval=BRG_DEFAULT_PACER_INTERVAL, pkt_filter=BRG_DEFAULT_PKT_FILTER, tx_repetition=BRG_DEFAULT_TX_REPETITION, output_power=BRG_DEFAULT_DATAPATH_OUTPUT_POWER, pattern=BRG_DEFAULT_DATAPATH_PATTERN, rx_channel=BRG_DEFAULT_RX_CHANNEL, unused0=0):
275
- self.module_type = module_type
276
- self.msg_type = msg_type
277
- self.api_version = api_version
278
- self.seq_id = seq_id
279
- self.brg_mac = brg_mac
280
- self.rssi_threshold = rssi_threshold
281
- self.pacer_interval = pacer_interval
282
- self.pkt_filter = pkt_filter
283
- self.tx_repetition = tx_repetition
284
- self.output_power = output_power
285
- self.pattern = pattern
286
- self.rx_channel = rx_channel
287
- self.unused0 = unused0
288
- if raw:
289
- self.set(raw)
290
-
291
- def __repr__(self) -> str:
292
- return "\n==> Packet module_datapath_v12 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X}", self.module_type],['msg_type', f"0x{self.msg_type:X}", self.msg_type],['api_version', f"0x{self.api_version:X}", self.api_version],['seq_id', f"0x{self.seq_id:X}", self.seq_id],['brg_mac', f"0x{self.brg_mac:X}", self.brg_mac],['rssi_threshold', f"0x{self.rssi_threshold:X}", self.rssi_threshold],['pacer_interval', f"0x{self.pacer_interval:X}", self.pacer_interval],['pkt_filter', f"0x{self.pkt_filter:X}", self.pkt_filter],['tx_repetition', f"0x{self.tx_repetition:X}", self.tx_repetition],['output_power', f"0x{self.output_power:X}", self.output_power],['pattern', f"0x{self.pattern:X}", self.pattern],['rx_channel', f"0x{self.rx_channel:X}", self.rx_channel]], tablefmt="texttable")
293
-
294
- def __eq__(self, other):
295
- if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
296
- return (
297
- self.module_type == other.module_type and
298
- self.msg_type == other.msg_type and
299
- self.api_version == other.api_version and
300
- self.brg_mac == other.brg_mac and
301
- self.rssi_threshold == other.rssi_threshold and
302
- self.pacer_interval == other.pacer_interval and
303
- self.pkt_filter == other.pkt_filter and
304
- self.tx_repetition == other.tx_repetition and
305
- self.output_power == other.output_power and
306
- self.pattern == other.pattern and
307
- self.rx_channel == other.rx_channel
308
- )
309
- return False
310
-
311
- def dump(self):
312
- string = bitstruct.pack("u4u4u8u8u48s8u16u5u3s8u4u4u72", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, ((self.rssi_threshold-0)//-1), self.pacer_interval, self.pkt_filter, self.tx_repetition, self.output_power, self.pattern, self.rx_channel, self.unused0)
313
- return string.hex().upper()
314
-
315
- def set(self, string):
316
- d = bitstruct.unpack("u4u4u8u8u48s8u16u5u3s8u4u4u72", binascii.unhexlify(string))
317
- self.module_type = d[0]
318
- self.msg_type = d[1]
319
- self.api_version = d[2]
320
- self.seq_id = d[3]
321
- self.brg_mac = d[4]
322
- self.rssi_threshold = ((d[5]*-1)+0)
323
- self.pacer_interval = d[6]
324
- self.pkt_filter = d[7]
325
- self.tx_repetition = d[8]
326
- self.output_power = d[9]
327
- self.pattern = d[10]
328
- self.rx_channel = d[11]
329
- self.unused0 = d[12]
330
-
331
- class ModuleDatapathV11():
332
- def __init__(self, raw='', module_type=MODULE_DATAPATH, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V11, seq_id=0, brg_mac=0, unused1=0, unused0=0, adaptive_pacer=0, unified_echo_pkt=1, pacer_interval=BRG_DEFAULT_PACER_INTERVAL, pkt_filter=BRG_DEFAULT_PKT_FILTER, tx_repetition=BRG_DEFAULT_TX_REPETITION, output_power=BRG_DEFAULT_DATAPATH_OUTPUT_POWER, pattern=BRG_DEFAULT_DATAPATH_PATTERN, rx_channel=BRG_DEFAULT_RX_CHANNEL, unused2=0):
333
- self.module_type = module_type
334
- self.msg_type = msg_type
335
- self.api_version = api_version
336
- self.seq_id = seq_id
337
- self.brg_mac = brg_mac
338
- self.unused1 = unused1
339
- self.unused0 = unused0
340
- self.adaptive_pacer = adaptive_pacer
341
- self.unified_echo_pkt = unified_echo_pkt
342
- self.pacer_interval = pacer_interval
343
- self.pkt_filter = pkt_filter
344
- self.tx_repetition = tx_repetition
345
- self.output_power = output_power
346
- self.pattern = pattern
347
- self.rx_channel = rx_channel
348
- self.unused2 = unused2
349
- if raw:
350
- self.set(raw)
351
-
352
- def __repr__(self) -> str:
353
- return "\n==> Packet module_datapath_v11 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X}", self.module_type],['msg_type', f"0x{self.msg_type:X}", self.msg_type],['api_version', f"0x{self.api_version:X}", self.api_version],['seq_id', f"0x{self.seq_id:X}", self.seq_id],['brg_mac', f"0x{self.brg_mac:X}", self.brg_mac],['adaptive_pacer', f"0x{self.adaptive_pacer:X}", self.adaptive_pacer],['unified_echo_pkt', f"0x{self.unified_echo_pkt:X}", self.unified_echo_pkt],['pacer_interval', f"0x{self.pacer_interval:X}", self.pacer_interval],['pkt_filter', f"0x{self.pkt_filter:X}", self.pkt_filter],['tx_repetition', f"0x{self.tx_repetition:X}", self.tx_repetition],['output_power', f"0x{self.output_power:X}", self.output_power],['pattern', f"0x{self.pattern:X}", self.pattern],['rx_channel', f"0x{self.rx_channel:X}", self.rx_channel]], tablefmt="texttable")
354
-
355
- def __eq__(self, other):
356
- if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
357
- return (
358
- self.module_type == other.module_type and
359
- self.msg_type == other.msg_type and
360
- self.api_version == other.api_version and
361
- self.brg_mac == other.brg_mac and
362
- self.adaptive_pacer == other.adaptive_pacer and
363
- self.unified_echo_pkt == other.unified_echo_pkt and
364
- self.pacer_interval == other.pacer_interval and
365
- self.pkt_filter == other.pkt_filter and
366
- self.tx_repetition == other.tx_repetition and
367
- self.output_power == other.output_power and
368
- self.pattern == other.pattern and
369
- self.rx_channel == other.rx_channel
370
- )
371
- return False
372
-
373
- def dump(self):
374
- string = bitstruct.pack("u4u4u8u8u48u4u2u1u1u16u5u3s8u4u4u72", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.unused1, self.unused0, self.adaptive_pacer, self.unified_echo_pkt, self.pacer_interval, self.pkt_filter, self.tx_repetition, self.output_power, self.pattern, self.rx_channel, self.unused2)
375
- return string.hex().upper()
376
-
377
- def set(self, string):
378
- d = bitstruct.unpack("u4u4u8u8u48u4u2u1u1u16u5u3s8u4u4u72", binascii.unhexlify(string))
379
- self.module_type = d[0]
380
- self.msg_type = d[1]
381
- self.api_version = d[2]
382
- self.seq_id = d[3]
383
- self.brg_mac = d[4]
384
- self.unused1 = d[5]
385
- self.unused0 = d[6]
386
- self.adaptive_pacer = d[7]
387
- self.unified_echo_pkt = d[8]
388
- self.pacer_interval = d[9]
389
- self.pkt_filter = d[10]
390
- self.tx_repetition = d[11]
391
- self.output_power = d[12]
392
- self.pattern = d[13]
393
- self.rx_channel = d[14]
394
- self.unused2 = d[15]
395
-
396
- MODULE_ENERGY_2400_V12_SIGNAL_INDICATOR_REP_ENC = {SIGNAL_INDICATOR_REP_1:0, SIGNAL_INDICATOR_REP_2:1, SIGNAL_INDICATOR_REP_3:2, SIGNAL_INDICATOR_REP_4:3}
397
- MODULE_ENERGY_2400_V12_SIGNAL_INDICATOR_REP_DEC = {0:SIGNAL_INDICATOR_REP_1, 1:SIGNAL_INDICATOR_REP_2, 2:SIGNAL_INDICATOR_REP_3, 3:SIGNAL_INDICATOR_REP_4}
398
- class ModuleEnergy2400V12():
399
- def __init__(self, raw='', module_type=MODULE_ENERGY_2400, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, duty_cycle=BRG_DEFAULT_ENERGY_DUTY_CYCLE_2_4, pattern=BRG_DEFAULT_ENERGY_PATTERN_2_4, output_power=BRG_DEFAULT_OUTPUT_POWER_2_4, signal_indicator_cycle=BRG_DEFAULT_SIGNAL_INDICATOR_CYCLE, signal_indicator_rep=BRG_DEFAULT_SIGNAL_INDICATOR_REP, unused0=0):
400
- self.module_type = module_type
401
- self.msg_type = msg_type
402
- self.api_version = api_version
403
- self.seq_id = seq_id
404
- self.brg_mac = brg_mac
405
- self.duty_cycle = duty_cycle
406
- self.pattern = pattern
407
- self.output_power = output_power
408
- self.signal_indicator_cycle = signal_indicator_cycle
409
- self.signal_indicator_rep = signal_indicator_rep
410
- self.unused0 = unused0
411
- if raw:
412
- self.set(raw)
413
-
414
- def __repr__(self) -> str:
415
- return "\n==> Packet module_energy_2400_v12 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X}", self.module_type],['msg_type', f"0x{self.msg_type:X}", self.msg_type],['api_version', f"0x{self.api_version:X}", self.api_version],['seq_id', f"0x{self.seq_id:X}", self.seq_id],['brg_mac', f"0x{self.brg_mac:X}", self.brg_mac],['duty_cycle', f"0x{self.duty_cycle:X}", self.duty_cycle],['pattern', f"0x{self.pattern:X}", self.pattern],['output_power', f"0x{self.output_power:X}", self.output_power],['signal_indicator_cycle', f"0x{self.signal_indicator_cycle:X}", self.signal_indicator_cycle],['signal_indicator_rep', f"0x{self.signal_indicator_rep:X}", self.signal_indicator_rep]], tablefmt="texttable")
416
-
417
- def __eq__(self, other):
418
- if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
419
- return (
420
- self.module_type == other.module_type and
421
- self.msg_type == other.msg_type and
422
- self.api_version == other.api_version and
423
- self.brg_mac == other.brg_mac and
424
- self.duty_cycle == other.duty_cycle and
425
- self.pattern == other.pattern and
426
- self.output_power == other.output_power and
427
- self.signal_indicator_cycle == other.signal_indicator_cycle and
428
- self.signal_indicator_rep == other.signal_indicator_rep
429
- )
430
- return False
431
-
432
- def dump(self):
433
- string = bitstruct.pack("u4u4u8u8u48u8u8s8u14u2u80", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.duty_cycle, self.pattern, self.output_power, self.signal_indicator_cycle, MODULE_ENERGY_2400_V12_SIGNAL_INDICATOR_REP_ENC[self.signal_indicator_rep], self.unused0)
434
- return string.hex().upper()
435
-
436
- def set(self, string):
437
- d = bitstruct.unpack("u4u4u8u8u48u8u8s8u14u2u80", binascii.unhexlify(string))
438
- self.module_type = d[0]
439
- self.msg_type = d[1]
440
- self.api_version = d[2]
441
- self.seq_id = d[3]
442
- self.brg_mac = d[4]
443
- self.duty_cycle = d[5]
444
- self.pattern = d[6]
445
- self.output_power = d[7]
446
- self.signal_indicator_cycle = d[8]
447
- self.signal_indicator_rep = MODULE_ENERGY_2400_V12_SIGNAL_INDICATOR_REP_DEC[d[9]]
448
- self.unused0 = d[10]
449
-
450
- MODULE_ENERGY_2400_V11_SIGNAL_INDICATOR_REP_ENC = {SIGNAL_INDICATOR_REP_1:0, SIGNAL_INDICATOR_REP_2:1, SIGNAL_INDICATOR_REP_3:2, SIGNAL_INDICATOR_REP_4:3}
451
- MODULE_ENERGY_2400_V11_SIGNAL_INDICATOR_REP_DEC = {0:SIGNAL_INDICATOR_REP_1, 1:SIGNAL_INDICATOR_REP_2, 2:SIGNAL_INDICATOR_REP_3, 3:SIGNAL_INDICATOR_REP_4}
452
- class ModuleEnergy2400V11():
453
- def __init__(self, raw='', module_type=MODULE_ENERGY_2400, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V11, seq_id=0, brg_mac=0, duty_cycle=BRG_DEFAULT_ENERGY_DUTY_CYCLE_2_4, pattern=BRG_DEFAULT_ENERGY_PATTERN_2_4, output_power=BRG_DEFAULT_OUTPUT_POWER_2_4, signal_indicator_cycle=BRG_DEFAULT_SIGNAL_INDICATOR_CYCLE, signal_indicator_rep=BRG_DEFAULT_SIGNAL_INDICATOR_REP, unused0=0):
454
- self.module_type = module_type
455
- self.msg_type = msg_type
456
- self.api_version = api_version
457
- self.seq_id = seq_id
458
- self.brg_mac = brg_mac
459
- self.duty_cycle = duty_cycle
460
- self.pattern = pattern
461
- self.output_power = output_power
462
- self.signal_indicator_cycle = signal_indicator_cycle
463
- self.signal_indicator_rep = signal_indicator_rep
464
- self.unused0 = unused0
465
- if raw:
466
- self.set(raw)
467
-
468
- def __repr__(self) -> str:
469
- return "\n==> Packet module_energy_2400_v11 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X}", self.module_type],['msg_type', f"0x{self.msg_type:X}", self.msg_type],['api_version', f"0x{self.api_version:X}", self.api_version],['seq_id', f"0x{self.seq_id:X}", self.seq_id],['brg_mac', f"0x{self.brg_mac:X}", self.brg_mac],['duty_cycle', f"0x{self.duty_cycle:X}", self.duty_cycle],['pattern', f"0x{self.pattern:X}", self.pattern],['output_power', f"0x{self.output_power:X}", self.output_power],['signal_indicator_cycle', f"0x{self.signal_indicator_cycle:X}", self.signal_indicator_cycle],['signal_indicator_rep', f"0x{self.signal_indicator_rep:X}", self.signal_indicator_rep]], tablefmt="texttable")
470
-
471
- def __eq__(self, other):
472
- if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
473
- return (
474
- self.module_type == other.module_type and
475
- self.msg_type == other.msg_type and
476
- self.api_version == other.api_version and
477
- self.brg_mac == other.brg_mac and
478
- self.duty_cycle == other.duty_cycle and
479
- self.pattern == other.pattern and
480
- self.output_power == other.output_power and
481
- self.signal_indicator_cycle == other.signal_indicator_cycle and
482
- self.signal_indicator_rep == other.signal_indicator_rep
483
- )
484
- return False
485
-
486
- def dump(self):
487
- string = bitstruct.pack("u4u4u8u8u48u8u8s8u14u2u80", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.duty_cycle, self.pattern, self.output_power, self.signal_indicator_cycle, MODULE_ENERGY_2400_V11_SIGNAL_INDICATOR_REP_ENC[self.signal_indicator_rep], self.unused0)
488
- return string.hex().upper()
489
-
490
- def set(self, string):
491
- d = bitstruct.unpack("u4u4u8u8u48u8u8s8u14u2u80", binascii.unhexlify(string))
492
- self.module_type = d[0]
493
- self.msg_type = d[1]
494
- self.api_version = d[2]
495
- self.seq_id = d[3]
496
- self.brg_mac = d[4]
497
- self.duty_cycle = d[5]
498
- self.pattern = d[6]
499
- self.output_power = d[7]
500
- self.signal_indicator_cycle = d[8]
501
- self.signal_indicator_rep = MODULE_ENERGY_2400_V11_SIGNAL_INDICATOR_REP_DEC[d[9]]
502
- self.unused0 = d[10]
503
-
504
- MODULE_ENERGY_SUB1G_V12_SIGNAL_INDICATOR_REP_ENC = {SIGNAL_INDICATOR_SUB1G_REP_1:SIGNAL_INDICATOR_SUB1G_REP_PROFILE_1, SIGNAL_INDICATOR_SUB1G_REP_2:SIGNAL_INDICATOR_SUB1G_REP_PROFILE_2, SIGNAL_INDICATOR_SUB1G_REP_3:SIGNAL_INDICATOR_SUB1G_REP_PROFILE_3, SIGNAL_INDICATOR_SUB1G_REP_4:SIGNAL_INDICATOR_SUB1G_REP_PROFILE_4}
505
- MODULE_ENERGY_SUB1G_V12_SIGNAL_INDICATOR_REP_DEC = {SIGNAL_INDICATOR_SUB1G_REP_PROFILE_1:SIGNAL_INDICATOR_SUB1G_REP_1, SIGNAL_INDICATOR_SUB1G_REP_PROFILE_2:SIGNAL_INDICATOR_SUB1G_REP_2, SIGNAL_INDICATOR_SUB1G_REP_PROFILE_3:SIGNAL_INDICATOR_SUB1G_REP_3, SIGNAL_INDICATOR_SUB1G_REP_PROFILE_4:SIGNAL_INDICATOR_SUB1G_REP_4}
506
- class ModuleEnergySub1GV12():
507
- def __init__(self, raw='', module_type=MODULE_ENERGY_SUB1G, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, pattern=BRG_DEFAULT_SUB1G_ENERGY_PATTERN, duty_cycle=BRG_DEFAULT_SUB1G_DUTY_CYCLE, signal_indicator_cycle=BRG_DEFAULT_SIGNAL_INDICATOR_SUB1G_CYCLE, signal_indicator_rep=BRG_DEFAULT_SIGNAL_INDICATOR_SUB1G_REP, unused0=0):
508
- self.module_type = module_type
509
- self.msg_type = msg_type
510
- self.api_version = api_version
511
- self.seq_id = seq_id
512
- self.brg_mac = brg_mac
513
- self.pattern = pattern
514
- self.duty_cycle = duty_cycle
515
- self.signal_indicator_cycle = signal_indicator_cycle
516
- self.signal_indicator_rep = signal_indicator_rep
517
- self.unused0 = unused0
518
- if raw:
519
- self.set(raw)
520
-
521
- def __repr__(self) -> str:
522
- return "\n==> Packet module_energy_sub1g_v12 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X}", self.module_type],['msg_type', f"0x{self.msg_type:X}", self.msg_type],['api_version', f"0x{self.api_version:X}", self.api_version],['seq_id', f"0x{self.seq_id:X}", self.seq_id],['brg_mac', f"0x{self.brg_mac:X}", self.brg_mac],['pattern', f"0x{self.pattern:X}", self.pattern],['duty_cycle', f"0x{self.duty_cycle:X}", self.duty_cycle],['signal_indicator_cycle', f"0x{self.signal_indicator_cycle:X}", self.signal_indicator_cycle],['signal_indicator_rep', f"0x{self.signal_indicator_rep:X}", self.signal_indicator_rep]], tablefmt="texttable")
523
-
524
- def __eq__(self, other):
525
- if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
526
- return (
527
- self.module_type == other.module_type and
528
- self.msg_type == other.msg_type and
529
- self.api_version == other.api_version and
530
- self.brg_mac == other.brg_mac and
531
- self.pattern == other.pattern and
532
- self.duty_cycle == other.duty_cycle and
533
- self.signal_indicator_cycle == other.signal_indicator_cycle and
534
- self.signal_indicator_rep == other.signal_indicator_rep
535
- )
536
- return False
537
-
538
- def dump(self):
539
- string = bitstruct.pack("u4u4u8u8u48u8u8u14u2u88", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.pattern, self.duty_cycle, self.signal_indicator_cycle, MODULE_ENERGY_SUB1G_V12_SIGNAL_INDICATOR_REP_ENC[self.signal_indicator_rep], self.unused0)
540
- return string.hex().upper()
541
-
542
- def set(self, string):
543
- d = bitstruct.unpack("u4u4u8u8u48u8u8u14u2u88", binascii.unhexlify(string))
544
- self.module_type = d[0]
545
- self.msg_type = d[1]
546
- self.api_version = d[2]
547
- self.seq_id = d[3]
548
- self.brg_mac = d[4]
549
- self.pattern = d[5]
550
- self.duty_cycle = d[6]
551
- self.signal_indicator_cycle = d[7]
552
- self.signal_indicator_rep = MODULE_ENERGY_SUB1G_V12_SIGNAL_INDICATOR_REP_DEC[d[8]]
553
- self.unused0 = d[9]
554
-
555
- MODULE_ENERGY_SUB1G_V11_OUTPUT_POWER_ENC = {SUB1G_OUTPUT_POWER_14:SUB1G_OUTPUT_POWER_PROFILE_14, SUB1G_OUTPUT_POWER_17:SUB1G_OUTPUT_POWER_PROFILE_17, SUB1G_OUTPUT_POWER_20:SUB1G_OUTPUT_POWER_PROFILE_20, SUB1G_OUTPUT_POWER_23:SUB1G_OUTPUT_POWER_PROFILE_23, SUB1G_OUTPUT_POWER_26:SUB1G_OUTPUT_POWER_PROFILE_26, SUB1G_OUTPUT_POWER_29:SUB1G_OUTPUT_POWER_PROFILE_29, SUB1G_OUTPUT_POWER_32:SUB1G_OUTPUT_POWER_PROFILE_32}
556
- MODULE_ENERGY_SUB1G_V11_OUTPUT_POWER_DEC = {SUB1G_OUTPUT_POWER_PROFILE_14:SUB1G_OUTPUT_POWER_14, SUB1G_OUTPUT_POWER_PROFILE_17:SUB1G_OUTPUT_POWER_17, SUB1G_OUTPUT_POWER_PROFILE_20:SUB1G_OUTPUT_POWER_20, SUB1G_OUTPUT_POWER_PROFILE_23:SUB1G_OUTPUT_POWER_23, SUB1G_OUTPUT_POWER_PROFILE_26:SUB1G_OUTPUT_POWER_26, SUB1G_OUTPUT_POWER_PROFILE_29:SUB1G_OUTPUT_POWER_29, SUB1G_OUTPUT_POWER_PROFILE_32:SUB1G_OUTPUT_POWER_32}
557
- MODULE_ENERGY_SUB1G_V11_SIGNAL_INDICATOR_REP_ENC = {SIGNAL_INDICATOR_SUB1G_REP_1:SIGNAL_INDICATOR_SUB1G_REP_PROFILE_1, SIGNAL_INDICATOR_SUB1G_REP_2:SIGNAL_INDICATOR_SUB1G_REP_PROFILE_2, SIGNAL_INDICATOR_SUB1G_REP_3:SIGNAL_INDICATOR_SUB1G_REP_PROFILE_3, SIGNAL_INDICATOR_SUB1G_REP_4:SIGNAL_INDICATOR_SUB1G_REP_PROFILE_4}
558
- MODULE_ENERGY_SUB1G_V11_SIGNAL_INDICATOR_REP_DEC = {SIGNAL_INDICATOR_SUB1G_REP_PROFILE_1:SIGNAL_INDICATOR_SUB1G_REP_1, SIGNAL_INDICATOR_SUB1G_REP_PROFILE_2:SIGNAL_INDICATOR_SUB1G_REP_2, SIGNAL_INDICATOR_SUB1G_REP_PROFILE_3:SIGNAL_INDICATOR_SUB1G_REP_3, SIGNAL_INDICATOR_SUB1G_REP_PROFILE_4:SIGNAL_INDICATOR_SUB1G_REP_4}
559
- class ModuleEnergySub1GV11():
560
- def __init__(self, raw='', module_type=MODULE_ENERGY_SUB1G, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V11, seq_id=0, brg_mac=0, output_power=BRG_DEFAULT_OUTPUT_POWER_SUB1G, sub1g_energy_pattern=BRG_DEFAULT_SUB1G_ENERGY_PATTERN, cycle=15, duty_cycle=BRG_DEFAULT_SUB1G_DUTY_CYCLE, signal_indicator_cycle=BRG_DEFAULT_SIGNAL_INDICATOR_SUB1G_CYCLE, signal_indicator_rep=BRG_DEFAULT_SIGNAL_INDICATOR_SUB1G_REP, unused0=0):
561
- self.module_type = module_type
562
- self.msg_type = msg_type
563
- self.api_version = api_version
564
- self.seq_id = seq_id
565
- self.brg_mac = brg_mac
566
- self.output_power = output_power
567
- self.sub1g_energy_pattern = sub1g_energy_pattern
568
- self.cycle = cycle
569
- self.duty_cycle = duty_cycle
570
- self.signal_indicator_cycle = signal_indicator_cycle
571
- self.signal_indicator_rep = signal_indicator_rep
572
- self.unused0 = unused0
573
- if raw:
574
- self.set(raw)
575
-
576
- def __repr__(self) -> str:
577
- return "\n==> Packet module_energy_sub1g_v11 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X}", self.module_type],['msg_type', f"0x{self.msg_type:X}", self.msg_type],['api_version', f"0x{self.api_version:X}", self.api_version],['seq_id', f"0x{self.seq_id:X}", self.seq_id],['brg_mac', f"0x{self.brg_mac:X}", self.brg_mac],['output_power', f"0x{self.output_power:X}", self.output_power],['sub1g_energy_pattern', f"0x{self.sub1g_energy_pattern:X}", self.sub1g_energy_pattern],['cycle', f"0x{self.cycle:X}", self.cycle],['duty_cycle', f"0x{self.duty_cycle:X}", self.duty_cycle],['signal_indicator_cycle', f"0x{self.signal_indicator_cycle:X}", self.signal_indicator_cycle],['signal_indicator_rep', f"0x{self.signal_indicator_rep:X}", self.signal_indicator_rep]], tablefmt="texttable")
578
-
579
- def __eq__(self, other):
580
- if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
581
- return (
582
- self.module_type == other.module_type and
583
- self.msg_type == other.msg_type and
584
- self.api_version == other.api_version and
585
- self.brg_mac == other.brg_mac and
586
- self.output_power == other.output_power and
587
- self.sub1g_energy_pattern == other.sub1g_energy_pattern and
588
- self.cycle == other.cycle and
589
- self.duty_cycle == other.duty_cycle and
590
- self.signal_indicator_cycle == other.signal_indicator_cycle and
591
- self.signal_indicator_rep == other.signal_indicator_rep
592
- )
593
- return False
594
-
595
- def dump(self):
596
- string = bitstruct.pack("u4u4u8u8u48u8u8u8u8u14u2u72", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, MODULE_ENERGY_SUB1G_V11_OUTPUT_POWER_ENC[self.output_power], self.sub1g_energy_pattern, self.cycle, self.duty_cycle, self.signal_indicator_cycle, MODULE_ENERGY_SUB1G_V11_SIGNAL_INDICATOR_REP_ENC[self.signal_indicator_rep], self.unused0)
597
- return string.hex().upper()
598
-
599
- def set(self, string):
600
- d = bitstruct.unpack("u4u4u8u8u48u8u8u8u8u14u2u72", binascii.unhexlify(string))
601
- self.module_type = d[0]
602
- self.msg_type = d[1]
603
- self.api_version = d[2]
604
- self.seq_id = d[3]
605
- self.brg_mac = d[4]
606
- self.output_power = MODULE_ENERGY_SUB1G_V11_OUTPUT_POWER_DEC[d[5]]
607
- self.sub1g_energy_pattern = d[6]
608
- self.cycle = d[7]
609
- self.duty_cycle = d[8]
610
- self.signal_indicator_cycle = d[9]
611
- self.signal_indicator_rep = MODULE_ENERGY_SUB1G_V11_SIGNAL_INDICATOR_REP_DEC[d[10]]
612
- self.unused0 = d[11]
613
-
614
- class ModulePwrMgmtV12():
615
- def __init__(self, raw='', module_type=MODULE_PWR_MGMT, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, static_leds_on=PWR_MGMT_DEFAULTS_LEDS_ON, static_keep_alive_period=PWR_MGMT_DEFAULTS_KEEP_ALIVE_PERIOD, static_keep_alive_scan=PWR_MGMT_DEFAULTS_KEEP_ALIVE_SCAN, static_on_duration=PWR_MGMT_DEFAULTS_ON_DURATION, static_sleep_duration=PWR_MGMT_DEFAULTS_SLEEP_DURATION, dynamic_leds_on=PWR_MGMT_DEFAULTS_LEDS_ON, dynamic_keep_alive_period=PWR_MGMT_DEFAULTS_KEEP_ALIVE_PERIOD, dynamic_keep_alive_scan=PWR_MGMT_DEFAULTS_KEEP_ALIVE_SCAN, dynamic_on_duration=PWR_MGMT_DEFAULTS_ON_DURATION, dynamic_sleep_duration=PWR_MGMT_DEFAULTS_SLEEP_DURATION, unused0=0):
616
- self.module_type = module_type
617
- self.msg_type = msg_type
618
- self.api_version = api_version
619
- self.seq_id = seq_id
620
- self.brg_mac = brg_mac
621
- self.static_leds_on = static_leds_on
622
- self.static_keep_alive_period = static_keep_alive_period # 5sec resolution
623
- self.static_keep_alive_scan = static_keep_alive_scan # 10msec resolution
624
- self.static_on_duration = static_on_duration # 30sec resolution
625
- self.static_sleep_duration = static_sleep_duration # 60sec resolution
626
- self.dynamic_leds_on = dynamic_leds_on
627
- self.dynamic_keep_alive_period = dynamic_keep_alive_period # 5sec resolution
628
- self.dynamic_keep_alive_scan = dynamic_keep_alive_scan # 10msec resolution
629
- self.dynamic_on_duration = dynamic_on_duration # 30sec resolution
630
- self.dynamic_sleep_duration = dynamic_sleep_duration # 60sec resolution
631
- self.unused0 = unused0
632
- if raw:
633
- self.set(raw)
634
-
635
- def __repr__(self) -> str:
636
- return "\n==> Packet module_pwr_mgmt_v12 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X}", self.module_type],['msg_type', f"0x{self.msg_type:X}", self.msg_type],['api_version', f"0x{self.api_version:X}", self.api_version],['seq_id', f"0x{self.seq_id:X}", self.seq_id],['brg_mac', f"0x{self.brg_mac:X}", self.brg_mac],['static_leds_on', f"0x{self.static_leds_on:X}", self.static_leds_on],['static_keep_alive_period', f"0x{self.static_keep_alive_period:X}", self.static_keep_alive_period],['static_keep_alive_scan', f"0x{self.static_keep_alive_scan:X}", self.static_keep_alive_scan],['static_on_duration', f"0x{self.static_on_duration:X}", self.static_on_duration],['static_sleep_duration', f"0x{self.static_sleep_duration:X}", self.static_sleep_duration],['dynamic_leds_on', f"0x{self.dynamic_leds_on:X}", self.dynamic_leds_on],['dynamic_keep_alive_period', f"0x{self.dynamic_keep_alive_period:X}", self.dynamic_keep_alive_period],['dynamic_keep_alive_scan', f"0x{self.dynamic_keep_alive_scan:X}", self.dynamic_keep_alive_scan],['dynamic_on_duration', f"0x{self.dynamic_on_duration:X}", self.dynamic_on_duration],['dynamic_sleep_duration', f"0x{self.dynamic_sleep_duration:X}", self.dynamic_sleep_duration]], tablefmt="texttable")
637
-
638
- def __eq__(self, other):
639
- if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
640
- return (
641
- self.module_type == other.module_type and
642
- self.msg_type == other.msg_type and
643
- self.api_version == other.api_version and
644
- self.brg_mac == other.brg_mac and
645
- self.static_leds_on == other.static_leds_on and
646
- self.static_keep_alive_period == other.static_keep_alive_period and
647
- self.static_keep_alive_scan == other.static_keep_alive_scan and
648
- self.static_on_duration == other.static_on_duration and
649
- self.static_sleep_duration == other.static_sleep_duration and
650
- self.dynamic_leds_on == other.dynamic_leds_on and
651
- self.dynamic_keep_alive_period == other.dynamic_keep_alive_period and
652
- self.dynamic_keep_alive_scan == other.dynamic_keep_alive_scan and
653
- self.dynamic_on_duration == other.dynamic_on_duration and
654
- self.dynamic_sleep_duration == other.dynamic_sleep_duration
655
- )
656
- return False
657
-
658
- def dump(self):
659
- string = bitstruct.pack("u4u4u8u8u48u8u8u8u8u16u8u8u8u8u16u24", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.static_leds_on, ((self.static_keep_alive_period-0)//5), ((self.static_keep_alive_scan-0)//10), ((self.static_on_duration-0)//30), ((self.static_sleep_duration-0)//60), self.dynamic_leds_on, ((self.dynamic_keep_alive_period-0)//5), ((self.dynamic_keep_alive_scan-0)//10), ((self.dynamic_on_duration-0)//30), ((self.dynamic_sleep_duration-0)//60), self.unused0)
660
- return string.hex().upper()
661
-
662
- def set(self, string):
663
- d = bitstruct.unpack("u4u4u8u8u48u8u8u8u8u16u8u8u8u8u16u24", binascii.unhexlify(string))
664
- self.module_type = d[0]
665
- self.msg_type = d[1]
666
- self.api_version = d[2]
667
- self.seq_id = d[3]
668
- self.brg_mac = d[4]
669
- self.static_leds_on = d[5]
670
- self.static_keep_alive_period = ((d[6]*5)+0)
671
- self.static_keep_alive_scan = ((d[7]*10)+0)
672
- self.static_on_duration = ((d[8]*30)+0)
673
- self.static_sleep_duration = ((d[9]*60)+0)
674
- self.dynamic_leds_on = d[10]
675
- self.dynamic_keep_alive_period = ((d[11]*5)+0)
676
- self.dynamic_keep_alive_scan = ((d[12]*10)+0)
677
- self.dynamic_on_duration = ((d[13]*30)+0)
678
- self.dynamic_sleep_duration = ((d[14]*60)+0)
679
- self.unused0 = d[15]
680
-
681
- class ModulePwrMgmtV11():
682
- def __init__(self, raw='', module_type=MODULE_PWR_MGMT, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V11, seq_id=0, brg_mac=0, static_leds_on=PWR_MGMT_DEFAULTS_LEDS_ON, static_keep_alive_period=PWR_MGMT_DEFAULTS_KEEP_ALIVE_PERIOD, static_keep_alive_scan=PWR_MGMT_DEFAULTS_KEEP_ALIVE_SCAN, static_on_duration=PWR_MGMT_DEFAULTS_ON_DURATION, static_sleep_duration=PWR_MGMT_DEFAULTS_SLEEP_DURATION, dynamic_leds_on=PWR_MGMT_DEFAULTS_LEDS_ON, dynamic_keep_alive_period=PWR_MGMT_DEFAULTS_KEEP_ALIVE_PERIOD, dynamic_keep_alive_scan=PWR_MGMT_DEFAULTS_KEEP_ALIVE_SCAN, dynamic_on_duration=PWR_MGMT_DEFAULTS_ON_DURATION, dynamic_sleep_duration=PWR_MGMT_DEFAULTS_SLEEP_DURATION, unused0=0):
683
- self.module_type = module_type
684
- self.msg_type = msg_type
685
- self.api_version = api_version
686
- self.seq_id = seq_id
687
- self.brg_mac = brg_mac
688
- self.static_leds_on = static_leds_on
689
- self.static_keep_alive_period = static_keep_alive_period # 5sec resolution
690
- self.static_keep_alive_scan = static_keep_alive_scan # 10msec resolution
691
- self.static_on_duration = static_on_duration # 30sec resolution
692
- self.static_sleep_duration = static_sleep_duration # 60sec resolution
693
- self.dynamic_leds_on = dynamic_leds_on
694
- self.dynamic_keep_alive_period = dynamic_keep_alive_period # 5sec resolution
695
- self.dynamic_keep_alive_scan = dynamic_keep_alive_scan # 10msec resolution
696
- self.dynamic_on_duration = dynamic_on_duration # 30sec resolution
697
- self.dynamic_sleep_duration = dynamic_sleep_duration # 60sec resolution
698
- self.unused0 = unused0
699
- if raw:
700
- self.set(raw)
701
-
702
- def __repr__(self) -> str:
703
- return "\n==> Packet module_pwr_mgmt_v11 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X}", self.module_type],['msg_type', f"0x{self.msg_type:X}", self.msg_type],['api_version', f"0x{self.api_version:X}", self.api_version],['seq_id', f"0x{self.seq_id:X}", self.seq_id],['brg_mac', f"0x{self.brg_mac:X}", self.brg_mac],['static_leds_on', f"0x{self.static_leds_on:X}", self.static_leds_on],['static_keep_alive_period', f"0x{self.static_keep_alive_period:X}", self.static_keep_alive_period],['static_keep_alive_scan', f"0x{self.static_keep_alive_scan:X}", self.static_keep_alive_scan],['static_on_duration', f"0x{self.static_on_duration:X}", self.static_on_duration],['static_sleep_duration', f"0x{self.static_sleep_duration:X}", self.static_sleep_duration],['dynamic_leds_on', f"0x{self.dynamic_leds_on:X}", self.dynamic_leds_on],['dynamic_keep_alive_period', f"0x{self.dynamic_keep_alive_period:X}", self.dynamic_keep_alive_period],['dynamic_keep_alive_scan', f"0x{self.dynamic_keep_alive_scan:X}", self.dynamic_keep_alive_scan],['dynamic_on_duration', f"0x{self.dynamic_on_duration:X}", self.dynamic_on_duration],['dynamic_sleep_duration', f"0x{self.dynamic_sleep_duration:X}", self.dynamic_sleep_duration]], tablefmt="texttable")
704
-
705
- def __eq__(self, other):
706
- if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
707
- return (
708
- self.module_type == other.module_type and
709
- self.msg_type == other.msg_type and
710
- self.api_version == other.api_version and
711
- self.brg_mac == other.brg_mac and
712
- self.static_leds_on == other.static_leds_on and
713
- self.static_keep_alive_period == other.static_keep_alive_period and
714
- self.static_keep_alive_scan == other.static_keep_alive_scan and
715
- self.static_on_duration == other.static_on_duration and
716
- self.static_sleep_duration == other.static_sleep_duration and
717
- self.dynamic_leds_on == other.dynamic_leds_on and
718
- self.dynamic_keep_alive_period == other.dynamic_keep_alive_period and
719
- self.dynamic_keep_alive_scan == other.dynamic_keep_alive_scan and
720
- self.dynamic_on_duration == other.dynamic_on_duration and
721
- self.dynamic_sleep_duration == other.dynamic_sleep_duration
722
- )
723
- return False
724
-
725
- def dump(self):
726
- string = bitstruct.pack("u4u4u8u8u48u8u8u8u8u16u8u8u8u8u16u24", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.static_leds_on, ((self.static_keep_alive_period-0)//5), ((self.static_keep_alive_scan-0)//10), ((self.static_on_duration-0)//30), ((self.static_sleep_duration-0)//60), self.dynamic_leds_on, ((self.dynamic_keep_alive_period-0)//5), ((self.dynamic_keep_alive_scan-0)//10), ((self.dynamic_on_duration-0)//30), ((self.dynamic_sleep_duration-0)//60), self.unused0)
727
- return string.hex().upper()
728
-
729
- def set(self, string):
730
- d = bitstruct.unpack("u4u4u8u8u48u8u8u8u8u16u8u8u8u8u16u24", binascii.unhexlify(string))
731
- self.module_type = d[0]
732
- self.msg_type = d[1]
733
- self.api_version = d[2]
734
- self.seq_id = d[3]
735
- self.brg_mac = d[4]
736
- self.static_leds_on = d[5]
737
- self.static_keep_alive_period = ((d[6]*5)+0)
738
- self.static_keep_alive_scan = ((d[7]*10)+0)
739
- self.static_on_duration = ((d[8]*30)+0)
740
- self.static_sleep_duration = ((d[9]*60)+0)
741
- self.dynamic_leds_on = d[10]
742
- self.dynamic_keep_alive_period = ((d[11]*5)+0)
743
- self.dynamic_keep_alive_scan = ((d[12]*10)+0)
744
- self.dynamic_on_duration = ((d[13]*30)+0)
745
- self.dynamic_sleep_duration = ((d[14]*60)+0)
746
- self.unused0 = d[15]
747
-
748
- class ModuleExtSensorsV12():
749
- def __init__(self, raw='', module_type=MODULE_EXT_SENSORS, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, sensor0=BRG_DEFAULT_EXTERNAL_SENSOR_CFG, sensor1=BRG_DEFAULT_EXTERNAL_SENSOR_CFG, rssi_threshold=BRG_DEFAULT_RSSI_THRESHOLD, sub1g_rssi_threshold=BRG_DEFAULT_RSSI_THRESHOLD, unused=0):
750
- self.module_type = module_type
751
- self.msg_type = msg_type
752
- self.api_version = api_version
753
- self.seq_id = seq_id
754
- self.brg_mac = brg_mac
755
- self.sensor0 = sensor0
756
- self.sensor1 = sensor1
757
- self.rssi_threshold = rssi_threshold
758
- self.sub1g_rssi_threshold = sub1g_rssi_threshold
759
- self.unused = unused
760
- if raw:
761
- self.set(raw)
762
-
763
- def __repr__(self) -> str:
764
- return "\n==> Packet module_ext_sensors_v12 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X}", self.module_type],['msg_type', f"0x{self.msg_type:X}", self.msg_type],['api_version', f"0x{self.api_version:X}", self.api_version],['seq_id', f"0x{self.seq_id:X}", self.seq_id],['brg_mac', f"0x{self.brg_mac:X}", self.brg_mac],['sensor0', f"0x{self.sensor0:X}", self.sensor0],['sensor1', f"0x{self.sensor1:X}", self.sensor1],['rssi_threshold', f"0x{self.rssi_threshold:X}", self.rssi_threshold],['sub1g_rssi_threshold', f"0x{self.sub1g_rssi_threshold:X}", self.sub1g_rssi_threshold]], tablefmt="texttable")
765
-
766
- def __eq__(self, other):
767
- if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
768
- return (
769
- self.module_type == other.module_type and
770
- self.msg_type == other.msg_type and
771
- self.api_version == other.api_version and
772
- self.brg_mac == other.brg_mac and
773
- self.sensor0 == other.sensor0 and
774
- self.sensor1 == other.sensor1 and
775
- self.rssi_threshold == other.rssi_threshold and
776
- self.sub1g_rssi_threshold == other.sub1g_rssi_threshold
777
- )
778
- return False
779
-
780
- def dump(self):
781
- string = bitstruct.pack("u4u4u8u8u48u32u32s8s8u40", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.sensor0, self.sensor1, ((self.rssi_threshold-0)//-1), ((self.sub1g_rssi_threshold-0)//-1), self.unused)
782
- return string.hex().upper()
783
-
784
- def set(self, string):
785
- d = bitstruct.unpack("u4u4u8u8u48u32u32s8s8u40", binascii.unhexlify(string))
786
- self.module_type = d[0]
787
- self.msg_type = d[1]
788
- self.api_version = d[2]
789
- self.seq_id = d[3]
790
- self.brg_mac = d[4]
791
- self.sensor0 = d[5]
792
- self.sensor1 = d[6]
793
- self.rssi_threshold = ((d[7]*-1)+0)
794
- self.sub1g_rssi_threshold = ((d[8]*-1)+0)
795
- self.unused = d[9]
796
-
797
- class ModuleExtSensorsV11():
798
- def __init__(self, raw='', module_type=MODULE_EXT_SENSORS, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V11, seq_id=0, brg_mac=0, sensor0=BRG_DEFAULT_EXTERNAL_SENSOR_CFG, sensor1=BRG_DEFAULT_EXTERNAL_SENSOR_CFG, unused=0):
799
- self.module_type = module_type
800
- self.msg_type = msg_type
801
- self.api_version = api_version
802
- self.seq_id = seq_id
803
- self.brg_mac = brg_mac
804
- self.sensor0 = sensor0
805
- self.sensor1 = sensor1
806
- self.unused = unused
807
- if raw:
808
- self.set(raw)
809
-
810
- def __repr__(self) -> str:
811
- return "\n==> Packet module_ext_sensors_v11 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X}", self.module_type],['msg_type', f"0x{self.msg_type:X}", self.msg_type],['api_version', f"0x{self.api_version:X}", self.api_version],['seq_id', f"0x{self.seq_id:X}", self.seq_id],['brg_mac', f"0x{self.brg_mac:X}", self.brg_mac],['sensor0', f"0x{self.sensor0:X}", self.sensor0],['sensor1', f"0x{self.sensor1:X}", self.sensor1]], tablefmt="texttable")
812
-
813
- def __eq__(self, other):
814
- if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
815
- return (
816
- self.module_type == other.module_type and
817
- self.msg_type == other.msg_type and
818
- self.api_version == other.api_version and
819
- self.brg_mac == other.brg_mac and
820
- self.sensor0 == other.sensor0 and
821
- self.sensor1 == other.sensor1
822
- )
823
- return False
824
-
825
- def dump(self):
826
- string = bitstruct.pack("u4u4u8u8u48u32u32u56", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.sensor0, self.sensor1, self.unused)
827
- return string.hex().upper()
828
-
829
- def set(self, string):
830
- d = bitstruct.unpack("u4u4u8u8u48u32u32u56", binascii.unhexlify(string))
831
- self.module_type = d[0]
832
- self.msg_type = d[1]
833
- self.api_version = d[2]
834
- self.seq_id = d[3]
835
- self.brg_mac = d[4]
836
- self.sensor0 = d[5]
837
- self.sensor1 = d[6]
838
- self.unused = d[7]
839
-
840
- class ModuleCustomV12():
841
- def __init__(self, raw='', module_type=MODULE_CUSTOM, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, motion_sensitivity_threshold=LIS2DW12_DEFAULTS_MOTION_SENSITIVITY_THRESHOLD, s2d_transition_time=LIS2DW12_DEFAULTS_S2D_TRANSITION_TIME, d2s_transition_time=LIS2DW12_DEFAULTS_D2S_TRANSITION_TIME, unused1=0):
842
- self.module_type = module_type
843
- self.msg_type = msg_type
844
- self.api_version = api_version
845
- self.seq_id = seq_id
846
- self.brg_mac = brg_mac
847
- self.motion_sensitivity_threshold = motion_sensitivity_threshold # 31 [mg] resolution
848
- self.s2d_transition_time = s2d_transition_time # 3 [sec] resolution
849
- self.d2s_transition_time = d2s_transition_time # 5 [sec] resolution
850
- self.unused1 = unused1
851
- if raw:
852
- self.set(raw)
853
-
854
- def __repr__(self) -> str:
855
- return "\n==> Packet module_custom_v12 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X}", self.module_type],['msg_type', f"0x{self.msg_type:X}", self.msg_type],['api_version', f"0x{self.api_version:X}", self.api_version],['seq_id', f"0x{self.seq_id:X}", self.seq_id],['brg_mac', f"0x{self.brg_mac:X}", self.brg_mac],['motion_sensitivity_threshold', f"0x{self.motion_sensitivity_threshold:X}", self.motion_sensitivity_threshold],['s2d_transition_time', f"0x{self.s2d_transition_time:X}", self.s2d_transition_time],['d2s_transition_time', f"0x{self.d2s_transition_time:X}", self.d2s_transition_time]], tablefmt="texttable")
856
-
857
- def __eq__(self, other):
858
- if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
859
- return (
860
- self.module_type == other.module_type and
861
- self.msg_type == other.msg_type and
862
- self.api_version == other.api_version and
863
- self.brg_mac == other.brg_mac and
864
- self.motion_sensitivity_threshold == other.motion_sensitivity_threshold and
865
- self.s2d_transition_time == other.s2d_transition_time and
866
- self.d2s_transition_time == other.d2s_transition_time
867
- )
868
- return False
869
-
870
- def dump(self):
871
- string = bitstruct.pack("u4u4u8u8u48u8u8u8u96", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, ((self.motion_sensitivity_threshold-0)//31), ((self.s2d_transition_time-0)//3), ((self.d2s_transition_time-0)//5), self.unused1)
872
- return string.hex().upper()
873
-
874
- def set(self, string):
875
- d = bitstruct.unpack("u4u4u8u8u48u8u8u8u96", binascii.unhexlify(string))
876
- self.module_type = d[0]
877
- self.msg_type = d[1]
878
- self.api_version = d[2]
879
- self.seq_id = d[3]
880
- self.brg_mac = d[4]
881
- self.motion_sensitivity_threshold = ((d[5]*31)+0)
882
- self.s2d_transition_time = ((d[6]*3)+0)
883
- self.d2s_transition_time = ((d[7]*5)+0)
884
- self.unused1 = d[8]
885
-
886
- class ModuleCustomV11():
887
- def __init__(self, raw='', module_type=MODULE_CUSTOM, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V11, seq_id=0, brg_mac=0, state_threshold=1953, wake_up_duration=189, sleep_duration=75, unused1=0):
888
- self.module_type = module_type
889
- self.msg_type = msg_type
890
- self.api_version = api_version
891
- self.seq_id = seq_id
892
- self.brg_mac = brg_mac
893
- self.state_threshold = state_threshold # 31 [mg] resolution
894
- self.wake_up_duration = wake_up_duration # 3 [sec] resolution
895
- self.sleep_duration = sleep_duration # 5 [sec] resolution
896
- self.unused1 = unused1
897
- if raw:
898
- self.set(raw)
899
-
900
- def __repr__(self) -> str:
901
- return "\n==> Packet module_custom_v11 <==\n" + tabulate.tabulate([['module_type', f"0x{self.module_type:X}", self.module_type],['msg_type', f"0x{self.msg_type:X}", self.msg_type],['api_version', f"0x{self.api_version:X}", self.api_version],['seq_id', f"0x{self.seq_id:X}", self.seq_id],['brg_mac', f"0x{self.brg_mac:X}", self.brg_mac],['state_threshold', f"0x{self.state_threshold:X}", self.state_threshold],['wake_up_duration', f"0x{self.wake_up_duration:X}", self.wake_up_duration],['sleep_duration', f"0x{self.sleep_duration:X}", self.sleep_duration]], tablefmt="texttable")
902
-
903
- def __eq__(self, other):
904
- if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
905
- return (
906
- self.module_type == other.module_type and
907
- self.msg_type == other.msg_type and
908
- self.api_version == other.api_version and
909
- self.brg_mac == other.brg_mac and
910
- self.state_threshold == other.state_threshold and
911
- self.wake_up_duration == other.wake_up_duration and
912
- self.sleep_duration == other.sleep_duration
913
- )
914
- return False
915
-
916
- def dump(self):
917
- string = bitstruct.pack("u4u4u8u8u48u8u8u8u96", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, ((self.state_threshold-0)//31), ((self.wake_up_duration-0)//3), ((self.sleep_duration-0)//5), self.unused1)
918
- return string.hex().upper()
919
-
920
- def set(self, string):
921
- d = bitstruct.unpack("u4u4u8u8u48u8u8u8u96", binascii.unhexlify(string))
922
- self.module_type = d[0]
923
- self.msg_type = d[1]
924
- self.api_version = d[2]
925
- self.seq_id = d[3]
926
- self.brg_mac = d[4]
927
- self.state_threshold = ((d[5]*31)+0)
928
- self.wake_up_duration = ((d[6]*3)+0)
929
- self.sleep_duration = ((d[7]*5)+0)
930
- self.unused1 = d[8]
931
-