wiliot-certificate 4.4.0__py3-none-any.whl → 4.4.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- brg_certificate/ag/energous_v0_defines.py +114 -105
- brg_certificate/ag/energous_v1_defines.py +114 -105
- brg_certificate/ag/energous_v2_defines.py +114 -105
- brg_certificate/ag/energous_v3_defines.py +114 -105
- brg_certificate/ag/energous_v4_defines.py +114 -105
- brg_certificate/ag/fanstel_lan_v0_defines.py +114 -105
- brg_certificate/ag/fanstel_lte_v0_defines.py +114 -105
- brg_certificate/ag/fanstel_wifi_v0_defines.py +114 -105
- brg_certificate/ag/minew_lte_v0_defines.py +114 -105
- brg_certificate/ag/wlt_types.html +153 -986
- brg_certificate/ag/wlt_types_ag.py +268 -1346
- brg_certificate/ag/wlt_types_ag_jsons/brg2brg_ota.json +0 -69
- brg_certificate/ag/wlt_types_ag_jsons/brg2gw_hb.json +0 -101
- brg_certificate/ag/wlt_types_ag_jsons/brg2gw_hb_sleep.json +0 -45
- brg_certificate/ag/wlt_types_ag_jsons/calibration.json +0 -75
- brg_certificate/ag/wlt_types_ag_jsons/custom.json +0 -99
- brg_certificate/ag/wlt_types_ag_jsons/datapath.json +8 -133
- brg_certificate/ag/wlt_types_ag_jsons/energy2400.json +0 -99
- brg_certificate/ag/wlt_types_ag_jsons/energySub1g.json +0 -96
- brg_certificate/ag/wlt_types_ag_jsons/externalSensor.json +0 -113
- brg_certificate/ag/wlt_types_ag_jsons/interface.json +0 -157
- brg_certificate/ag/wlt_types_ag_jsons/powerManagement.json +0 -205
- {wiliot_certificate-4.4.0.dist-info → wiliot_certificate-4.4.1.dist-info}/METADATA +7 -7
- {wiliot_certificate-4.4.0.dist-info → wiliot_certificate-4.4.1.dist-info}/RECORD +28 -28
- {wiliot_certificate-4.4.0.dist-info → wiliot_certificate-4.4.1.dist-info}/WHEEL +0 -0
- {wiliot_certificate-4.4.0.dist-info → wiliot_certificate-4.4.1.dist-info}/entry_points.txt +0 -0
- {wiliot_certificate-4.4.0.dist-info → wiliot_certificate-4.4.1.dist-info}/licenses/LICENSE +0 -0
- {wiliot_certificate-4.4.0.dist-info → wiliot_certificate-4.4.1.dist-info}/top_level.txt +0 -0
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
import bitstruct
|
|
4
4
|
import binascii
|
|
5
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,
|
|
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
7
|
|
|
8
8
|
# Board Overwritten defines
|
|
9
9
|
BRG_DEFAULT_CALIBRATION_OUTPUT_POWER = OUTPUT_POWER_2_4_POS_3
|
|
10
10
|
BRG_DEFAULT_DATAPATH_OUTPUT_POWER = OUTPUT_POWER_2_4_POS_3
|
|
11
11
|
BRG_DEFAULT_OUTPUT_POWER_2_4 = OUTPUT_POWER_2_4_POS_3
|
|
12
12
|
|
|
13
|
-
class
|
|
14
|
-
def __init__(self, raw='', module_type=MODULE_IF, msg_type=BRG_MGMT_MSG_TYPE_CFG_INFO, api_version=
|
|
13
|
+
class ModuleIfV12():
|
|
14
|
+
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):
|
|
15
15
|
self.module_type = module_type
|
|
16
16
|
self.msg_type = msg_type
|
|
17
17
|
self.api_version = api_version
|
|
@@ -36,7 +36,7 @@ class ModuleIfV13():
|
|
|
36
36
|
self.set(raw)
|
|
37
37
|
|
|
38
38
|
def __repr__(self) -> str:
|
|
39
|
-
return "\n==> Packet
|
|
39
|
+
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")
|
|
40
40
|
|
|
41
41
|
def __eq__(self, other):
|
|
42
42
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -89,8 +89,8 @@ class ModuleIfV13():
|
|
|
89
89
|
self.cfg_hash = d[18]
|
|
90
90
|
self.unused0 = d[19]
|
|
91
91
|
|
|
92
|
-
class
|
|
93
|
-
def __init__(self, raw='', module_type=MODULE_IF, msg_type=BRG_MGMT_MSG_TYPE_CFG_INFO, api_version=
|
|
92
|
+
class ModuleIfV11():
|
|
93
|
+
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):
|
|
94
94
|
self.module_type = module_type
|
|
95
95
|
self.msg_type = msg_type
|
|
96
96
|
self.api_version = api_version
|
|
@@ -115,7 +115,7 @@ class ModuleIfV12():
|
|
|
115
115
|
self.set(raw)
|
|
116
116
|
|
|
117
117
|
def __repr__(self) -> str:
|
|
118
|
-
return "\n==> Packet
|
|
118
|
+
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")
|
|
119
119
|
|
|
120
120
|
def __eq__(self, other):
|
|
121
121
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -168,8 +168,8 @@ class ModuleIfV12():
|
|
|
168
168
|
self.cfg_hash = d[18]
|
|
169
169
|
self.unused0 = d[19]
|
|
170
170
|
|
|
171
|
-
class
|
|
172
|
-
def __init__(self, raw='', module_type=MODULE_CALIBRATION, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=
|
|
171
|
+
class ModuleCalibrationV12():
|
|
172
|
+
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):
|
|
173
173
|
self.module_type = module_type
|
|
174
174
|
self.msg_type = msg_type
|
|
175
175
|
self.api_version = api_version
|
|
@@ -184,7 +184,7 @@ class ModuleCalibrationV13():
|
|
|
184
184
|
self.set(raw)
|
|
185
185
|
|
|
186
186
|
def __repr__(self) -> str:
|
|
187
|
-
return "\n==> Packet
|
|
187
|
+
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")
|
|
188
188
|
|
|
189
189
|
def __eq__(self, other):
|
|
190
190
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -216,8 +216,8 @@ class ModuleCalibrationV13():
|
|
|
216
216
|
self.unused0 = d[8]
|
|
217
217
|
self.unused1 = d[9]
|
|
218
218
|
|
|
219
|
-
class
|
|
220
|
-
def __init__(self, raw='', module_type=MODULE_CALIBRATION, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=
|
|
219
|
+
class ModuleCalibrationV11():
|
|
220
|
+
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):
|
|
221
221
|
self.module_type = module_type
|
|
222
222
|
self.msg_type = msg_type
|
|
223
223
|
self.api_version = api_version
|
|
@@ -232,7 +232,7 @@ class ModuleCalibrationV12():
|
|
|
232
232
|
self.set(raw)
|
|
233
233
|
|
|
234
234
|
def __repr__(self) -> str:
|
|
235
|
-
return "\n==> Packet
|
|
235
|
+
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")
|
|
236
236
|
|
|
237
237
|
def __eq__(self, other):
|
|
238
238
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -264,8 +264,8 @@ class ModuleCalibrationV12():
|
|
|
264
264
|
self.unused0 = d[8]
|
|
265
265
|
self.unused1 = d[9]
|
|
266
266
|
|
|
267
|
-
class
|
|
268
|
-
def __init__(self, raw='', module_type=MODULE_DATAPATH, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=
|
|
267
|
+
class ModuleDatapathV12():
|
|
268
|
+
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):
|
|
269
269
|
self.module_type = module_type
|
|
270
270
|
self.msg_type = msg_type
|
|
271
271
|
self.api_version = api_version
|
|
@@ -283,7 +283,7 @@ class ModuleDatapathV13():
|
|
|
283
283
|
self.set(raw)
|
|
284
284
|
|
|
285
285
|
def __repr__(self) -> str:
|
|
286
|
-
return "\n==> Packet
|
|
286
|
+
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")
|
|
287
287
|
|
|
288
288
|
def __eq__(self, other):
|
|
289
289
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -322,26 +322,29 @@ class ModuleDatapathV13():
|
|
|
322
322
|
self.rx_channel = d[11]
|
|
323
323
|
self.unused0 = d[12]
|
|
324
324
|
|
|
325
|
-
class
|
|
326
|
-
def __init__(self, raw='', module_type=MODULE_DATAPATH, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=
|
|
325
|
+
class ModuleDatapathV11():
|
|
326
|
+
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):
|
|
327
327
|
self.module_type = module_type
|
|
328
328
|
self.msg_type = msg_type
|
|
329
329
|
self.api_version = api_version
|
|
330
330
|
self.seq_id = seq_id
|
|
331
331
|
self.brg_mac = brg_mac
|
|
332
|
-
self.
|
|
332
|
+
self.unused1 = unused1
|
|
333
|
+
self.unused0 = unused0
|
|
334
|
+
self.adaptive_pacer = adaptive_pacer
|
|
335
|
+
self.unified_echo_pkt = unified_echo_pkt
|
|
333
336
|
self.pacer_interval = pacer_interval
|
|
334
337
|
self.pkt_filter = pkt_filter
|
|
335
338
|
self.tx_repetition = tx_repetition
|
|
336
339
|
self.output_power = output_power
|
|
337
340
|
self.pattern = pattern
|
|
338
341
|
self.rx_channel = rx_channel
|
|
339
|
-
self.
|
|
342
|
+
self.unused2 = unused2
|
|
340
343
|
if raw:
|
|
341
344
|
self.set(raw)
|
|
342
345
|
|
|
343
346
|
def __repr__(self) -> str:
|
|
344
|
-
return "\n==> Packet
|
|
347
|
+
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")
|
|
345
348
|
|
|
346
349
|
def __eq__(self, other):
|
|
347
350
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -350,7 +353,8 @@ class ModuleDatapathV12():
|
|
|
350
353
|
self.msg_type == other.msg_type and
|
|
351
354
|
self.api_version == other.api_version and
|
|
352
355
|
self.brg_mac == other.brg_mac and
|
|
353
|
-
self.
|
|
356
|
+
self.adaptive_pacer == other.adaptive_pacer and
|
|
357
|
+
self.unified_echo_pkt == other.unified_echo_pkt and
|
|
354
358
|
self.pacer_interval == other.pacer_interval and
|
|
355
359
|
self.pkt_filter == other.pkt_filter and
|
|
356
360
|
self.tx_repetition == other.tx_repetition and
|
|
@@ -361,29 +365,32 @@ class ModuleDatapathV12():
|
|
|
361
365
|
return False
|
|
362
366
|
|
|
363
367
|
def dump(self):
|
|
364
|
-
string = bitstruct.pack("
|
|
368
|
+
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)
|
|
365
369
|
return string.hex().upper()
|
|
366
370
|
|
|
367
371
|
def set(self, string):
|
|
368
|
-
d = bitstruct.unpack("
|
|
372
|
+
d = bitstruct.unpack("u4u4u8u8u48u4u2u1u1u16u5u3s8u4u4u72", binascii.unhexlify(string))
|
|
369
373
|
self.module_type = d[0]
|
|
370
374
|
self.msg_type = d[1]
|
|
371
375
|
self.api_version = d[2]
|
|
372
376
|
self.seq_id = d[3]
|
|
373
377
|
self.brg_mac = d[4]
|
|
374
|
-
self.
|
|
375
|
-
self.
|
|
376
|
-
self.
|
|
377
|
-
self.
|
|
378
|
-
self.
|
|
379
|
-
self.
|
|
380
|
-
self.
|
|
381
|
-
self.
|
|
378
|
+
self.unused1 = d[5]
|
|
379
|
+
self.unused0 = d[6]
|
|
380
|
+
self.adaptive_pacer = d[7]
|
|
381
|
+
self.unified_echo_pkt = d[8]
|
|
382
|
+
self.pacer_interval = d[9]
|
|
383
|
+
self.pkt_filter = d[10]
|
|
384
|
+
self.tx_repetition = d[11]
|
|
385
|
+
self.output_power = d[12]
|
|
386
|
+
self.pattern = d[13]
|
|
387
|
+
self.rx_channel = d[14]
|
|
388
|
+
self.unused2 = d[15]
|
|
382
389
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
class
|
|
386
|
-
def __init__(self, raw='', module_type=MODULE_ENERGY_2400, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=
|
|
390
|
+
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}
|
|
391
|
+
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}
|
|
392
|
+
class ModuleEnergy2400V12():
|
|
393
|
+
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):
|
|
387
394
|
self.module_type = module_type
|
|
388
395
|
self.msg_type = msg_type
|
|
389
396
|
self.api_version = api_version
|
|
@@ -399,7 +406,7 @@ class ModuleEnergy2400V13():
|
|
|
399
406
|
self.set(raw)
|
|
400
407
|
|
|
401
408
|
def __repr__(self) -> str:
|
|
402
|
-
return "\n==> Packet
|
|
409
|
+
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")
|
|
403
410
|
|
|
404
411
|
def __eq__(self, other):
|
|
405
412
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -417,7 +424,7 @@ class ModuleEnergy2400V13():
|
|
|
417
424
|
return False
|
|
418
425
|
|
|
419
426
|
def dump(self):
|
|
420
|
-
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,
|
|
427
|
+
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)
|
|
421
428
|
return string.hex().upper()
|
|
422
429
|
|
|
423
430
|
def set(self, string):
|
|
@@ -431,13 +438,13 @@ class ModuleEnergy2400V13():
|
|
|
431
438
|
self.pattern = d[6]
|
|
432
439
|
self.output_power = d[7]
|
|
433
440
|
self.signal_indicator_cycle = d[8]
|
|
434
|
-
self.signal_indicator_rep =
|
|
441
|
+
self.signal_indicator_rep = MODULE_ENERGY_2400_V12_SIGNAL_INDICATOR_REP_DEC[d[9]]
|
|
435
442
|
self.unused0 = d[10]
|
|
436
443
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
class
|
|
440
|
-
def __init__(self, raw='', module_type=MODULE_ENERGY_2400, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=
|
|
444
|
+
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}
|
|
445
|
+
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}
|
|
446
|
+
class ModuleEnergy2400V11():
|
|
447
|
+
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):
|
|
441
448
|
self.module_type = module_type
|
|
442
449
|
self.msg_type = msg_type
|
|
443
450
|
self.api_version = api_version
|
|
@@ -453,7 +460,7 @@ class ModuleEnergy2400V12():
|
|
|
453
460
|
self.set(raw)
|
|
454
461
|
|
|
455
462
|
def __repr__(self) -> str:
|
|
456
|
-
return "\n==> Packet
|
|
463
|
+
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")
|
|
457
464
|
|
|
458
465
|
def __eq__(self, other):
|
|
459
466
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -471,7 +478,7 @@ class ModuleEnergy2400V12():
|
|
|
471
478
|
return False
|
|
472
479
|
|
|
473
480
|
def dump(self):
|
|
474
|
-
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,
|
|
481
|
+
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)
|
|
475
482
|
return string.hex().upper()
|
|
476
483
|
|
|
477
484
|
def set(self, string):
|
|
@@ -485,13 +492,13 @@ class ModuleEnergy2400V12():
|
|
|
485
492
|
self.pattern = d[6]
|
|
486
493
|
self.output_power = d[7]
|
|
487
494
|
self.signal_indicator_cycle = d[8]
|
|
488
|
-
self.signal_indicator_rep =
|
|
495
|
+
self.signal_indicator_rep = MODULE_ENERGY_2400_V11_SIGNAL_INDICATOR_REP_DEC[d[9]]
|
|
489
496
|
self.unused0 = d[10]
|
|
490
497
|
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
class
|
|
494
|
-
def __init__(self, raw='', module_type=MODULE_ENERGY_SUB1G, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=
|
|
498
|
+
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}
|
|
499
|
+
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}
|
|
500
|
+
class ModuleEnergySub1GV12():
|
|
501
|
+
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):
|
|
495
502
|
self.module_type = module_type
|
|
496
503
|
self.msg_type = msg_type
|
|
497
504
|
self.api_version = api_version
|
|
@@ -506,7 +513,7 @@ class ModuleEnergySub1GV13():
|
|
|
506
513
|
self.set(raw)
|
|
507
514
|
|
|
508
515
|
def __repr__(self) -> str:
|
|
509
|
-
return "\n==> Packet
|
|
516
|
+
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")
|
|
510
517
|
|
|
511
518
|
def __eq__(self, other):
|
|
512
519
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -523,7 +530,7 @@ class ModuleEnergySub1GV13():
|
|
|
523
530
|
return False
|
|
524
531
|
|
|
525
532
|
def dump(self):
|
|
526
|
-
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,
|
|
533
|
+
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)
|
|
527
534
|
return string.hex().upper()
|
|
528
535
|
|
|
529
536
|
def set(self, string):
|
|
@@ -536,19 +543,23 @@ class ModuleEnergySub1GV13():
|
|
|
536
543
|
self.pattern = d[5]
|
|
537
544
|
self.duty_cycle = d[6]
|
|
538
545
|
self.signal_indicator_cycle = d[7]
|
|
539
|
-
self.signal_indicator_rep =
|
|
546
|
+
self.signal_indicator_rep = MODULE_ENERGY_SUB1G_V12_SIGNAL_INDICATOR_REP_DEC[d[8]]
|
|
540
547
|
self.unused0 = d[9]
|
|
541
548
|
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
549
|
+
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}
|
|
550
|
+
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}
|
|
551
|
+
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}
|
|
552
|
+
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}
|
|
553
|
+
class ModuleEnergySub1GV11():
|
|
554
|
+
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):
|
|
546
555
|
self.module_type = module_type
|
|
547
556
|
self.msg_type = msg_type
|
|
548
557
|
self.api_version = api_version
|
|
549
558
|
self.seq_id = seq_id
|
|
550
559
|
self.brg_mac = brg_mac
|
|
551
|
-
self.
|
|
560
|
+
self.output_power = output_power
|
|
561
|
+
self.sub1g_energy_pattern = sub1g_energy_pattern
|
|
562
|
+
self.cycle = cycle
|
|
552
563
|
self.duty_cycle = duty_cycle
|
|
553
564
|
self.signal_indicator_cycle = signal_indicator_cycle
|
|
554
565
|
self.signal_indicator_rep = signal_indicator_rep
|
|
@@ -557,7 +568,7 @@ class ModuleEnergySub1GV12():
|
|
|
557
568
|
self.set(raw)
|
|
558
569
|
|
|
559
570
|
def __repr__(self) -> str:
|
|
560
|
-
return "\n==> Packet
|
|
571
|
+
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")
|
|
561
572
|
|
|
562
573
|
def __eq__(self, other):
|
|
563
574
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -566,7 +577,9 @@ class ModuleEnergySub1GV12():
|
|
|
566
577
|
self.msg_type == other.msg_type and
|
|
567
578
|
self.api_version == other.api_version and
|
|
568
579
|
self.brg_mac == other.brg_mac and
|
|
569
|
-
self.
|
|
580
|
+
self.output_power == other.output_power and
|
|
581
|
+
self.sub1g_energy_pattern == other.sub1g_energy_pattern and
|
|
582
|
+
self.cycle == other.cycle and
|
|
570
583
|
self.duty_cycle == other.duty_cycle and
|
|
571
584
|
self.signal_indicator_cycle == other.signal_indicator_cycle and
|
|
572
585
|
self.signal_indicator_rep == other.signal_indicator_rep
|
|
@@ -574,24 +587,26 @@ class ModuleEnergySub1GV12():
|
|
|
574
587
|
return False
|
|
575
588
|
|
|
576
589
|
def dump(self):
|
|
577
|
-
string = bitstruct.pack("
|
|
590
|
+
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)
|
|
578
591
|
return string.hex().upper()
|
|
579
592
|
|
|
580
593
|
def set(self, string):
|
|
581
|
-
d = bitstruct.unpack("
|
|
594
|
+
d = bitstruct.unpack("u4u4u8u8u48u8u8u8u8u14u2u72", binascii.unhexlify(string))
|
|
582
595
|
self.module_type = d[0]
|
|
583
596
|
self.msg_type = d[1]
|
|
584
597
|
self.api_version = d[2]
|
|
585
598
|
self.seq_id = d[3]
|
|
586
599
|
self.brg_mac = d[4]
|
|
587
|
-
self.
|
|
588
|
-
self.
|
|
589
|
-
self.
|
|
590
|
-
self.
|
|
591
|
-
self.
|
|
600
|
+
self.output_power = MODULE_ENERGY_SUB1G_V11_OUTPUT_POWER_DEC[d[5]]
|
|
601
|
+
self.sub1g_energy_pattern = d[6]
|
|
602
|
+
self.cycle = d[7]
|
|
603
|
+
self.duty_cycle = d[8]
|
|
604
|
+
self.signal_indicator_cycle = d[9]
|
|
605
|
+
self.signal_indicator_rep = MODULE_ENERGY_SUB1G_V11_SIGNAL_INDICATOR_REP_DEC[d[10]]
|
|
606
|
+
self.unused0 = d[11]
|
|
592
607
|
|
|
593
|
-
class
|
|
594
|
-
def __init__(self, raw='', module_type=MODULE_PWR_MGMT, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=
|
|
608
|
+
class ModulePwrMgmtV12():
|
|
609
|
+
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):
|
|
595
610
|
self.module_type = module_type
|
|
596
611
|
self.msg_type = msg_type
|
|
597
612
|
self.api_version = api_version
|
|
@@ -612,7 +627,7 @@ class ModulePwrMgmtV13():
|
|
|
612
627
|
self.set(raw)
|
|
613
628
|
|
|
614
629
|
def __repr__(self) -> str:
|
|
615
|
-
return "\n==> Packet
|
|
630
|
+
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")
|
|
616
631
|
|
|
617
632
|
def __eq__(self, other):
|
|
618
633
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -657,8 +672,8 @@ class ModulePwrMgmtV13():
|
|
|
657
672
|
self.dynamic_sleep_duration = ((d[14]*60)+0)
|
|
658
673
|
self.unused0 = d[15]
|
|
659
674
|
|
|
660
|
-
class
|
|
661
|
-
def __init__(self, raw='', module_type=MODULE_PWR_MGMT, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=
|
|
675
|
+
class ModulePwrMgmtV11():
|
|
676
|
+
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):
|
|
662
677
|
self.module_type = module_type
|
|
663
678
|
self.msg_type = msg_type
|
|
664
679
|
self.api_version = api_version
|
|
@@ -679,7 +694,7 @@ class ModulePwrMgmtV12():
|
|
|
679
694
|
self.set(raw)
|
|
680
695
|
|
|
681
696
|
def __repr__(self) -> str:
|
|
682
|
-
return "\n==> Packet
|
|
697
|
+
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")
|
|
683
698
|
|
|
684
699
|
def __eq__(self, other):
|
|
685
700
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -724,8 +739,8 @@ class ModulePwrMgmtV12():
|
|
|
724
739
|
self.dynamic_sleep_duration = ((d[14]*60)+0)
|
|
725
740
|
self.unused0 = d[15]
|
|
726
741
|
|
|
727
|
-
class
|
|
728
|
-
def __init__(self, raw='', module_type=MODULE_EXT_SENSORS, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=
|
|
742
|
+
class ModuleExtSensorsV12():
|
|
743
|
+
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):
|
|
729
744
|
self.module_type = module_type
|
|
730
745
|
self.msg_type = msg_type
|
|
731
746
|
self.api_version = api_version
|
|
@@ -740,7 +755,7 @@ class ModuleExtSensorsV13():
|
|
|
740
755
|
self.set(raw)
|
|
741
756
|
|
|
742
757
|
def __repr__(self) -> str:
|
|
743
|
-
return "\n==> Packet
|
|
758
|
+
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")
|
|
744
759
|
|
|
745
760
|
def __eq__(self, other):
|
|
746
761
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -773,8 +788,8 @@ class ModuleExtSensorsV13():
|
|
|
773
788
|
self.sub1g_rssi_threshold = ((d[8]*-1)+0)
|
|
774
789
|
self.unused = d[9]
|
|
775
790
|
|
|
776
|
-
class
|
|
777
|
-
def __init__(self, raw='', module_type=MODULE_EXT_SENSORS, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=
|
|
791
|
+
class ModuleExtSensorsV11():
|
|
792
|
+
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):
|
|
778
793
|
self.module_type = module_type
|
|
779
794
|
self.msg_type = msg_type
|
|
780
795
|
self.api_version = api_version
|
|
@@ -782,14 +797,12 @@ class ModuleExtSensorsV12():
|
|
|
782
797
|
self.brg_mac = brg_mac
|
|
783
798
|
self.sensor0 = sensor0
|
|
784
799
|
self.sensor1 = sensor1
|
|
785
|
-
self.rssi_threshold = rssi_threshold
|
|
786
|
-
self.sub1g_rssi_threshold = sub1g_rssi_threshold
|
|
787
800
|
self.unused = unused
|
|
788
801
|
if raw:
|
|
789
802
|
self.set(raw)
|
|
790
803
|
|
|
791
804
|
def __repr__(self) -> str:
|
|
792
|
-
return "\n==> Packet
|
|
805
|
+
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")
|
|
793
806
|
|
|
794
807
|
def __eq__(self, other):
|
|
795
808
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -799,18 +812,16 @@ class ModuleExtSensorsV12():
|
|
|
799
812
|
self.api_version == other.api_version and
|
|
800
813
|
self.brg_mac == other.brg_mac and
|
|
801
814
|
self.sensor0 == other.sensor0 and
|
|
802
|
-
self.sensor1 == other.sensor1
|
|
803
|
-
self.rssi_threshold == other.rssi_threshold and
|
|
804
|
-
self.sub1g_rssi_threshold == other.sub1g_rssi_threshold
|
|
815
|
+
self.sensor1 == other.sensor1
|
|
805
816
|
)
|
|
806
817
|
return False
|
|
807
818
|
|
|
808
819
|
def dump(self):
|
|
809
|
-
string = bitstruct.pack("
|
|
820
|
+
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)
|
|
810
821
|
return string.hex().upper()
|
|
811
822
|
|
|
812
823
|
def set(self, string):
|
|
813
|
-
d = bitstruct.unpack("
|
|
824
|
+
d = bitstruct.unpack("u4u4u8u8u48u32u32u56", binascii.unhexlify(string))
|
|
814
825
|
self.module_type = d[0]
|
|
815
826
|
self.msg_type = d[1]
|
|
816
827
|
self.api_version = d[2]
|
|
@@ -818,12 +829,10 @@ class ModuleExtSensorsV12():
|
|
|
818
829
|
self.brg_mac = d[4]
|
|
819
830
|
self.sensor0 = d[5]
|
|
820
831
|
self.sensor1 = d[6]
|
|
821
|
-
self.
|
|
822
|
-
self.sub1g_rssi_threshold = ((d[8]*-1)+0)
|
|
823
|
-
self.unused = d[9]
|
|
832
|
+
self.unused = d[7]
|
|
824
833
|
|
|
825
|
-
class
|
|
826
|
-
def __init__(self, raw='', module_type=MODULE_CUSTOM, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=
|
|
834
|
+
class ModuleCustomV12():
|
|
835
|
+
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):
|
|
827
836
|
self.module_type = module_type
|
|
828
837
|
self.msg_type = msg_type
|
|
829
838
|
self.api_version = api_version
|
|
@@ -837,7 +846,7 @@ class ModuleCustomV13():
|
|
|
837
846
|
self.set(raw)
|
|
838
847
|
|
|
839
848
|
def __repr__(self) -> str:
|
|
840
|
-
return "\n==> Packet
|
|
849
|
+
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")
|
|
841
850
|
|
|
842
851
|
def __eq__(self, other):
|
|
843
852
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -868,22 +877,22 @@ class ModuleCustomV13():
|
|
|
868
877
|
self.d2s_transition_time = ((d[7]*5)+0)
|
|
869
878
|
self.unused1 = d[8]
|
|
870
879
|
|
|
871
|
-
class
|
|
872
|
-
def __init__(self, raw='', module_type=MODULE_CUSTOM, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=
|
|
880
|
+
class ModuleCustomV11():
|
|
881
|
+
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):
|
|
873
882
|
self.module_type = module_type
|
|
874
883
|
self.msg_type = msg_type
|
|
875
884
|
self.api_version = api_version
|
|
876
885
|
self.seq_id = seq_id
|
|
877
886
|
self.brg_mac = brg_mac
|
|
878
|
-
self.
|
|
879
|
-
self.
|
|
880
|
-
self.
|
|
887
|
+
self.state_threshold = state_threshold # 31 [mg] resolution
|
|
888
|
+
self.wake_up_duration = wake_up_duration # 3 [sec] resolution
|
|
889
|
+
self.sleep_duration = sleep_duration # 5 [sec] resolution
|
|
881
890
|
self.unused1 = unused1
|
|
882
891
|
if raw:
|
|
883
892
|
self.set(raw)
|
|
884
893
|
|
|
885
894
|
def __repr__(self) -> str:
|
|
886
|
-
return "\n==> Packet
|
|
895
|
+
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")
|
|
887
896
|
|
|
888
897
|
def __eq__(self, other):
|
|
889
898
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -892,14 +901,14 @@ class ModuleCustomV12():
|
|
|
892
901
|
self.msg_type == other.msg_type and
|
|
893
902
|
self.api_version == other.api_version and
|
|
894
903
|
self.brg_mac == other.brg_mac and
|
|
895
|
-
self.
|
|
896
|
-
self.
|
|
897
|
-
self.
|
|
904
|
+
self.state_threshold == other.state_threshold and
|
|
905
|
+
self.wake_up_duration == other.wake_up_duration and
|
|
906
|
+
self.sleep_duration == other.sleep_duration
|
|
898
907
|
)
|
|
899
908
|
return False
|
|
900
909
|
|
|
901
910
|
def dump(self):
|
|
902
|
-
string = bitstruct.pack("u4u4u8u8u48u8u8u8u96", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, ((self.
|
|
911
|
+
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)
|
|
903
912
|
return string.hex().upper()
|
|
904
913
|
|
|
905
914
|
def set(self, string):
|
|
@@ -909,8 +918,8 @@ class ModuleCustomV12():
|
|
|
909
918
|
self.api_version = d[2]
|
|
910
919
|
self.seq_id = d[3]
|
|
911
920
|
self.brg_mac = d[4]
|
|
912
|
-
self.
|
|
913
|
-
self.
|
|
914
|
-
self.
|
|
921
|
+
self.state_threshold = ((d[5]*31)+0)
|
|
922
|
+
self.wake_up_duration = ((d[6]*3)+0)
|
|
923
|
+
self.sleep_duration = ((d[7]*5)+0)
|
|
915
924
|
self.unused1 = d[8]
|
|
916
925
|
|