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,7 +3,7 @@
|
|
|
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
|
|
@@ -16,8 +16,8 @@ BRG_DEFAULT_TX_PERIOD = 40
|
|
|
16
16
|
BRG_DEFAULT_ENERGY_PATTERN_IDX_OLD = 71
|
|
17
17
|
BRG_DEFAULT_RXTX_PERIOD = 100
|
|
18
18
|
|
|
19
|
-
class
|
|
20
|
-
def __init__(self, raw='', module_type=MODULE_IF, msg_type=BRG_MGMT_MSG_TYPE_CFG_INFO, api_version=
|
|
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
21
|
self.module_type = module_type
|
|
22
22
|
self.msg_type = msg_type
|
|
23
23
|
self.api_version = api_version
|
|
@@ -42,7 +42,7 @@ class ModuleIfV13():
|
|
|
42
42
|
self.set(raw)
|
|
43
43
|
|
|
44
44
|
def __repr__(self) -> str:
|
|
45
|
-
return "\n==> Packet
|
|
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
46
|
|
|
47
47
|
def __eq__(self, other):
|
|
48
48
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -95,8 +95,8 @@ class ModuleIfV13():
|
|
|
95
95
|
self.cfg_hash = d[18]
|
|
96
96
|
self.unused0 = d[19]
|
|
97
97
|
|
|
98
|
-
class
|
|
99
|
-
def __init__(self, raw='', module_type=MODULE_IF, msg_type=BRG_MGMT_MSG_TYPE_CFG_INFO, api_version=
|
|
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
100
|
self.module_type = module_type
|
|
101
101
|
self.msg_type = msg_type
|
|
102
102
|
self.api_version = api_version
|
|
@@ -121,7 +121,7 @@ class ModuleIfV12():
|
|
|
121
121
|
self.set(raw)
|
|
122
122
|
|
|
123
123
|
def __repr__(self) -> str:
|
|
124
|
-
return "\n==> Packet
|
|
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
125
|
|
|
126
126
|
def __eq__(self, other):
|
|
127
127
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -174,8 +174,8 @@ class ModuleIfV12():
|
|
|
174
174
|
self.cfg_hash = d[18]
|
|
175
175
|
self.unused0 = d[19]
|
|
176
176
|
|
|
177
|
-
class
|
|
178
|
-
def __init__(self, raw='', module_type=MODULE_CALIBRATION, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=
|
|
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
179
|
self.module_type = module_type
|
|
180
180
|
self.msg_type = msg_type
|
|
181
181
|
self.api_version = api_version
|
|
@@ -190,7 +190,7 @@ class ModuleCalibrationV13():
|
|
|
190
190
|
self.set(raw)
|
|
191
191
|
|
|
192
192
|
def __repr__(self) -> str:
|
|
193
|
-
return "\n==> Packet
|
|
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
194
|
|
|
195
195
|
def __eq__(self, other):
|
|
196
196
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -222,8 +222,8 @@ class ModuleCalibrationV13():
|
|
|
222
222
|
self.unused0 = d[8]
|
|
223
223
|
self.unused1 = d[9]
|
|
224
224
|
|
|
225
|
-
class
|
|
226
|
-
def __init__(self, raw='', module_type=MODULE_CALIBRATION, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=
|
|
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
227
|
self.module_type = module_type
|
|
228
228
|
self.msg_type = msg_type
|
|
229
229
|
self.api_version = api_version
|
|
@@ -238,7 +238,7 @@ class ModuleCalibrationV12():
|
|
|
238
238
|
self.set(raw)
|
|
239
239
|
|
|
240
240
|
def __repr__(self) -> str:
|
|
241
|
-
return "\n==> Packet
|
|
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
242
|
|
|
243
243
|
def __eq__(self, other):
|
|
244
244
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -270,8 +270,8 @@ class ModuleCalibrationV12():
|
|
|
270
270
|
self.unused0 = d[8]
|
|
271
271
|
self.unused1 = d[9]
|
|
272
272
|
|
|
273
|
-
class
|
|
274
|
-
def __init__(self, raw='', module_type=MODULE_DATAPATH, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=
|
|
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
275
|
self.module_type = module_type
|
|
276
276
|
self.msg_type = msg_type
|
|
277
277
|
self.api_version = api_version
|
|
@@ -289,7 +289,7 @@ class ModuleDatapathV13():
|
|
|
289
289
|
self.set(raw)
|
|
290
290
|
|
|
291
291
|
def __repr__(self) -> str:
|
|
292
|
-
return "\n==> Packet
|
|
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
293
|
|
|
294
294
|
def __eq__(self, other):
|
|
295
295
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -328,26 +328,29 @@ class ModuleDatapathV13():
|
|
|
328
328
|
self.rx_channel = d[11]
|
|
329
329
|
self.unused0 = d[12]
|
|
330
330
|
|
|
331
|
-
class
|
|
332
|
-
def __init__(self, raw='', module_type=MODULE_DATAPATH, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=
|
|
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
333
|
self.module_type = module_type
|
|
334
334
|
self.msg_type = msg_type
|
|
335
335
|
self.api_version = api_version
|
|
336
336
|
self.seq_id = seq_id
|
|
337
337
|
self.brg_mac = brg_mac
|
|
338
|
-
self.
|
|
338
|
+
self.unused1 = unused1
|
|
339
|
+
self.unused0 = unused0
|
|
340
|
+
self.adaptive_pacer = adaptive_pacer
|
|
341
|
+
self.unified_echo_pkt = unified_echo_pkt
|
|
339
342
|
self.pacer_interval = pacer_interval
|
|
340
343
|
self.pkt_filter = pkt_filter
|
|
341
344
|
self.tx_repetition = tx_repetition
|
|
342
345
|
self.output_power = output_power
|
|
343
346
|
self.pattern = pattern
|
|
344
347
|
self.rx_channel = rx_channel
|
|
345
|
-
self.
|
|
348
|
+
self.unused2 = unused2
|
|
346
349
|
if raw:
|
|
347
350
|
self.set(raw)
|
|
348
351
|
|
|
349
352
|
def __repr__(self) -> str:
|
|
350
|
-
return "\n==> Packet
|
|
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")
|
|
351
354
|
|
|
352
355
|
def __eq__(self, other):
|
|
353
356
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -356,7 +359,8 @@ class ModuleDatapathV12():
|
|
|
356
359
|
self.msg_type == other.msg_type and
|
|
357
360
|
self.api_version == other.api_version and
|
|
358
361
|
self.brg_mac == other.brg_mac and
|
|
359
|
-
self.
|
|
362
|
+
self.adaptive_pacer == other.adaptive_pacer and
|
|
363
|
+
self.unified_echo_pkt == other.unified_echo_pkt and
|
|
360
364
|
self.pacer_interval == other.pacer_interval and
|
|
361
365
|
self.pkt_filter == other.pkt_filter and
|
|
362
366
|
self.tx_repetition == other.tx_repetition and
|
|
@@ -367,29 +371,32 @@ class ModuleDatapathV12():
|
|
|
367
371
|
return False
|
|
368
372
|
|
|
369
373
|
def dump(self):
|
|
370
|
-
string = bitstruct.pack("
|
|
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)
|
|
371
375
|
return string.hex().upper()
|
|
372
376
|
|
|
373
377
|
def set(self, string):
|
|
374
|
-
d = bitstruct.unpack("
|
|
378
|
+
d = bitstruct.unpack("u4u4u8u8u48u4u2u1u1u16u5u3s8u4u4u72", binascii.unhexlify(string))
|
|
375
379
|
self.module_type = d[0]
|
|
376
380
|
self.msg_type = d[1]
|
|
377
381
|
self.api_version = d[2]
|
|
378
382
|
self.seq_id = d[3]
|
|
379
383
|
self.brg_mac = d[4]
|
|
380
|
-
self.
|
|
381
|
-
self.
|
|
382
|
-
self.
|
|
383
|
-
self.
|
|
384
|
-
self.
|
|
385
|
-
self.
|
|
386
|
-
self.
|
|
387
|
-
self.
|
|
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]
|
|
388
395
|
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
class
|
|
392
|
-
def __init__(self, raw='', module_type=MODULE_ENERGY_2400, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=
|
|
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):
|
|
393
400
|
self.module_type = module_type
|
|
394
401
|
self.msg_type = msg_type
|
|
395
402
|
self.api_version = api_version
|
|
@@ -405,7 +412,7 @@ class ModuleEnergy2400V13():
|
|
|
405
412
|
self.set(raw)
|
|
406
413
|
|
|
407
414
|
def __repr__(self) -> str:
|
|
408
|
-
return "\n==> Packet
|
|
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")
|
|
409
416
|
|
|
410
417
|
def __eq__(self, other):
|
|
411
418
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -423,7 +430,7 @@ class ModuleEnergy2400V13():
|
|
|
423
430
|
return False
|
|
424
431
|
|
|
425
432
|
def dump(self):
|
|
426
|
-
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,
|
|
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)
|
|
427
434
|
return string.hex().upper()
|
|
428
435
|
|
|
429
436
|
def set(self, string):
|
|
@@ -437,13 +444,13 @@ class ModuleEnergy2400V13():
|
|
|
437
444
|
self.pattern = d[6]
|
|
438
445
|
self.output_power = d[7]
|
|
439
446
|
self.signal_indicator_cycle = d[8]
|
|
440
|
-
self.signal_indicator_rep =
|
|
447
|
+
self.signal_indicator_rep = MODULE_ENERGY_2400_V12_SIGNAL_INDICATOR_REP_DEC[d[9]]
|
|
441
448
|
self.unused0 = d[10]
|
|
442
449
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
class
|
|
446
|
-
def __init__(self, raw='', module_type=MODULE_ENERGY_2400, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=
|
|
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):
|
|
447
454
|
self.module_type = module_type
|
|
448
455
|
self.msg_type = msg_type
|
|
449
456
|
self.api_version = api_version
|
|
@@ -459,7 +466,7 @@ class ModuleEnergy2400V12():
|
|
|
459
466
|
self.set(raw)
|
|
460
467
|
|
|
461
468
|
def __repr__(self) -> str:
|
|
462
|
-
return "\n==> Packet
|
|
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")
|
|
463
470
|
|
|
464
471
|
def __eq__(self, other):
|
|
465
472
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -477,7 +484,7 @@ class ModuleEnergy2400V12():
|
|
|
477
484
|
return False
|
|
478
485
|
|
|
479
486
|
def dump(self):
|
|
480
|
-
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,
|
|
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)
|
|
481
488
|
return string.hex().upper()
|
|
482
489
|
|
|
483
490
|
def set(self, string):
|
|
@@ -491,13 +498,13 @@ class ModuleEnergy2400V12():
|
|
|
491
498
|
self.pattern = d[6]
|
|
492
499
|
self.output_power = d[7]
|
|
493
500
|
self.signal_indicator_cycle = d[8]
|
|
494
|
-
self.signal_indicator_rep =
|
|
501
|
+
self.signal_indicator_rep = MODULE_ENERGY_2400_V11_SIGNAL_INDICATOR_REP_DEC[d[9]]
|
|
495
502
|
self.unused0 = d[10]
|
|
496
503
|
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
class
|
|
500
|
-
def __init__(self, raw='', module_type=MODULE_ENERGY_SUB1G, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=
|
|
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):
|
|
501
508
|
self.module_type = module_type
|
|
502
509
|
self.msg_type = msg_type
|
|
503
510
|
self.api_version = api_version
|
|
@@ -512,7 +519,7 @@ class ModuleEnergySub1GV13():
|
|
|
512
519
|
self.set(raw)
|
|
513
520
|
|
|
514
521
|
def __repr__(self) -> str:
|
|
515
|
-
return "\n==> Packet
|
|
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")
|
|
516
523
|
|
|
517
524
|
def __eq__(self, other):
|
|
518
525
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -529,7 +536,7 @@ class ModuleEnergySub1GV13():
|
|
|
529
536
|
return False
|
|
530
537
|
|
|
531
538
|
def dump(self):
|
|
532
|
-
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,
|
|
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)
|
|
533
540
|
return string.hex().upper()
|
|
534
541
|
|
|
535
542
|
def set(self, string):
|
|
@@ -542,19 +549,23 @@ class ModuleEnergySub1GV13():
|
|
|
542
549
|
self.pattern = d[5]
|
|
543
550
|
self.duty_cycle = d[6]
|
|
544
551
|
self.signal_indicator_cycle = d[7]
|
|
545
|
-
self.signal_indicator_rep =
|
|
552
|
+
self.signal_indicator_rep = MODULE_ENERGY_SUB1G_V12_SIGNAL_INDICATOR_REP_DEC[d[8]]
|
|
546
553
|
self.unused0 = d[9]
|
|
547
554
|
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
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):
|
|
552
561
|
self.module_type = module_type
|
|
553
562
|
self.msg_type = msg_type
|
|
554
563
|
self.api_version = api_version
|
|
555
564
|
self.seq_id = seq_id
|
|
556
565
|
self.brg_mac = brg_mac
|
|
557
|
-
self.
|
|
566
|
+
self.output_power = output_power
|
|
567
|
+
self.sub1g_energy_pattern = sub1g_energy_pattern
|
|
568
|
+
self.cycle = cycle
|
|
558
569
|
self.duty_cycle = duty_cycle
|
|
559
570
|
self.signal_indicator_cycle = signal_indicator_cycle
|
|
560
571
|
self.signal_indicator_rep = signal_indicator_rep
|
|
@@ -563,7 +574,7 @@ class ModuleEnergySub1GV12():
|
|
|
563
574
|
self.set(raw)
|
|
564
575
|
|
|
565
576
|
def __repr__(self) -> str:
|
|
566
|
-
return "\n==> Packet
|
|
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")
|
|
567
578
|
|
|
568
579
|
def __eq__(self, other):
|
|
569
580
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -572,7 +583,9 @@ class ModuleEnergySub1GV12():
|
|
|
572
583
|
self.msg_type == other.msg_type and
|
|
573
584
|
self.api_version == other.api_version and
|
|
574
585
|
self.brg_mac == other.brg_mac and
|
|
575
|
-
self.
|
|
586
|
+
self.output_power == other.output_power and
|
|
587
|
+
self.sub1g_energy_pattern == other.sub1g_energy_pattern and
|
|
588
|
+
self.cycle == other.cycle and
|
|
576
589
|
self.duty_cycle == other.duty_cycle and
|
|
577
590
|
self.signal_indicator_cycle == other.signal_indicator_cycle and
|
|
578
591
|
self.signal_indicator_rep == other.signal_indicator_rep
|
|
@@ -580,24 +593,26 @@ class ModuleEnergySub1GV12():
|
|
|
580
593
|
return False
|
|
581
594
|
|
|
582
595
|
def dump(self):
|
|
583
|
-
string = bitstruct.pack("
|
|
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)
|
|
584
597
|
return string.hex().upper()
|
|
585
598
|
|
|
586
599
|
def set(self, string):
|
|
587
|
-
d = bitstruct.unpack("
|
|
600
|
+
d = bitstruct.unpack("u4u4u8u8u48u8u8u8u8u14u2u72", binascii.unhexlify(string))
|
|
588
601
|
self.module_type = d[0]
|
|
589
602
|
self.msg_type = d[1]
|
|
590
603
|
self.api_version = d[2]
|
|
591
604
|
self.seq_id = d[3]
|
|
592
605
|
self.brg_mac = d[4]
|
|
593
|
-
self.
|
|
594
|
-
self.
|
|
595
|
-
self.
|
|
596
|
-
self.
|
|
597
|
-
self.
|
|
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]
|
|
598
613
|
|
|
599
|
-
class
|
|
600
|
-
def __init__(self, raw='', module_type=MODULE_PWR_MGMT, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=
|
|
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):
|
|
601
616
|
self.module_type = module_type
|
|
602
617
|
self.msg_type = msg_type
|
|
603
618
|
self.api_version = api_version
|
|
@@ -618,7 +633,7 @@ class ModulePwrMgmtV13():
|
|
|
618
633
|
self.set(raw)
|
|
619
634
|
|
|
620
635
|
def __repr__(self) -> str:
|
|
621
|
-
return "\n==> Packet
|
|
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")
|
|
622
637
|
|
|
623
638
|
def __eq__(self, other):
|
|
624
639
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -663,8 +678,8 @@ class ModulePwrMgmtV13():
|
|
|
663
678
|
self.dynamic_sleep_duration = ((d[14]*60)+0)
|
|
664
679
|
self.unused0 = d[15]
|
|
665
680
|
|
|
666
|
-
class
|
|
667
|
-
def __init__(self, raw='', module_type=MODULE_PWR_MGMT, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=
|
|
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):
|
|
668
683
|
self.module_type = module_type
|
|
669
684
|
self.msg_type = msg_type
|
|
670
685
|
self.api_version = api_version
|
|
@@ -685,7 +700,7 @@ class ModulePwrMgmtV12():
|
|
|
685
700
|
self.set(raw)
|
|
686
701
|
|
|
687
702
|
def __repr__(self) -> str:
|
|
688
|
-
return "\n==> Packet
|
|
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")
|
|
689
704
|
|
|
690
705
|
def __eq__(self, other):
|
|
691
706
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -730,8 +745,8 @@ class ModulePwrMgmtV12():
|
|
|
730
745
|
self.dynamic_sleep_duration = ((d[14]*60)+0)
|
|
731
746
|
self.unused0 = d[15]
|
|
732
747
|
|
|
733
|
-
class
|
|
734
|
-
def __init__(self, raw='', module_type=MODULE_EXT_SENSORS, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=
|
|
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):
|
|
735
750
|
self.module_type = module_type
|
|
736
751
|
self.msg_type = msg_type
|
|
737
752
|
self.api_version = api_version
|
|
@@ -746,7 +761,7 @@ class ModuleExtSensorsV13():
|
|
|
746
761
|
self.set(raw)
|
|
747
762
|
|
|
748
763
|
def __repr__(self) -> str:
|
|
749
|
-
return "\n==> Packet
|
|
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")
|
|
750
765
|
|
|
751
766
|
def __eq__(self, other):
|
|
752
767
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -779,8 +794,8 @@ class ModuleExtSensorsV13():
|
|
|
779
794
|
self.sub1g_rssi_threshold = ((d[8]*-1)+0)
|
|
780
795
|
self.unused = d[9]
|
|
781
796
|
|
|
782
|
-
class
|
|
783
|
-
def __init__(self, raw='', module_type=MODULE_EXT_SENSORS, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=
|
|
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):
|
|
784
799
|
self.module_type = module_type
|
|
785
800
|
self.msg_type = msg_type
|
|
786
801
|
self.api_version = api_version
|
|
@@ -788,14 +803,12 @@ class ModuleExtSensorsV12():
|
|
|
788
803
|
self.brg_mac = brg_mac
|
|
789
804
|
self.sensor0 = sensor0
|
|
790
805
|
self.sensor1 = sensor1
|
|
791
|
-
self.rssi_threshold = rssi_threshold
|
|
792
|
-
self.sub1g_rssi_threshold = sub1g_rssi_threshold
|
|
793
806
|
self.unused = unused
|
|
794
807
|
if raw:
|
|
795
808
|
self.set(raw)
|
|
796
809
|
|
|
797
810
|
def __repr__(self) -> str:
|
|
798
|
-
return "\n==> Packet
|
|
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")
|
|
799
812
|
|
|
800
813
|
def __eq__(self, other):
|
|
801
814
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -805,18 +818,16 @@ class ModuleExtSensorsV12():
|
|
|
805
818
|
self.api_version == other.api_version and
|
|
806
819
|
self.brg_mac == other.brg_mac and
|
|
807
820
|
self.sensor0 == other.sensor0 and
|
|
808
|
-
self.sensor1 == other.sensor1
|
|
809
|
-
self.rssi_threshold == other.rssi_threshold and
|
|
810
|
-
self.sub1g_rssi_threshold == other.sub1g_rssi_threshold
|
|
821
|
+
self.sensor1 == other.sensor1
|
|
811
822
|
)
|
|
812
823
|
return False
|
|
813
824
|
|
|
814
825
|
def dump(self):
|
|
815
|
-
string = bitstruct.pack("
|
|
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)
|
|
816
827
|
return string.hex().upper()
|
|
817
828
|
|
|
818
829
|
def set(self, string):
|
|
819
|
-
d = bitstruct.unpack("
|
|
830
|
+
d = bitstruct.unpack("u4u4u8u8u48u32u32u56", binascii.unhexlify(string))
|
|
820
831
|
self.module_type = d[0]
|
|
821
832
|
self.msg_type = d[1]
|
|
822
833
|
self.api_version = d[2]
|
|
@@ -824,12 +835,10 @@ class ModuleExtSensorsV12():
|
|
|
824
835
|
self.brg_mac = d[4]
|
|
825
836
|
self.sensor0 = d[5]
|
|
826
837
|
self.sensor1 = d[6]
|
|
827
|
-
self.
|
|
828
|
-
self.sub1g_rssi_threshold = ((d[8]*-1)+0)
|
|
829
|
-
self.unused = d[9]
|
|
838
|
+
self.unused = d[7]
|
|
830
839
|
|
|
831
|
-
class
|
|
832
|
-
def __init__(self, raw='', module_type=MODULE_CUSTOM, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=
|
|
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):
|
|
833
842
|
self.module_type = module_type
|
|
834
843
|
self.msg_type = msg_type
|
|
835
844
|
self.api_version = api_version
|
|
@@ -843,7 +852,7 @@ class ModuleCustomV13():
|
|
|
843
852
|
self.set(raw)
|
|
844
853
|
|
|
845
854
|
def __repr__(self) -> str:
|
|
846
|
-
return "\n==> Packet
|
|
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")
|
|
847
856
|
|
|
848
857
|
def __eq__(self, other):
|
|
849
858
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -874,22 +883,22 @@ class ModuleCustomV13():
|
|
|
874
883
|
self.d2s_transition_time = ((d[7]*5)+0)
|
|
875
884
|
self.unused1 = d[8]
|
|
876
885
|
|
|
877
|
-
class
|
|
878
|
-
def __init__(self, raw='', module_type=MODULE_CUSTOM, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=
|
|
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):
|
|
879
888
|
self.module_type = module_type
|
|
880
889
|
self.msg_type = msg_type
|
|
881
890
|
self.api_version = api_version
|
|
882
891
|
self.seq_id = seq_id
|
|
883
892
|
self.brg_mac = brg_mac
|
|
884
|
-
self.
|
|
885
|
-
self.
|
|
886
|
-
self.
|
|
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
|
|
887
896
|
self.unused1 = unused1
|
|
888
897
|
if raw:
|
|
889
898
|
self.set(raw)
|
|
890
899
|
|
|
891
900
|
def __repr__(self) -> str:
|
|
892
|
-
return "\n==> Packet
|
|
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")
|
|
893
902
|
|
|
894
903
|
def __eq__(self, other):
|
|
895
904
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -898,14 +907,14 @@ class ModuleCustomV12():
|
|
|
898
907
|
self.msg_type == other.msg_type and
|
|
899
908
|
self.api_version == other.api_version and
|
|
900
909
|
self.brg_mac == other.brg_mac and
|
|
901
|
-
self.
|
|
902
|
-
self.
|
|
903
|
-
self.
|
|
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
|
|
904
913
|
)
|
|
905
914
|
return False
|
|
906
915
|
|
|
907
916
|
def dump(self):
|
|
908
|
-
string = bitstruct.pack("u4u4u8u8u48u8u8u8u96", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, ((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)
|
|
909
918
|
return string.hex().upper()
|
|
910
919
|
|
|
911
920
|
def set(self, string):
|
|
@@ -915,8 +924,8 @@ class ModuleCustomV12():
|
|
|
915
924
|
self.api_version = d[2]
|
|
916
925
|
self.seq_id = d[3]
|
|
917
926
|
self.brg_mac = d[4]
|
|
918
|
-
self.
|
|
919
|
-
self.
|
|
920
|
-
self.
|
|
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)
|
|
921
930
|
self.unused1 = d[8]
|
|
922
931
|
|