wiliot-certificate 1.5.3a1__py3-none-any.whl → 4.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- brg_certificate/ag/energous_v0_defines.py +105 -114
- brg_certificate/ag/energous_v1_defines.py +105 -114
- brg_certificate/ag/energous_v2_defines.py +105 -114
- brg_certificate/ag/energous_v3_defines.py +105 -114
- brg_certificate/ag/energous_v4_defines.py +105 -114
- brg_certificate/ag/fanstel_lan_v0_defines.py +105 -114
- brg_certificate/ag/fanstel_lte_v0_defines.py +105 -114
- brg_certificate/ag/fanstel_wifi_v0_defines.py +105 -114
- brg_certificate/ag/minew_lte_v0_defines.py +105 -114
- brg_certificate/ag/wlt_types.html +980 -147
- brg_certificate/ag/wlt_types_ag.py +1318 -240
- brg_certificate/ag/wlt_types_ag_jsons/brg2brg_ota.json +69 -0
- brg_certificate/ag/wlt_types_ag_jsons/brg2gw_hb.json +101 -0
- brg_certificate/ag/wlt_types_ag_jsons/brg2gw_hb_sleep.json +45 -0
- brg_certificate/ag/wlt_types_ag_jsons/calibration.json +75 -0
- brg_certificate/ag/wlt_types_ag_jsons/custom.json +99 -0
- brg_certificate/ag/wlt_types_ag_jsons/datapath.json +133 -8
- brg_certificate/ag/wlt_types_ag_jsons/energy2400.json +99 -0
- brg_certificate/ag/wlt_types_ag_jsons/energySub1g.json +96 -0
- brg_certificate/ag/wlt_types_ag_jsons/externalSensor.json +113 -0
- brg_certificate/ag/wlt_types_ag_jsons/interface.json +157 -0
- brg_certificate/ag/wlt_types_ag_jsons/powerManagement.json +205 -0
- brg_certificate/certificate_bcc_test_list.txt +0 -2
- brg_certificate/certificate_test_list.txt +2 -2
- brg_certificate/tests/calibration/interval_test/interval_test.json +1 -1
- brg_certificate/tests/calibration/interval_test/interval_test.py +4 -4
- brg_certificate/tests/calibration/output_power_test/output_power_test.json +1 -1
- brg_certificate/tests/calibration/output_power_test/output_power_test.py +4 -4
- brg_certificate/tests/calibration/pattern_test/pattern_test.json +1 -1
- brg_certificate/tests/calibration/pattern_test/pattern_test.py +14 -8
- brg_certificate/tests/datapath/aging_test/aging_test.py +9 -8
- brg_certificate/tests/datapath/num_of_tags_test/num_of_tags_test.py +7 -12
- brg_certificate/tests/datapath/output_power_test/output_power_test.json +1 -1
- brg_certificate/tests/datapath/output_power_test/output_power_test.py +4 -4
- brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.json +1 -1
- brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +10 -6
- brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.py +10 -3
- brg_certificate/tests/datapath/pacer_interval_test/pacer_interval_test.py +9 -9
- brg_certificate/tests/datapath/pattern_test/pattern_test.json +1 -1
- brg_certificate/tests/datapath/pattern_test/pattern_test.py +4 -5
- brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.json +1 -1
- brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +10 -9
- brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.json +1 -1
- brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.py +10 -9
- brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.json +1 -1
- brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.py +10 -9
- brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.json +1 -1
- brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.py +10 -9
- brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.json +1 -1
- brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.py +4 -5
- brg_certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +38 -36
- brg_certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.py +45 -45
- brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.json +2 -3
- brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.py +20 -16
- brg_certificate/tests/datapath/stress_test/stress_test.json +2 -3
- brg_certificate/tests/datapath/stress_test/stress_test.py +19 -16
- brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.json +1 -1
- brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.py +11 -9
- brg_certificate/tests/edge_mgmt/actions_test/actions_test.json +1 -1
- brg_certificate/tests/edge_mgmt/actions_test/actions_test.py +4 -4
- brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.json +1 -1
- brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.py +4 -4
- brg_certificate/tests/energy2400/output_power_test/output_power_test.json +1 -1
- brg_certificate/tests/energy2400/output_power_test/output_power_test.py +4 -4
- brg_certificate/tests/energy2400/pattern_test/pattern_test.json +1 -1
- brg_certificate/tests/energy2400/pattern_test/pattern_test.py +4 -4
- brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +6 -4
- brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.json +1 -1
- brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.py +4 -4
- brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.json +1 -1
- brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.py +4 -4
- brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.json +1 -1
- brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.py +4 -4
- brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.json +1 -1
- brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +4 -5
- brg_certificate/wltPb_pb2.py +4 -4
- brg_certificate/wltPb_pb2.pyi +2 -1
- gw_certificate/common/serialization_formatter.py +14 -1
- gw_certificate/common/wltPb_pb2.py +4 -4
- gw_certificate/common/wltPb_pb2.pyi +2 -1
- gw_certificate/interface/{4.4.82_app.zip → 4.4.91_app.zip} +0 -0
- gw_certificate/interface/{4.4.82_sd_bl_app.zip → 4.4.91_sd_bl_app.zip} +0 -0
- gw_certificate/interface/ble_simulator.py +5 -3
- gw_certificate/interface/flash_fw.py +90 -0
- gw_certificate/interface/uart_if.py +6 -4
- gw_certificate/tests/actions.py +1 -1
- gw_certificate/tests/downlink.py +2 -2
- gw_certificate/tests/generic.py +4 -3
- gw_certificate/tests/static/generated_packet_table.py +16 -16
- gw_certificate/tests/static/packet_table.csv +10052 -10052
- gw_certificate/tests/static/uplink_defines.py +1 -1
- gw_certificate/tests/throughput.py +3 -2
- gw_certificate/tests/uplink.py +38 -19
- {wiliot_certificate-1.5.3a1.dist-info → wiliot_certificate-4.4.0.dist-info}/METADATA +71 -30
- {wiliot_certificate-1.5.3a1.dist-info → wiliot_certificate-4.4.0.dist-info}/RECORD +99 -98
- {wiliot_certificate-1.5.3a1.dist-info → wiliot_certificate-4.4.0.dist-info}/WHEEL +1 -1
- {wiliot_certificate-1.5.3a1.dist-info → wiliot_certificate-4.4.0.dist-info}/entry_points.txt +0 -0
- {wiliot_certificate-1.5.3a1.dist-info → wiliot_certificate-4.4.0.dist-info}/licenses/LICENSE +0 -0
- {wiliot_certificate-1.5.3a1.dist-info → wiliot_certificate-4.4.0.dist-info}/top_level.txt +0 -0
|
@@ -38,7 +38,7 @@ RSSI_VAL_MAX = 103 # min val + 63 (6 bits)
|
|
|
38
38
|
API_VERSION_V0 = 0
|
|
39
39
|
API_VERSION_V1 = 1
|
|
40
40
|
API_VERSION_V2 = 2
|
|
41
|
-
API_VERSION_V5 = 5 # Because of backward
|
|
41
|
+
API_VERSION_V5 = 5 # Because of backward compatibility issue we jumped from V2 to V5
|
|
42
42
|
API_VERSION_V6 = 6
|
|
43
43
|
API_VERSION_V7 = 7
|
|
44
44
|
API_VERSION_V8 = 8
|
|
@@ -46,7 +46,8 @@ API_VERSION_V9 = 9
|
|
|
46
46
|
API_VERSION_V10 = 10
|
|
47
47
|
API_VERSION_V11 = 11
|
|
48
48
|
API_VERSION_V12 = 12
|
|
49
|
-
|
|
49
|
+
API_VERSION_V13 = 13
|
|
50
|
+
API_VERSION_LATEST = 13
|
|
50
51
|
|
|
51
52
|
API_VERSION_SENSOR_V0 = 0
|
|
52
53
|
API_VERSION_SENSOR_LATEST = 0
|
|
@@ -542,6 +543,248 @@ class DataHdr():
|
|
|
542
543
|
self.pkt_type = d[5]
|
|
543
544
|
self.group_id_major = d[6]
|
|
544
545
|
|
|
546
|
+
class SideInfo():
|
|
547
|
+
def __init__(self, raw='', brg_mac=0, nfpkt=0, rssi=0, unused2=0, unused0=0, unused1=0, pkt_id=0):
|
|
548
|
+
self.brg_mac = brg_mac
|
|
549
|
+
self.nfpkt = nfpkt
|
|
550
|
+
self.rssi = rssi
|
|
551
|
+
self.unused2 = unused2
|
|
552
|
+
self.unused0 = unused0
|
|
553
|
+
self.unused1 = unused1
|
|
554
|
+
self.pkt_id = pkt_id
|
|
555
|
+
if raw:
|
|
556
|
+
self.set(raw)
|
|
557
|
+
|
|
558
|
+
def __repr__(self) -> str:
|
|
559
|
+
return "\n==> Packet side_info <==\n" + tabulate.tabulate([['brg_mac', f"0x{self.brg_mac:X}", self.brg_mac],['nfpkt', f"0x{self.nfpkt:X}", self.nfpkt],['rssi', f"0x{self.rssi:X}", self.rssi],['pkt_id', f"0x{self.pkt_id:X}", self.pkt_id]], tablefmt="texttable")
|
|
560
|
+
|
|
561
|
+
def __eq__(self, other):
|
|
562
|
+
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
563
|
+
return (
|
|
564
|
+
self.brg_mac == other.brg_mac and
|
|
565
|
+
self.nfpkt == other.nfpkt and
|
|
566
|
+
self.rssi == other.rssi and
|
|
567
|
+
self.pkt_id == other.pkt_id
|
|
568
|
+
)
|
|
569
|
+
return False
|
|
570
|
+
|
|
571
|
+
def dump(self):
|
|
572
|
+
string = bitstruct.pack("u48u16u8u4u4u80u32", self.brg_mac, self.nfpkt, self.rssi, self.unused2, self.unused0, self.unused1, self.pkt_id)
|
|
573
|
+
return string.hex().upper()
|
|
574
|
+
|
|
575
|
+
def set(self, string):
|
|
576
|
+
d = bitstruct.unpack("u48u16u8u4u4u80u32", binascii.unhexlify(string))
|
|
577
|
+
self.brg_mac = d[0]
|
|
578
|
+
self.nfpkt = d[1]
|
|
579
|
+
self.rssi = d[2]
|
|
580
|
+
self.unused2 = d[3]
|
|
581
|
+
self.unused0 = d[4]
|
|
582
|
+
self.unused1 = d[5]
|
|
583
|
+
self.pkt_id = d[6]
|
|
584
|
+
|
|
585
|
+
class SensorData():
|
|
586
|
+
def __init__(self, raw='', data=0, pkt_id=0):
|
|
587
|
+
self.data = data
|
|
588
|
+
self.pkt_id = pkt_id
|
|
589
|
+
if raw:
|
|
590
|
+
self.set(raw)
|
|
591
|
+
|
|
592
|
+
def __repr__(self) -> str:
|
|
593
|
+
return "\n==> Packet sensor_data <==\n" + tabulate.tabulate([['data', f"0x{self.data:X}", self.data],['pkt_id', f"0x{self.pkt_id:X}", self.pkt_id]], tablefmt="texttable")
|
|
594
|
+
|
|
595
|
+
def __eq__(self, other):
|
|
596
|
+
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
597
|
+
return (
|
|
598
|
+
self.data == other.data and
|
|
599
|
+
self.pkt_id == other.pkt_id
|
|
600
|
+
)
|
|
601
|
+
return False
|
|
602
|
+
|
|
603
|
+
def dump(self):
|
|
604
|
+
string = bitstruct.pack("u216u32", self.data, self.pkt_id)
|
|
605
|
+
return string.hex().upper()
|
|
606
|
+
|
|
607
|
+
def set(self, string):
|
|
608
|
+
d = bitstruct.unpack("u216u32", binascii.unhexlify(string))
|
|
609
|
+
self.data = d[0]
|
|
610
|
+
self.pkt_id = d[1]
|
|
611
|
+
|
|
612
|
+
class SideInfoSensor():
|
|
613
|
+
def __init__(self, raw='', brg_mac=0, nfpkt=0, rssi=0, unused2=0, unused0=0, sensor_mac=0, sensor_ad_type=0, sensor_uuid_msb=0, sensor_uuid_lsb=0, api_version=0, unused1=0, is_scrambled=0, is_sensor_embedded=0, is_sensor=0, pkt_id=0):
|
|
614
|
+
self.brg_mac = brg_mac
|
|
615
|
+
self.nfpkt = nfpkt
|
|
616
|
+
self.rssi = rssi
|
|
617
|
+
self.unused2 = unused2
|
|
618
|
+
self.unused0 = unused0
|
|
619
|
+
self.sensor_mac = sensor_mac
|
|
620
|
+
self.sensor_ad_type = sensor_ad_type
|
|
621
|
+
self.sensor_uuid_msb = sensor_uuid_msb
|
|
622
|
+
self.sensor_uuid_lsb = sensor_uuid_lsb
|
|
623
|
+
self.api_version = api_version
|
|
624
|
+
self.unused1 = unused1
|
|
625
|
+
self.is_scrambled = is_scrambled
|
|
626
|
+
self.is_sensor_embedded = is_sensor_embedded
|
|
627
|
+
self.is_sensor = is_sensor
|
|
628
|
+
self.pkt_id = pkt_id
|
|
629
|
+
if raw:
|
|
630
|
+
self.set(raw)
|
|
631
|
+
|
|
632
|
+
def __repr__(self) -> str:
|
|
633
|
+
return "\n==> Packet side_info_sensor <==\n" + tabulate.tabulate([['brg_mac', f"0x{self.brg_mac:X}", self.brg_mac],['nfpkt', f"0x{self.nfpkt:X}", self.nfpkt],['rssi', f"0x{self.rssi:X}", self.rssi],['sensor_mac', f"0x{self.sensor_mac:X}", self.sensor_mac],['sensor_ad_type', f"0x{self.sensor_ad_type:X}", self.sensor_ad_type],['sensor_uuid_msb', f"0x{self.sensor_uuid_msb:X}", self.sensor_uuid_msb],['sensor_uuid_lsb', f"0x{self.sensor_uuid_lsb:X}", self.sensor_uuid_lsb],['api_version', f"0x{self.api_version:X}", self.api_version],['is_scrambled', f"0x{self.is_scrambled:X}", self.is_scrambled],['is_sensor_embedded', f"0x{self.is_sensor_embedded:X}", self.is_sensor_embedded],['is_sensor', f"0x{self.is_sensor:X}", self.is_sensor],['pkt_id', f"0x{self.pkt_id:X}", self.pkt_id]], tablefmt="texttable")
|
|
634
|
+
|
|
635
|
+
def __eq__(self, other):
|
|
636
|
+
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
637
|
+
return (
|
|
638
|
+
self.brg_mac == other.brg_mac and
|
|
639
|
+
self.nfpkt == other.nfpkt and
|
|
640
|
+
self.rssi == other.rssi and
|
|
641
|
+
self.sensor_mac == other.sensor_mac and
|
|
642
|
+
self.sensor_ad_type == other.sensor_ad_type and
|
|
643
|
+
self.sensor_uuid_msb == other.sensor_uuid_msb and
|
|
644
|
+
self.sensor_uuid_lsb == other.sensor_uuid_lsb and
|
|
645
|
+
self.api_version == other.api_version and
|
|
646
|
+
self.is_scrambled == other.is_scrambled and
|
|
647
|
+
self.is_sensor_embedded == other.is_sensor_embedded and
|
|
648
|
+
self.is_sensor == other.is_sensor and
|
|
649
|
+
self.pkt_id == other.pkt_id
|
|
650
|
+
)
|
|
651
|
+
return False
|
|
652
|
+
|
|
653
|
+
def dump(self):
|
|
654
|
+
string = bitstruct.pack("u48u16u8u4u4u48u8u8u8u4u1u1u1u1u32", self.brg_mac, self.nfpkt, self.rssi, self.unused2, self.unused0, self.sensor_mac, self.sensor_ad_type, self.sensor_uuid_msb, self.sensor_uuid_lsb, self.api_version, self.unused1, self.is_scrambled, self.is_sensor_embedded, self.is_sensor, self.pkt_id)
|
|
655
|
+
return string.hex().upper()
|
|
656
|
+
|
|
657
|
+
def set(self, string):
|
|
658
|
+
d = bitstruct.unpack("u48u16u8u4u4u48u8u8u8u4u1u1u1u1u32", binascii.unhexlify(string))
|
|
659
|
+
self.brg_mac = d[0]
|
|
660
|
+
self.nfpkt = d[1]
|
|
661
|
+
self.rssi = d[2]
|
|
662
|
+
self.unused2 = d[3]
|
|
663
|
+
self.unused0 = d[4]
|
|
664
|
+
self.sensor_mac = d[5]
|
|
665
|
+
self.sensor_ad_type = d[6]
|
|
666
|
+
self.sensor_uuid_msb = d[7]
|
|
667
|
+
self.sensor_uuid_lsb = d[8]
|
|
668
|
+
self.api_version = d[9]
|
|
669
|
+
self.unused1 = d[10]
|
|
670
|
+
self.is_scrambled = d[11]
|
|
671
|
+
self.is_sensor_embedded = d[12]
|
|
672
|
+
self.is_sensor = d[13]
|
|
673
|
+
self.pkt_id = d[14]
|
|
674
|
+
|
|
675
|
+
class PktFilterStruct():
|
|
676
|
+
def __init__(self, raw='', unused=0, mask_enable=0, p3_pacing=0, p2_pacing=0, p1_pacing=0, p0_pacing=0):
|
|
677
|
+
self.unused = unused
|
|
678
|
+
self.mask_enable = mask_enable
|
|
679
|
+
self.p3_pacing = p3_pacing
|
|
680
|
+
self.p2_pacing = p2_pacing
|
|
681
|
+
self.p1_pacing = p1_pacing
|
|
682
|
+
self.p0_pacing = p0_pacing
|
|
683
|
+
if raw:
|
|
684
|
+
self.set(raw)
|
|
685
|
+
|
|
686
|
+
def __repr__(self) -> str:
|
|
687
|
+
return "\n==> Packet pkt_filter_struct <==\n" + tabulate.tabulate([['mask_enable', f"0x{self.mask_enable:X}", self.mask_enable],['p3_pacing', f"0x{self.p3_pacing:X}", self.p3_pacing],['p2_pacing', f"0x{self.p2_pacing:X}", self.p2_pacing],['p1_pacing', f"0x{self.p1_pacing:X}", self.p1_pacing],['p0_pacing', f"0x{self.p0_pacing:X}", self.p0_pacing]], tablefmt="texttable")
|
|
688
|
+
|
|
689
|
+
def __eq__(self, other):
|
|
690
|
+
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
691
|
+
return (
|
|
692
|
+
self.mask_enable == other.mask_enable and
|
|
693
|
+
self.p3_pacing == other.p3_pacing and
|
|
694
|
+
self.p2_pacing == other.p2_pacing and
|
|
695
|
+
self.p1_pacing == other.p1_pacing and
|
|
696
|
+
self.p0_pacing == other.p0_pacing
|
|
697
|
+
)
|
|
698
|
+
return False
|
|
699
|
+
|
|
700
|
+
def dump(self):
|
|
701
|
+
string = bitstruct.pack("u3u1u1u1u1u1", self.unused, self.mask_enable, self.p3_pacing, self.p2_pacing, self.p1_pacing, self.p0_pacing)
|
|
702
|
+
return string.hex().upper()
|
|
703
|
+
|
|
704
|
+
def set(self, string):
|
|
705
|
+
d = bitstruct.unpack("u3u1u1u1u1u1", binascii.unhexlify(string))
|
|
706
|
+
self.unused = d[0]
|
|
707
|
+
self.mask_enable = d[1]
|
|
708
|
+
self.p3_pacing = d[2]
|
|
709
|
+
self.p2_pacing = d[3]
|
|
710
|
+
self.p1_pacing = d[4]
|
|
711
|
+
self.p0_pacing = d[5]
|
|
712
|
+
|
|
713
|
+
class PwrMgmt():
|
|
714
|
+
def __init__(self, raw='', leds_on=PWR_MGMT_DEFAULTS_LEDS_ON, keep_alive_scan=PWR_MGMT_DEFAULTS_KEEP_ALIVE_SCAN, keep_alive_period=PWR_MGMT_DEFAULTS_KEEP_ALIVE_PERIOD, on_duration=PWR_MGMT_DEFAULTS_ON_DURATION, sleep_duration=PWR_MGMT_DEFAULTS_SLEEP_DURATION, unused=0):
|
|
715
|
+
self.leds_on = leds_on
|
|
716
|
+
self.keep_alive_scan = keep_alive_scan # 10 [msec] resolution
|
|
717
|
+
self.keep_alive_period = keep_alive_period # 5 [sec] resolution
|
|
718
|
+
self.on_duration = on_duration # 30 [sec] resolution
|
|
719
|
+
self.sleep_duration = sleep_duration # 60 [sec] resolution
|
|
720
|
+
self.unused = unused
|
|
721
|
+
if raw:
|
|
722
|
+
self.set(raw)
|
|
723
|
+
|
|
724
|
+
def __repr__(self) -> str:
|
|
725
|
+
return "\n==> Packet pwr_mgmt <==\n" + tabulate.tabulate([['leds_on', f"0x{self.leds_on:X}", self.leds_on],['keep_alive_scan', f"0x{self.keep_alive_scan:X}", self.keep_alive_scan],['keep_alive_period', f"0x{self.keep_alive_period:X}", self.keep_alive_period],['on_duration', f"0x{self.on_duration:X}", self.on_duration],['sleep_duration', f"0x{self.sleep_duration:X}", self.sleep_duration]], tablefmt="texttable")
|
|
726
|
+
|
|
727
|
+
def __eq__(self, other):
|
|
728
|
+
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
729
|
+
return (
|
|
730
|
+
self.leds_on == other.leds_on and
|
|
731
|
+
self.keep_alive_scan == other.keep_alive_scan and
|
|
732
|
+
self.keep_alive_period == other.keep_alive_period and
|
|
733
|
+
self.on_duration == other.on_duration and
|
|
734
|
+
self.sleep_duration == other.sleep_duration
|
|
735
|
+
)
|
|
736
|
+
return False
|
|
737
|
+
|
|
738
|
+
def dump(self):
|
|
739
|
+
string = bitstruct.pack("u1u6u5u7u11u2", self.leds_on, self.keep_alive_scan, self.keep_alive_period, self.on_duration, self.sleep_duration, self.unused)
|
|
740
|
+
return string.hex().upper()
|
|
741
|
+
|
|
742
|
+
def set(self, string):
|
|
743
|
+
d = bitstruct.unpack("u1u6u5u7u11u2", binascii.unhexlify(string))
|
|
744
|
+
self.leds_on = d[0]
|
|
745
|
+
self.keep_alive_scan = d[1]
|
|
746
|
+
self.keep_alive_period = d[2]
|
|
747
|
+
self.on_duration = d[3]
|
|
748
|
+
self.sleep_duration = d[4]
|
|
749
|
+
self.unused = d[5]
|
|
750
|
+
|
|
751
|
+
class GenericV13():
|
|
752
|
+
def __init__(self, raw='', module_type=0, msg_type=0, api_version=API_VERSION_V13, seq_id=0, brg_mac=0, unused=0):
|
|
753
|
+
self.module_type = module_type
|
|
754
|
+
self.msg_type = msg_type
|
|
755
|
+
self.api_version = api_version
|
|
756
|
+
self.seq_id = seq_id
|
|
757
|
+
self.brg_mac = brg_mac
|
|
758
|
+
self.unused = unused
|
|
759
|
+
if raw:
|
|
760
|
+
self.set(raw)
|
|
761
|
+
|
|
762
|
+
def __repr__(self) -> str:
|
|
763
|
+
return "\n==> Packet generic_v13 <==\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]], tablefmt="texttable")
|
|
764
|
+
|
|
765
|
+
def __eq__(self, other):
|
|
766
|
+
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
767
|
+
return (
|
|
768
|
+
self.module_type == other.module_type and
|
|
769
|
+
self.msg_type == other.msg_type and
|
|
770
|
+
self.api_version == other.api_version and
|
|
771
|
+
self.brg_mac == other.brg_mac
|
|
772
|
+
)
|
|
773
|
+
return False
|
|
774
|
+
|
|
775
|
+
def dump(self):
|
|
776
|
+
string = bitstruct.pack("u4u4u8u8u48u120", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.unused)
|
|
777
|
+
return string.hex().upper()
|
|
778
|
+
|
|
779
|
+
def set(self, string):
|
|
780
|
+
d = bitstruct.unpack("u4u4u8u8u48u120", binascii.unhexlify(string))
|
|
781
|
+
self.module_type = d[0]
|
|
782
|
+
self.msg_type = d[1]
|
|
783
|
+
self.api_version = d[2]
|
|
784
|
+
self.seq_id = d[3]
|
|
785
|
+
self.brg_mac = d[4]
|
|
786
|
+
self.unused = d[5]
|
|
787
|
+
|
|
545
788
|
class GenericV12():
|
|
546
789
|
def __init__(self, raw='', module_type=0, msg_type=0, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, unused=0):
|
|
547
790
|
self.module_type = module_type
|
|
@@ -799,6 +1042,44 @@ class GenericV1():
|
|
|
799
1042
|
self.brg_mac = d[4]
|
|
800
1043
|
self.unused2 = d[5]
|
|
801
1044
|
|
|
1045
|
+
class ActionGenericV13():
|
|
1046
|
+
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_ACTION, api_version=API_VERSION_V13, seq_id=0, brg_mac=ACTION_EMPTY, action_id=0, action_params=0):
|
|
1047
|
+
self.msg_type = msg_type
|
|
1048
|
+
self.api_version = api_version
|
|
1049
|
+
self.seq_id = seq_id
|
|
1050
|
+
self.brg_mac = brg_mac
|
|
1051
|
+
self.action_id = action_id
|
|
1052
|
+
self.action_params = action_params
|
|
1053
|
+
if raw:
|
|
1054
|
+
self.set(raw)
|
|
1055
|
+
|
|
1056
|
+
def __repr__(self) -> str:
|
|
1057
|
+
return "\n==> Packet action_generic_v13 <==\n" + tabulate.tabulate([['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],['action_id', f"0x{self.action_id:X}", self.action_id],['action_params', f"0x{self.action_params:X}", self.action_params]], tablefmt="texttable")
|
|
1058
|
+
|
|
1059
|
+
def __eq__(self, other):
|
|
1060
|
+
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
1061
|
+
return (
|
|
1062
|
+
self.msg_type == other.msg_type and
|
|
1063
|
+
self.api_version == other.api_version and
|
|
1064
|
+
self.brg_mac == other.brg_mac and
|
|
1065
|
+
self.action_id == other.action_id and
|
|
1066
|
+
self.action_params == other.action_params
|
|
1067
|
+
)
|
|
1068
|
+
return False
|
|
1069
|
+
|
|
1070
|
+
def dump(self):
|
|
1071
|
+
string = bitstruct.pack("u8u8u8u48u8u112", self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.action_id, self.action_params)
|
|
1072
|
+
return string.hex().upper()
|
|
1073
|
+
|
|
1074
|
+
def set(self, string):
|
|
1075
|
+
d = bitstruct.unpack("u8u8u8u48u8u112", binascii.unhexlify(string))
|
|
1076
|
+
self.msg_type = d[0]
|
|
1077
|
+
self.api_version = d[1]
|
|
1078
|
+
self.seq_id = d[2]
|
|
1079
|
+
self.brg_mac = d[3]
|
|
1080
|
+
self.action_id = d[4]
|
|
1081
|
+
self.action_params = d[5]
|
|
1082
|
+
|
|
802
1083
|
class ActionGenericV12():
|
|
803
1084
|
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_ACTION, api_version=API_VERSION_V12, seq_id=0, brg_mac=ACTION_EMPTY, action_id=0, action_params=0):
|
|
804
1085
|
self.msg_type = msg_type
|
|
@@ -1027,6 +1308,47 @@ class ActionGenericV7():
|
|
|
1027
1308
|
self.action_id = d[4]
|
|
1028
1309
|
self.action_params = d[5]
|
|
1029
1310
|
|
|
1311
|
+
class ActionGwHbV13():
|
|
1312
|
+
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_ACTION, api_version=API_VERSION_V13, seq_id=0, brg_mac=ACTION_EMPTY, action_id=ACTION_GW_HB, gw_id=0, rssi=0):
|
|
1313
|
+
self.msg_type = msg_type
|
|
1314
|
+
self.api_version = api_version
|
|
1315
|
+
self.seq_id = seq_id
|
|
1316
|
+
self.brg_mac = brg_mac
|
|
1317
|
+
self.action_id = action_id
|
|
1318
|
+
self.gw_id = gw_id
|
|
1319
|
+
self.rssi = rssi
|
|
1320
|
+
if raw:
|
|
1321
|
+
self.set(raw)
|
|
1322
|
+
|
|
1323
|
+
def __repr__(self) -> str:
|
|
1324
|
+
return "\n==> Packet action_gw_hb_v13 <==\n" + tabulate.tabulate([['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],['action_id', f"0x{self.action_id:X}", self.action_id],['gw_id', f"0x{self.gw_id:X}", self.gw_id],['rssi', f"0x{self.rssi:X}", self.rssi]], tablefmt="texttable")
|
|
1325
|
+
|
|
1326
|
+
def __eq__(self, other):
|
|
1327
|
+
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
1328
|
+
return (
|
|
1329
|
+
self.msg_type == other.msg_type and
|
|
1330
|
+
self.api_version == other.api_version and
|
|
1331
|
+
self.brg_mac == other.brg_mac and
|
|
1332
|
+
self.action_id == other.action_id and
|
|
1333
|
+
self.gw_id == other.gw_id and
|
|
1334
|
+
self.rssi == other.rssi
|
|
1335
|
+
)
|
|
1336
|
+
return False
|
|
1337
|
+
|
|
1338
|
+
def dump(self):
|
|
1339
|
+
string = bitstruct.pack("u8u8u8u48u8u104u8", self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.action_id, self.gw_id, self.rssi)
|
|
1340
|
+
return string.hex().upper()
|
|
1341
|
+
|
|
1342
|
+
def set(self, string):
|
|
1343
|
+
d = bitstruct.unpack("u8u8u8u48u8u104u8", binascii.unhexlify(string))
|
|
1344
|
+
self.msg_type = d[0]
|
|
1345
|
+
self.api_version = d[1]
|
|
1346
|
+
self.seq_id = d[2]
|
|
1347
|
+
self.brg_mac = d[3]
|
|
1348
|
+
self.action_id = d[4]
|
|
1349
|
+
self.gw_id = d[5]
|
|
1350
|
+
self.rssi = d[6]
|
|
1351
|
+
|
|
1030
1352
|
class ActionGwHbV12():
|
|
1031
1353
|
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_ACTION, api_version=API_VERSION_V12, seq_id=0, brg_mac=ACTION_EMPTY, action_id=ACTION_GW_HB, gw_id=0, rssi=0):
|
|
1032
1354
|
self.msg_type = msg_type
|
|
@@ -1232,6 +1554,44 @@ class ActionGwHbV8():
|
|
|
1232
1554
|
self.gw_id = d[5]
|
|
1233
1555
|
self.rssi = d[6]
|
|
1234
1556
|
|
|
1557
|
+
class ActionRebootV13():
|
|
1558
|
+
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_ACTION, api_version=API_VERSION_V13, seq_id=0, brg_mac=ACTION_EMPTY, action_id=ACTION_REBOOT, gw_id=0):
|
|
1559
|
+
self.msg_type = msg_type
|
|
1560
|
+
self.api_version = api_version
|
|
1561
|
+
self.seq_id = seq_id
|
|
1562
|
+
self.brg_mac = brg_mac
|
|
1563
|
+
self.action_id = action_id
|
|
1564
|
+
self.gw_id = gw_id
|
|
1565
|
+
if raw:
|
|
1566
|
+
self.set(raw)
|
|
1567
|
+
|
|
1568
|
+
def __repr__(self) -> str:
|
|
1569
|
+
return "\n==> Packet action_reboot_v13 <==\n" + tabulate.tabulate([['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],['action_id', f"0x{self.action_id:X}", self.action_id],['gw_id', f"0x{self.gw_id:X}", self.gw_id]], tablefmt="texttable")
|
|
1570
|
+
|
|
1571
|
+
def __eq__(self, other):
|
|
1572
|
+
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
1573
|
+
return (
|
|
1574
|
+
self.msg_type == other.msg_type and
|
|
1575
|
+
self.api_version == other.api_version and
|
|
1576
|
+
self.brg_mac == other.brg_mac and
|
|
1577
|
+
self.action_id == other.action_id and
|
|
1578
|
+
self.gw_id == other.gw_id
|
|
1579
|
+
)
|
|
1580
|
+
return False
|
|
1581
|
+
|
|
1582
|
+
def dump(self):
|
|
1583
|
+
string = bitstruct.pack("u8u8u8u48u8u112", self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.action_id, self.gw_id)
|
|
1584
|
+
return string.hex().upper()
|
|
1585
|
+
|
|
1586
|
+
def set(self, string):
|
|
1587
|
+
d = bitstruct.unpack("u8u8u8u48u8u112", binascii.unhexlify(string))
|
|
1588
|
+
self.msg_type = d[0]
|
|
1589
|
+
self.api_version = d[1]
|
|
1590
|
+
self.seq_id = d[2]
|
|
1591
|
+
self.brg_mac = d[3]
|
|
1592
|
+
self.action_id = d[4]
|
|
1593
|
+
self.gw_id = d[5]
|
|
1594
|
+
|
|
1235
1595
|
class ActionRebootV12():
|
|
1236
1596
|
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_ACTION, api_version=API_VERSION_V12, seq_id=0, brg_mac=ACTION_EMPTY, action_id=ACTION_REBOOT, gw_id=0):
|
|
1237
1597
|
self.msg_type = msg_type
|
|
@@ -1422,6 +1782,43 @@ class ActionRebootV8():
|
|
|
1422
1782
|
self.action_id = d[4]
|
|
1423
1783
|
self.gw_id = d[5]
|
|
1424
1784
|
|
|
1785
|
+
class ActionBlinkV13():
|
|
1786
|
+
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_ACTION, api_version=API_VERSION_V13, seq_id=0, brg_mac=ACTION_EMPTY, action_id=ACTION_BLINK, unused0=0):
|
|
1787
|
+
self.msg_type = msg_type
|
|
1788
|
+
self.api_version = api_version
|
|
1789
|
+
self.seq_id = seq_id
|
|
1790
|
+
self.brg_mac = brg_mac
|
|
1791
|
+
self.action_id = action_id
|
|
1792
|
+
self.unused0 = unused0
|
|
1793
|
+
if raw:
|
|
1794
|
+
self.set(raw)
|
|
1795
|
+
|
|
1796
|
+
def __repr__(self) -> str:
|
|
1797
|
+
return "\n==> Packet action_blink_v13 <==\n" + tabulate.tabulate([['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],['action_id', f"0x{self.action_id:X}", self.action_id]], tablefmt="texttable")
|
|
1798
|
+
|
|
1799
|
+
def __eq__(self, other):
|
|
1800
|
+
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
1801
|
+
return (
|
|
1802
|
+
self.msg_type == other.msg_type and
|
|
1803
|
+
self.api_version == other.api_version and
|
|
1804
|
+
self.brg_mac == other.brg_mac and
|
|
1805
|
+
self.action_id == other.action_id
|
|
1806
|
+
)
|
|
1807
|
+
return False
|
|
1808
|
+
|
|
1809
|
+
def dump(self):
|
|
1810
|
+
string = bitstruct.pack("u8u8u8u48u8u112", self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.action_id, self.unused0)
|
|
1811
|
+
return string.hex().upper()
|
|
1812
|
+
|
|
1813
|
+
def set(self, string):
|
|
1814
|
+
d = bitstruct.unpack("u8u8u8u48u8u112", binascii.unhexlify(string))
|
|
1815
|
+
self.msg_type = d[0]
|
|
1816
|
+
self.api_version = d[1]
|
|
1817
|
+
self.seq_id = d[2]
|
|
1818
|
+
self.brg_mac = d[3]
|
|
1819
|
+
self.action_id = d[4]
|
|
1820
|
+
self.unused0 = d[5]
|
|
1821
|
+
|
|
1425
1822
|
class ActionBlinkV12():
|
|
1426
1823
|
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_ACTION, api_version=API_VERSION_V12, seq_id=0, brg_mac=ACTION_EMPTY, action_id=ACTION_BLINK, unused0=0):
|
|
1427
1824
|
self.msg_type = msg_type
|
|
@@ -1607,6 +2004,67 @@ class ActionBlinkV8():
|
|
|
1607
2004
|
self.action_id = d[4]
|
|
1608
2005
|
self.unused0 = d[5]
|
|
1609
2006
|
|
|
2007
|
+
class ActionGetModuleV13():
|
|
2008
|
+
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_ACTION, api_version=API_VERSION_V13, seq_id=0, brg_mac=ACTION_EMPTY, action_id=ACTION_GET_MODULE, interface=0, datapath=0, energy2400=0, energy_sub1g=0, calibration=0, pwr_mgmt=0, ext_sensors=0, custom=0, unused0=0):
|
|
2009
|
+
self.msg_type = msg_type
|
|
2010
|
+
self.api_version = api_version
|
|
2011
|
+
self.seq_id = seq_id
|
|
2012
|
+
self.brg_mac = brg_mac
|
|
2013
|
+
self.action_id = action_id
|
|
2014
|
+
self.interface = interface
|
|
2015
|
+
self.datapath = datapath
|
|
2016
|
+
self.energy2400 = energy2400
|
|
2017
|
+
self.energy_sub1g = energy_sub1g
|
|
2018
|
+
self.calibration = calibration
|
|
2019
|
+
self.pwr_mgmt = pwr_mgmt
|
|
2020
|
+
self.ext_sensors = ext_sensors
|
|
2021
|
+
self.custom = custom
|
|
2022
|
+
self.unused0 = unused0
|
|
2023
|
+
if raw:
|
|
2024
|
+
self.set(raw)
|
|
2025
|
+
|
|
2026
|
+
def __repr__(self) -> str:
|
|
2027
|
+
return "\n==> Packet action_get_module_v13 <==\n" + tabulate.tabulate([['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],['action_id', f"0x{self.action_id:X}", self.action_id],['interface', f"0x{self.interface:X}", self.interface],['datapath', f"0x{self.datapath:X}", self.datapath],['energy2400', f"0x{self.energy2400:X}", self.energy2400],['energy_sub1g', f"0x{self.energy_sub1g:X}", self.energy_sub1g],['calibration', f"0x{self.calibration:X}", self.calibration],['pwr_mgmt', f"0x{self.pwr_mgmt:X}", self.pwr_mgmt],['ext_sensors', f"0x{self.ext_sensors:X}", self.ext_sensors],['custom', f"0x{self.custom:X}", self.custom]], tablefmt="texttable")
|
|
2028
|
+
|
|
2029
|
+
def __eq__(self, other):
|
|
2030
|
+
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
2031
|
+
return (
|
|
2032
|
+
self.msg_type == other.msg_type and
|
|
2033
|
+
self.api_version == other.api_version and
|
|
2034
|
+
self.brg_mac == other.brg_mac and
|
|
2035
|
+
self.action_id == other.action_id and
|
|
2036
|
+
self.interface == other.interface and
|
|
2037
|
+
self.datapath == other.datapath and
|
|
2038
|
+
self.energy2400 == other.energy2400 and
|
|
2039
|
+
self.energy_sub1g == other.energy_sub1g and
|
|
2040
|
+
self.calibration == other.calibration and
|
|
2041
|
+
self.pwr_mgmt == other.pwr_mgmt and
|
|
2042
|
+
self.ext_sensors == other.ext_sensors and
|
|
2043
|
+
self.custom == other.custom
|
|
2044
|
+
)
|
|
2045
|
+
return False
|
|
2046
|
+
|
|
2047
|
+
def dump(self):
|
|
2048
|
+
string = bitstruct.pack("u8u8u8u48u8u1u1u1u1u1u1u1u1u104", self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.action_id, self.interface, self.datapath, self.energy2400, self.energy_sub1g, self.calibration, self.pwr_mgmt, self.ext_sensors, self.custom, self.unused0)
|
|
2049
|
+
return string.hex().upper()
|
|
2050
|
+
|
|
2051
|
+
def set(self, string):
|
|
2052
|
+
d = bitstruct.unpack("u8u8u8u48u8u1u1u1u1u1u1u1u1u104", binascii.unhexlify(string))
|
|
2053
|
+
self.msg_type = d[0]
|
|
2054
|
+
self.api_version = d[1]
|
|
2055
|
+
self.seq_id = d[2]
|
|
2056
|
+
self.brg_mac = d[3]
|
|
2057
|
+
self.action_id = d[4]
|
|
2058
|
+
self.interface = d[5]
|
|
2059
|
+
self.datapath = d[6]
|
|
2060
|
+
self.energy2400 = d[7]
|
|
2061
|
+
self.energy_sub1g = d[8]
|
|
2062
|
+
self.calibration = d[9]
|
|
2063
|
+
self.pwr_mgmt = d[10]
|
|
2064
|
+
self.ext_sensors = d[11]
|
|
2065
|
+
self.custom = d[12]
|
|
2066
|
+
self.unused0 = d[13]
|
|
2067
|
+
|
|
1610
2068
|
class ActionGetModuleV12():
|
|
1611
2069
|
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_ACTION, api_version=API_VERSION_V12, seq_id=0, brg_mac=ACTION_EMPTY, action_id=ACTION_GET_MODULE, interface=0, datapath=0, energy2400=0, energy_sub1g=0, calibration=0, pwr_mgmt=0, ext_sensors=0, custom=0, unused0=0):
|
|
1612
2070
|
self.msg_type = msg_type
|
|
@@ -1912,6 +2370,43 @@ class ActionGetModuleV8():
|
|
|
1912
2370
|
self.custom = d[12]
|
|
1913
2371
|
self.unused0 = d[13]
|
|
1914
2372
|
|
|
2373
|
+
class ActionRestoreDefaultsV13():
|
|
2374
|
+
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_ACTION, api_version=API_VERSION_V13, seq_id=0, brg_mac=ACTION_EMPTY, action_id=ACTION_RESTORE_DEFAULTS, unused0=0):
|
|
2375
|
+
self.msg_type = msg_type
|
|
2376
|
+
self.api_version = api_version
|
|
2377
|
+
self.seq_id = seq_id
|
|
2378
|
+
self.brg_mac = brg_mac
|
|
2379
|
+
self.action_id = action_id
|
|
2380
|
+
self.unused0 = unused0
|
|
2381
|
+
if raw:
|
|
2382
|
+
self.set(raw)
|
|
2383
|
+
|
|
2384
|
+
def __repr__(self) -> str:
|
|
2385
|
+
return "\n==> Packet action_restore_defaults_v13 <==\n" + tabulate.tabulate([['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],['action_id', f"0x{self.action_id:X}", self.action_id]], tablefmt="texttable")
|
|
2386
|
+
|
|
2387
|
+
def __eq__(self, other):
|
|
2388
|
+
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
2389
|
+
return (
|
|
2390
|
+
self.msg_type == other.msg_type and
|
|
2391
|
+
self.api_version == other.api_version and
|
|
2392
|
+
self.brg_mac == other.brg_mac and
|
|
2393
|
+
self.action_id == other.action_id
|
|
2394
|
+
)
|
|
2395
|
+
return False
|
|
2396
|
+
|
|
2397
|
+
def dump(self):
|
|
2398
|
+
string = bitstruct.pack("u8u8u8u48u8u112", self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.action_id, self.unused0)
|
|
2399
|
+
return string.hex().upper()
|
|
2400
|
+
|
|
2401
|
+
def set(self, string):
|
|
2402
|
+
d = bitstruct.unpack("u8u8u8u48u8u112", binascii.unhexlify(string))
|
|
2403
|
+
self.msg_type = d[0]
|
|
2404
|
+
self.api_version = d[1]
|
|
2405
|
+
self.seq_id = d[2]
|
|
2406
|
+
self.brg_mac = d[3]
|
|
2407
|
+
self.action_id = d[4]
|
|
2408
|
+
self.unused0 = d[5]
|
|
2409
|
+
|
|
1915
2410
|
class ActionRestoreDefaultsV12():
|
|
1916
2411
|
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_ACTION, api_version=API_VERSION_V12, seq_id=0, brg_mac=ACTION_EMPTY, action_id=ACTION_RESTORE_DEFAULTS, unused0=0):
|
|
1917
2412
|
self.msg_type = msg_type
|
|
@@ -2097,6 +2592,43 @@ class ActionRestoreDefaultsV8():
|
|
|
2097
2592
|
self.action_id = d[4]
|
|
2098
2593
|
self.unused0 = d[5]
|
|
2099
2594
|
|
|
2595
|
+
class ActionSendHbV13():
|
|
2596
|
+
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_ACTION, api_version=API_VERSION_V13, seq_id=0, brg_mac=ACTION_EMPTY, action_id=ACTION_SEND_HB, unused0=0):
|
|
2597
|
+
self.msg_type = msg_type
|
|
2598
|
+
self.api_version = api_version
|
|
2599
|
+
self.seq_id = seq_id
|
|
2600
|
+
self.brg_mac = brg_mac
|
|
2601
|
+
self.action_id = action_id
|
|
2602
|
+
self.unused0 = unused0
|
|
2603
|
+
if raw:
|
|
2604
|
+
self.set(raw)
|
|
2605
|
+
|
|
2606
|
+
def __repr__(self) -> str:
|
|
2607
|
+
return "\n==> Packet action_send_hb_v13 <==\n" + tabulate.tabulate([['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],['action_id', f"0x{self.action_id:X}", self.action_id]], tablefmt="texttable")
|
|
2608
|
+
|
|
2609
|
+
def __eq__(self, other):
|
|
2610
|
+
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
2611
|
+
return (
|
|
2612
|
+
self.msg_type == other.msg_type and
|
|
2613
|
+
self.api_version == other.api_version and
|
|
2614
|
+
self.brg_mac == other.brg_mac and
|
|
2615
|
+
self.action_id == other.action_id
|
|
2616
|
+
)
|
|
2617
|
+
return False
|
|
2618
|
+
|
|
2619
|
+
def dump(self):
|
|
2620
|
+
string = bitstruct.pack("u8u8u8u48u8u112", self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.action_id, self.unused0)
|
|
2621
|
+
return string.hex().upper()
|
|
2622
|
+
|
|
2623
|
+
def set(self, string):
|
|
2624
|
+
d = bitstruct.unpack("u8u8u8u48u8u112", binascii.unhexlify(string))
|
|
2625
|
+
self.msg_type = d[0]
|
|
2626
|
+
self.api_version = d[1]
|
|
2627
|
+
self.seq_id = d[2]
|
|
2628
|
+
self.brg_mac = d[3]
|
|
2629
|
+
self.action_id = d[4]
|
|
2630
|
+
self.unused0 = d[5]
|
|
2631
|
+
|
|
2100
2632
|
class ActionSendHbV12():
|
|
2101
2633
|
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_ACTION, api_version=API_VERSION_V12, seq_id=0, brg_mac=ACTION_EMPTY, action_id=ACTION_SEND_HB, unused0=0):
|
|
2102
2634
|
self.msg_type = msg_type
|
|
@@ -2282,6 +2814,43 @@ class ActionSendHbV8():
|
|
|
2282
2814
|
self.action_id = d[4]
|
|
2283
2815
|
self.unused0 = d[5]
|
|
2284
2816
|
|
|
2817
|
+
class ActionGetBatterySensorV13():
|
|
2818
|
+
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_ACTION, api_version=API_VERSION_V13, seq_id=0, brg_mac=ACTION_EMPTY, action_id=ACTION_GET_BATTERY_SENSOR, unused0=0):
|
|
2819
|
+
self.msg_type = msg_type
|
|
2820
|
+
self.api_version = api_version
|
|
2821
|
+
self.seq_id = seq_id
|
|
2822
|
+
self.brg_mac = brg_mac
|
|
2823
|
+
self.action_id = action_id
|
|
2824
|
+
self.unused0 = unused0
|
|
2825
|
+
if raw:
|
|
2826
|
+
self.set(raw)
|
|
2827
|
+
|
|
2828
|
+
def __repr__(self) -> str:
|
|
2829
|
+
return "\n==> Packet action_get_battery_sensor_v13 <==\n" + tabulate.tabulate([['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],['action_id', f"0x{self.action_id:X}", self.action_id]], tablefmt="texttable")
|
|
2830
|
+
|
|
2831
|
+
def __eq__(self, other):
|
|
2832
|
+
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
2833
|
+
return (
|
|
2834
|
+
self.msg_type == other.msg_type and
|
|
2835
|
+
self.api_version == other.api_version and
|
|
2836
|
+
self.brg_mac == other.brg_mac and
|
|
2837
|
+
self.action_id == other.action_id
|
|
2838
|
+
)
|
|
2839
|
+
return False
|
|
2840
|
+
|
|
2841
|
+
def dump(self):
|
|
2842
|
+
string = bitstruct.pack("u8u8u8u48u8u112", self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.action_id, self.unused0)
|
|
2843
|
+
return string.hex().upper()
|
|
2844
|
+
|
|
2845
|
+
def set(self, string):
|
|
2846
|
+
d = bitstruct.unpack("u8u8u8u48u8u112", binascii.unhexlify(string))
|
|
2847
|
+
self.msg_type = d[0]
|
|
2848
|
+
self.api_version = d[1]
|
|
2849
|
+
self.seq_id = d[2]
|
|
2850
|
+
self.brg_mac = d[3]
|
|
2851
|
+
self.action_id = d[4]
|
|
2852
|
+
self.unused0 = d[5]
|
|
2853
|
+
|
|
2285
2854
|
class ActionGetBatterySensorV12():
|
|
2286
2855
|
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_ACTION, api_version=API_VERSION_V12, seq_id=0, brg_mac=ACTION_EMPTY, action_id=ACTION_GET_BATTERY_SENSOR, unused0=0):
|
|
2287
2856
|
self.msg_type = msg_type
|
|
@@ -2467,6 +3036,43 @@ class ActionGetBatterySensorV8():
|
|
|
2467
3036
|
self.action_id = d[4]
|
|
2468
3037
|
self.unused0 = d[5]
|
|
2469
3038
|
|
|
3039
|
+
class ActionGetPofDataV13():
|
|
3040
|
+
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_ACTION, api_version=API_VERSION_V13, seq_id=0, brg_mac=ACTION_EMPTY, action_id=ACTION_GET_POF_DATA, unused0=0):
|
|
3041
|
+
self.msg_type = msg_type
|
|
3042
|
+
self.api_version = api_version
|
|
3043
|
+
self.seq_id = seq_id
|
|
3044
|
+
self.brg_mac = brg_mac
|
|
3045
|
+
self.action_id = action_id
|
|
3046
|
+
self.unused0 = unused0
|
|
3047
|
+
if raw:
|
|
3048
|
+
self.set(raw)
|
|
3049
|
+
|
|
3050
|
+
def __repr__(self) -> str:
|
|
3051
|
+
return "\n==> Packet action_get_pof_data_v13 <==\n" + tabulate.tabulate([['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],['action_id', f"0x{self.action_id:X}", self.action_id]], tablefmt="texttable")
|
|
3052
|
+
|
|
3053
|
+
def __eq__(self, other):
|
|
3054
|
+
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
3055
|
+
return (
|
|
3056
|
+
self.msg_type == other.msg_type and
|
|
3057
|
+
self.api_version == other.api_version and
|
|
3058
|
+
self.brg_mac == other.brg_mac and
|
|
3059
|
+
self.action_id == other.action_id
|
|
3060
|
+
)
|
|
3061
|
+
return False
|
|
3062
|
+
|
|
3063
|
+
def dump(self):
|
|
3064
|
+
string = bitstruct.pack("u8u8u8u48u8u112", self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.action_id, self.unused0)
|
|
3065
|
+
return string.hex().upper()
|
|
3066
|
+
|
|
3067
|
+
def set(self, string):
|
|
3068
|
+
d = bitstruct.unpack("u8u8u8u48u8u112", binascii.unhexlify(string))
|
|
3069
|
+
self.msg_type = d[0]
|
|
3070
|
+
self.api_version = d[1]
|
|
3071
|
+
self.seq_id = d[2]
|
|
3072
|
+
self.brg_mac = d[3]
|
|
3073
|
+
self.action_id = d[4]
|
|
3074
|
+
self.unused0 = d[5]
|
|
3075
|
+
|
|
2470
3076
|
class ActionGetPofDataV12():
|
|
2471
3077
|
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_ACTION, api_version=API_VERSION_V12, seq_id=0, brg_mac=ACTION_EMPTY, action_id=ACTION_GET_POF_DATA, unused0=0):
|
|
2472
3078
|
self.msg_type = msg_type
|
|
@@ -2652,6 +3258,46 @@ class ActionGetPofDataV8():
|
|
|
2652
3258
|
self.action_id = d[4]
|
|
2653
3259
|
self.unused0 = d[5]
|
|
2654
3260
|
|
|
3261
|
+
class ActionPlStatusV13():
|
|
3262
|
+
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_ACTION, api_version=API_VERSION_V13, seq_id=0, brg_mac=ACTION_EMPTY, action_id=ACTION_PL_STATUS, status=0, unused0=0):
|
|
3263
|
+
self.msg_type = msg_type
|
|
3264
|
+
self.api_version = api_version
|
|
3265
|
+
self.seq_id = seq_id
|
|
3266
|
+
self.brg_mac = brg_mac
|
|
3267
|
+
self.action_id = action_id
|
|
3268
|
+
self.status = status
|
|
3269
|
+
self.unused0 = unused0
|
|
3270
|
+
if raw:
|
|
3271
|
+
self.set(raw)
|
|
3272
|
+
|
|
3273
|
+
def __repr__(self) -> str:
|
|
3274
|
+
return "\n==> Packet action_pl_status_v13 <==\n" + tabulate.tabulate([['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],['action_id', f"0x{self.action_id:X}", self.action_id],['status', f"0x{self.status:X}", self.status]], tablefmt="texttable")
|
|
3275
|
+
|
|
3276
|
+
def __eq__(self, other):
|
|
3277
|
+
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
3278
|
+
return (
|
|
3279
|
+
self.msg_type == other.msg_type and
|
|
3280
|
+
self.api_version == other.api_version and
|
|
3281
|
+
self.brg_mac == other.brg_mac and
|
|
3282
|
+
self.action_id == other.action_id and
|
|
3283
|
+
self.status == other.status
|
|
3284
|
+
)
|
|
3285
|
+
return False
|
|
3286
|
+
|
|
3287
|
+
def dump(self):
|
|
3288
|
+
string = bitstruct.pack("u8u8u8u48u8u8u104", self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.action_id, self.status, self.unused0)
|
|
3289
|
+
return string.hex().upper()
|
|
3290
|
+
|
|
3291
|
+
def set(self, string):
|
|
3292
|
+
d = bitstruct.unpack("u8u8u8u48u8u8u104", binascii.unhexlify(string))
|
|
3293
|
+
self.msg_type = d[0]
|
|
3294
|
+
self.api_version = d[1]
|
|
3295
|
+
self.seq_id = d[2]
|
|
3296
|
+
self.brg_mac = d[3]
|
|
3297
|
+
self.action_id = d[4]
|
|
3298
|
+
self.status = d[5]
|
|
3299
|
+
self.unused0 = d[6]
|
|
3300
|
+
|
|
2655
3301
|
class ActionPlStatusV12():
|
|
2656
3302
|
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_ACTION, api_version=API_VERSION_V12, seq_id=0, brg_mac=ACTION_EMPTY, action_id=ACTION_PL_STATUS, status=0, unused0=0):
|
|
2657
3303
|
self.msg_type = msg_type
|
|
@@ -2772,6 +3418,52 @@ class ActionPlStatusV10():
|
|
|
2772
3418
|
self.status = d[5]
|
|
2773
3419
|
self.unused0 = d[6]
|
|
2774
3420
|
|
|
3421
|
+
class Brg2BrgOtaV13():
|
|
3422
|
+
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_BRG2BRG, api_version=API_VERSION_V13, seq_id=0, src_brg_mac=ACTION_EMPTY, action_id=BRG2BRG_ACTION_OTA, dest_brg_mac=ACTION_EMPTY, app=0, bootloader=0, unused0=0):
|
|
3423
|
+
self.msg_type = msg_type
|
|
3424
|
+
self.api_version = api_version
|
|
3425
|
+
self.seq_id = seq_id
|
|
3426
|
+
self.src_brg_mac = src_brg_mac
|
|
3427
|
+
self.action_id = action_id
|
|
3428
|
+
self.dest_brg_mac = dest_brg_mac
|
|
3429
|
+
self.app = app
|
|
3430
|
+
self.bootloader = bootloader
|
|
3431
|
+
self.unused0 = unused0
|
|
3432
|
+
if raw:
|
|
3433
|
+
self.set(raw)
|
|
3434
|
+
|
|
3435
|
+
def __repr__(self) -> str:
|
|
3436
|
+
return "\n==> Packet brg2brg_ota_v13 <==\n" + tabulate.tabulate([['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],['src_brg_mac', f"0x{self.src_brg_mac:X}", self.src_brg_mac],['action_id', f"0x{self.action_id:X}", self.action_id],['dest_brg_mac', f"0x{self.dest_brg_mac:X}", self.dest_brg_mac],['app', f"0x{self.app:X}", self.app],['bootloader', f"0x{self.bootloader:X}", self.bootloader]], tablefmt="texttable")
|
|
3437
|
+
|
|
3438
|
+
def __eq__(self, other):
|
|
3439
|
+
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
3440
|
+
return (
|
|
3441
|
+
self.msg_type == other.msg_type and
|
|
3442
|
+
self.api_version == other.api_version and
|
|
3443
|
+
self.src_brg_mac == other.src_brg_mac and
|
|
3444
|
+
self.action_id == other.action_id and
|
|
3445
|
+
self.dest_brg_mac == other.dest_brg_mac and
|
|
3446
|
+
self.app == other.app and
|
|
3447
|
+
self.bootloader == other.bootloader
|
|
3448
|
+
)
|
|
3449
|
+
return False
|
|
3450
|
+
|
|
3451
|
+
def dump(self):
|
|
3452
|
+
string = bitstruct.pack("u8u8u8u48u8u48u8u8u48", self.msg_type, self.api_version, self.seq_id, self.src_brg_mac, self.action_id, self.dest_brg_mac, self.app, self.bootloader, self.unused0)
|
|
3453
|
+
return string.hex().upper()
|
|
3454
|
+
|
|
3455
|
+
def set(self, string):
|
|
3456
|
+
d = bitstruct.unpack("u8u8u8u48u8u48u8u8u48", binascii.unhexlify(string))
|
|
3457
|
+
self.msg_type = d[0]
|
|
3458
|
+
self.api_version = d[1]
|
|
3459
|
+
self.seq_id = d[2]
|
|
3460
|
+
self.src_brg_mac = d[3]
|
|
3461
|
+
self.action_id = d[4]
|
|
3462
|
+
self.dest_brg_mac = d[5]
|
|
3463
|
+
self.app = d[6]
|
|
3464
|
+
self.bootloader = d[7]
|
|
3465
|
+
self.unused0 = d[8]
|
|
3466
|
+
|
|
2775
3467
|
class Brg2BrgOtaV12():
|
|
2776
3468
|
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_BRG2BRG, api_version=API_VERSION_V12, seq_id=0, src_brg_mac=ACTION_EMPTY, action_id=BRG2BRG_ACTION_OTA, dest_brg_mac=ACTION_EMPTY, app=0, bootloader=0, unused0=0):
|
|
2777
3469
|
self.msg_type = msg_type
|
|
@@ -2950,6 +3642,51 @@ class Brg2BrgOtaV9():
|
|
|
2950
3642
|
self.dest_brg_mac = d[5]
|
|
2951
3643
|
self.unused0 = d[6]
|
|
2952
3644
|
|
|
3645
|
+
class Brg2BrgCfgV13():
|
|
3646
|
+
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_BRG2BRG, api_version=API_VERSION_V13, seq_id=0, src_brg_mac=ACTION_EMPTY, action_id=BRG2BRG_ACTION_CFG, dest_brg_mac=ACTION_EMPTY, module_type=MODULE_EMPTY, unused0=0, unused1=0):
|
|
3647
|
+
self.msg_type = msg_type
|
|
3648
|
+
self.api_version = api_version
|
|
3649
|
+
self.seq_id = seq_id
|
|
3650
|
+
self.src_brg_mac = src_brg_mac
|
|
3651
|
+
self.action_id = action_id
|
|
3652
|
+
self.dest_brg_mac = dest_brg_mac
|
|
3653
|
+
self.module_type = module_type
|
|
3654
|
+
self.unused0 = unused0
|
|
3655
|
+
self.unused1 = unused1
|
|
3656
|
+
if raw:
|
|
3657
|
+
self.set(raw)
|
|
3658
|
+
|
|
3659
|
+
def __repr__(self) -> str:
|
|
3660
|
+
return "\n==> Packet brg2brg_cfg_v13 <==\n" + tabulate.tabulate([['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],['src_brg_mac', f"0x{self.src_brg_mac:X}", self.src_brg_mac],['action_id', f"0x{self.action_id:X}", self.action_id],['dest_brg_mac', f"0x{self.dest_brg_mac:X}", self.dest_brg_mac],['module_type', f"0x{self.module_type:X}", self.module_type]], tablefmt="texttable")
|
|
3661
|
+
|
|
3662
|
+
def __eq__(self, other):
|
|
3663
|
+
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
3664
|
+
return (
|
|
3665
|
+
self.msg_type == other.msg_type and
|
|
3666
|
+
self.api_version == other.api_version and
|
|
3667
|
+
self.src_brg_mac == other.src_brg_mac and
|
|
3668
|
+
self.action_id == other.action_id and
|
|
3669
|
+
self.dest_brg_mac == other.dest_brg_mac and
|
|
3670
|
+
self.module_type == other.module_type
|
|
3671
|
+
)
|
|
3672
|
+
return False
|
|
3673
|
+
|
|
3674
|
+
def dump(self):
|
|
3675
|
+
string = bitstruct.pack("u8u8u8u48u8u48u4u4u56", self.msg_type, self.api_version, self.seq_id, self.src_brg_mac, self.action_id, self.dest_brg_mac, self.module_type, self.unused0, self.unused1)
|
|
3676
|
+
return string.hex().upper()
|
|
3677
|
+
|
|
3678
|
+
def set(self, string):
|
|
3679
|
+
d = bitstruct.unpack("u8u8u8u48u8u48u4u4u56", binascii.unhexlify(string))
|
|
3680
|
+
self.msg_type = d[0]
|
|
3681
|
+
self.api_version = d[1]
|
|
3682
|
+
self.seq_id = d[2]
|
|
3683
|
+
self.src_brg_mac = d[3]
|
|
3684
|
+
self.action_id = d[4]
|
|
3685
|
+
self.dest_brg_mac = d[5]
|
|
3686
|
+
self.module_type = d[6]
|
|
3687
|
+
self.unused0 = d[7]
|
|
3688
|
+
self.unused1 = d[8]
|
|
3689
|
+
|
|
2953
3690
|
class Brg2BrgCfgV12():
|
|
2954
3691
|
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_BRG2BRG, api_version=API_VERSION_V12, seq_id=0, src_brg_mac=ACTION_EMPTY, action_id=BRG2BRG_ACTION_CFG, dest_brg_mac=ACTION_EMPTY, module_type=MODULE_EMPTY, unused0=0, unused1=0):
|
|
2955
3692
|
self.msg_type = msg_type
|
|
@@ -4200,6 +4937,45 @@ class Gw2BrgHbV1():
|
|
|
4200
4937
|
self.rx_rssi = d[5]
|
|
4201
4938
|
self.unused1 = d[6]
|
|
4202
4939
|
|
|
4940
|
+
class Brg2GwHbSleepV13():
|
|
4941
|
+
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_HB_SLEEP, api_version=API_VERSION_V13, seq_id=0, brg_mac=0, unused0=0, dynamic=0, unused1=0):
|
|
4942
|
+
self.msg_type = msg_type
|
|
4943
|
+
self.api_version = api_version
|
|
4944
|
+
self.seq_id = seq_id
|
|
4945
|
+
self.brg_mac = brg_mac
|
|
4946
|
+
self.unused0 = unused0
|
|
4947
|
+
self.dynamic = dynamic
|
|
4948
|
+
self.unused1 = unused1
|
|
4949
|
+
if raw:
|
|
4950
|
+
self.set(raw)
|
|
4951
|
+
|
|
4952
|
+
def __repr__(self) -> str:
|
|
4953
|
+
return "\n==> Packet brg2gw_hb_sleep_v13 <==\n" + tabulate.tabulate([['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],['dynamic', f"0x{self.dynamic:X}", self.dynamic]], tablefmt="texttable")
|
|
4954
|
+
|
|
4955
|
+
def __eq__(self, other):
|
|
4956
|
+
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
4957
|
+
return (
|
|
4958
|
+
self.msg_type == other.msg_type and
|
|
4959
|
+
self.api_version == other.api_version and
|
|
4960
|
+
self.brg_mac == other.brg_mac and
|
|
4961
|
+
self.dynamic == other.dynamic
|
|
4962
|
+
)
|
|
4963
|
+
return False
|
|
4964
|
+
|
|
4965
|
+
def dump(self):
|
|
4966
|
+
string = bitstruct.pack("u8u8u8u48u7u1u112", self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.unused0, self.dynamic, self.unused1)
|
|
4967
|
+
return string.hex().upper()
|
|
4968
|
+
|
|
4969
|
+
def set(self, string):
|
|
4970
|
+
d = bitstruct.unpack("u8u8u8u48u7u1u112", binascii.unhexlify(string))
|
|
4971
|
+
self.msg_type = d[0]
|
|
4972
|
+
self.api_version = d[1]
|
|
4973
|
+
self.seq_id = d[2]
|
|
4974
|
+
self.brg_mac = d[3]
|
|
4975
|
+
self.unused0 = d[4]
|
|
4976
|
+
self.dynamic = d[5]
|
|
4977
|
+
self.unused1 = d[6]
|
|
4978
|
+
|
|
4203
4979
|
class Brg2GwHbSleepV12():
|
|
4204
4980
|
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_HB_SLEEP, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, unused0=0, dynamic=0, unused1=0):
|
|
4205
4981
|
self.msg_type = msg_type
|
|
@@ -4317,8 +5093,8 @@ class Brg2GwHbSleepV10():
|
|
|
4317
5093
|
self.dynamic = d[5]
|
|
4318
5094
|
self.unused1 = d[6]
|
|
4319
5095
|
|
|
4320
|
-
class
|
|
4321
|
-
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_HB, api_version=
|
|
5096
|
+
class Brg2GwHbV13():
|
|
5097
|
+
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_HB, api_version=API_VERSION_V13, seq_id=0, brg_mac=0, non_wlt_rx_pkts_ctr=0, bad_crc_pkts_ctr=0, wlt_rx_pkts_ctr=0, wlt_tx_pkts_ctr=0, tags_ctr=0, tx_queue_watermark=0, dynamic=0, effective_pacer_increment=0):
|
|
4322
5098
|
self.msg_type = msg_type
|
|
4323
5099
|
self.api_version = api_version
|
|
4324
5100
|
self.seq_id = seq_id
|
|
@@ -4335,7 +5111,7 @@ class Brg2GwHbV12():
|
|
|
4335
5111
|
self.set(raw)
|
|
4336
5112
|
|
|
4337
5113
|
def __repr__(self) -> str:
|
|
4338
|
-
return "\n==> Packet
|
|
5114
|
+
return "\n==> Packet brg2gw_hb_v13 <==\n" + tabulate.tabulate([['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],['non_wlt_rx_pkts_ctr', f"0x{self.non_wlt_rx_pkts_ctr:X}", self.non_wlt_rx_pkts_ctr],['bad_crc_pkts_ctr', f"0x{self.bad_crc_pkts_ctr:X}", self.bad_crc_pkts_ctr],['wlt_rx_pkts_ctr', f"0x{self.wlt_rx_pkts_ctr:X}", self.wlt_rx_pkts_ctr],['wlt_tx_pkts_ctr', f"0x{self.wlt_tx_pkts_ctr:X}", self.wlt_tx_pkts_ctr],['tags_ctr', f"0x{self.tags_ctr:X}", self.tags_ctr],['tx_queue_watermark', f"0x{self.tx_queue_watermark:X}", self.tx_queue_watermark],['dynamic', f"0x{self.dynamic:X}", self.dynamic],['effective_pacer_increment', f"0x{self.effective_pacer_increment:X}", self.effective_pacer_increment]], tablefmt="texttable")
|
|
4339
5115
|
|
|
4340
5116
|
def __eq__(self, other):
|
|
4341
5117
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -4373,8 +5149,8 @@ class Brg2GwHbV12():
|
|
|
4373
5149
|
self.dynamic = d[10]
|
|
4374
5150
|
self.effective_pacer_increment = d[11]
|
|
4375
5151
|
|
|
4376
|
-
class
|
|
4377
|
-
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_HB, api_version=
|
|
5152
|
+
class Brg2GwHbV12():
|
|
5153
|
+
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_HB, api_version=API_VERSION_V12, seq_id=0, brg_mac=0, non_wlt_rx_pkts_ctr=0, bad_crc_pkts_ctr=0, wlt_rx_pkts_ctr=0, wlt_tx_pkts_ctr=0, tags_ctr=0, tx_queue_watermark=0, dynamic=0, effective_pacer_increment=0):
|
|
4378
5154
|
self.msg_type = msg_type
|
|
4379
5155
|
self.api_version = api_version
|
|
4380
5156
|
self.seq_id = seq_id
|
|
@@ -4391,7 +5167,7 @@ class Brg2GwHbV11():
|
|
|
4391
5167
|
self.set(raw)
|
|
4392
5168
|
|
|
4393
5169
|
def __repr__(self) -> str:
|
|
4394
|
-
return "\n==> Packet
|
|
5170
|
+
return "\n==> Packet brg2gw_hb_v12 <==\n" + tabulate.tabulate([['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],['non_wlt_rx_pkts_ctr', f"0x{self.non_wlt_rx_pkts_ctr:X}", self.non_wlt_rx_pkts_ctr],['bad_crc_pkts_ctr', f"0x{self.bad_crc_pkts_ctr:X}", self.bad_crc_pkts_ctr],['wlt_rx_pkts_ctr', f"0x{self.wlt_rx_pkts_ctr:X}", self.wlt_rx_pkts_ctr],['wlt_tx_pkts_ctr', f"0x{self.wlt_tx_pkts_ctr:X}", self.wlt_tx_pkts_ctr],['tags_ctr', f"0x{self.tags_ctr:X}", self.tags_ctr],['tx_queue_watermark', f"0x{self.tx_queue_watermark:X}", self.tx_queue_watermark],['dynamic', f"0x{self.dynamic:X}", self.dynamic],['effective_pacer_increment', f"0x{self.effective_pacer_increment:X}", self.effective_pacer_increment]], tablefmt="texttable")
|
|
4395
5171
|
|
|
4396
5172
|
def __eq__(self, other):
|
|
4397
5173
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -4429,8 +5205,8 @@ class Brg2GwHbV11():
|
|
|
4429
5205
|
self.dynamic = d[10]
|
|
4430
5206
|
self.effective_pacer_increment = d[11]
|
|
4431
5207
|
|
|
4432
|
-
class
|
|
4433
|
-
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_HB, api_version=
|
|
5208
|
+
class Brg2GwHbV11():
|
|
5209
|
+
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_HB, api_version=API_VERSION_V11, seq_id=0, brg_mac=0, non_wlt_rx_pkts_ctr=0, bad_crc_pkts_ctr=0, wlt_rx_pkts_ctr=0, wlt_tx_pkts_ctr=0, tags_ctr=0, tx_queue_watermark=0, dynamic=0, effective_pacer_increment=0):
|
|
4434
5210
|
self.msg_type = msg_type
|
|
4435
5211
|
self.api_version = api_version
|
|
4436
5212
|
self.seq_id = seq_id
|
|
@@ -4447,7 +5223,7 @@ class Brg2GwHbV10():
|
|
|
4447
5223
|
self.set(raw)
|
|
4448
5224
|
|
|
4449
5225
|
def __repr__(self) -> str:
|
|
4450
|
-
return "\n==> Packet
|
|
5226
|
+
return "\n==> Packet brg2gw_hb_v11 <==\n" + tabulate.tabulate([['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],['non_wlt_rx_pkts_ctr', f"0x{self.non_wlt_rx_pkts_ctr:X}", self.non_wlt_rx_pkts_ctr],['bad_crc_pkts_ctr', f"0x{self.bad_crc_pkts_ctr:X}", self.bad_crc_pkts_ctr],['wlt_rx_pkts_ctr', f"0x{self.wlt_rx_pkts_ctr:X}", self.wlt_rx_pkts_ctr],['wlt_tx_pkts_ctr', f"0x{self.wlt_tx_pkts_ctr:X}", self.wlt_tx_pkts_ctr],['tags_ctr', f"0x{self.tags_ctr:X}", self.tags_ctr],['tx_queue_watermark', f"0x{self.tx_queue_watermark:X}", self.tx_queue_watermark],['dynamic', f"0x{self.dynamic:X}", self.dynamic],['effective_pacer_increment', f"0x{self.effective_pacer_increment:X}", self.effective_pacer_increment]], tablefmt="texttable")
|
|
4451
5227
|
|
|
4452
5228
|
def __eq__(self, other):
|
|
4453
5229
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -4485,8 +5261,8 @@ class Brg2GwHbV10():
|
|
|
4485
5261
|
self.dynamic = d[10]
|
|
4486
5262
|
self.effective_pacer_increment = d[11]
|
|
4487
5263
|
|
|
4488
|
-
class
|
|
4489
|
-
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_HB, api_version=
|
|
5264
|
+
class Brg2GwHbV10():
|
|
5265
|
+
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_HB, api_version=API_VERSION_V10, seq_id=0, brg_mac=0, non_wlt_rx_pkts_ctr=0, bad_crc_pkts_ctr=0, wlt_rx_pkts_ctr=0, wlt_tx_pkts_ctr=0, tags_ctr=0, tx_queue_watermark=0, dynamic=0, effective_pacer_increment=0):
|
|
4490
5266
|
self.msg_type = msg_type
|
|
4491
5267
|
self.api_version = api_version
|
|
4492
5268
|
self.seq_id = seq_id
|
|
@@ -4497,12 +5273,13 @@ class Brg2GwHbV9():
|
|
|
4497
5273
|
self.wlt_tx_pkts_ctr = wlt_tx_pkts_ctr
|
|
4498
5274
|
self.tags_ctr = tags_ctr
|
|
4499
5275
|
self.tx_queue_watermark = tx_queue_watermark
|
|
5276
|
+
self.dynamic = dynamic
|
|
4500
5277
|
self.effective_pacer_increment = effective_pacer_increment
|
|
4501
5278
|
if raw:
|
|
4502
5279
|
self.set(raw)
|
|
4503
5280
|
|
|
4504
5281
|
def __repr__(self) -> str:
|
|
4505
|
-
return "\n==> Packet
|
|
5282
|
+
return "\n==> Packet brg2gw_hb_v10 <==\n" + tabulate.tabulate([['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],['non_wlt_rx_pkts_ctr', f"0x{self.non_wlt_rx_pkts_ctr:X}", self.non_wlt_rx_pkts_ctr],['bad_crc_pkts_ctr', f"0x{self.bad_crc_pkts_ctr:X}", self.bad_crc_pkts_ctr],['wlt_rx_pkts_ctr', f"0x{self.wlt_rx_pkts_ctr:X}", self.wlt_rx_pkts_ctr],['wlt_tx_pkts_ctr', f"0x{self.wlt_tx_pkts_ctr:X}", self.wlt_tx_pkts_ctr],['tags_ctr', f"0x{self.tags_ctr:X}", self.tags_ctr],['tx_queue_watermark', f"0x{self.tx_queue_watermark:X}", self.tx_queue_watermark],['dynamic', f"0x{self.dynamic:X}", self.dynamic],['effective_pacer_increment', f"0x{self.effective_pacer_increment:X}", self.effective_pacer_increment]], tablefmt="texttable")
|
|
4506
5283
|
|
|
4507
5284
|
def __eq__(self, other):
|
|
4508
5285
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -4516,16 +5293,17 @@ class Brg2GwHbV9():
|
|
|
4516
5293
|
self.wlt_tx_pkts_ctr == other.wlt_tx_pkts_ctr and
|
|
4517
5294
|
self.tags_ctr == other.tags_ctr and
|
|
4518
5295
|
self.tx_queue_watermark == other.tx_queue_watermark and
|
|
5296
|
+
self.dynamic == other.dynamic and
|
|
4519
5297
|
self.effective_pacer_increment == other.effective_pacer_increment
|
|
4520
5298
|
)
|
|
4521
5299
|
return False
|
|
4522
5300
|
|
|
4523
5301
|
def dump(self):
|
|
4524
|
-
string = bitstruct.pack("
|
|
5302
|
+
string = bitstruct.pack("u8u8u8u48u24u24u24u16u16u8u1u7", self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.non_wlt_rx_pkts_ctr, self.bad_crc_pkts_ctr, self.wlt_rx_pkts_ctr, self.wlt_tx_pkts_ctr, self.tags_ctr, self.tx_queue_watermark, self.dynamic, self.effective_pacer_increment)
|
|
4525
5303
|
return string.hex().upper()
|
|
4526
5304
|
|
|
4527
5305
|
def set(self, string):
|
|
4528
|
-
d = bitstruct.unpack("
|
|
5306
|
+
d = bitstruct.unpack("u8u8u8u48u24u24u24u16u16u8u1u7", binascii.unhexlify(string))
|
|
4529
5307
|
self.msg_type = d[0]
|
|
4530
5308
|
self.api_version = d[1]
|
|
4531
5309
|
self.seq_id = d[2]
|
|
@@ -4536,10 +5314,11 @@ class Brg2GwHbV9():
|
|
|
4536
5314
|
self.wlt_tx_pkts_ctr = d[7]
|
|
4537
5315
|
self.tags_ctr = d[8]
|
|
4538
5316
|
self.tx_queue_watermark = d[9]
|
|
4539
|
-
self.
|
|
5317
|
+
self.dynamic = d[10]
|
|
5318
|
+
self.effective_pacer_increment = d[11]
|
|
4540
5319
|
|
|
4541
|
-
class
|
|
4542
|
-
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_HB, api_version=
|
|
5320
|
+
class Brg2GwHbV9():
|
|
5321
|
+
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_HB, api_version=API_VERSION_V9, seq_id=0, brg_mac=0, non_wlt_rx_pkts_ctr=0, bad_crc_pkts_ctr=0, wlt_rx_pkts_ctr=0, wlt_tx_pkts_ctr=0, tags_ctr=0, tx_queue_watermark=0, effective_pacer_increment=0):
|
|
4543
5322
|
self.msg_type = msg_type
|
|
4544
5323
|
self.api_version = api_version
|
|
4545
5324
|
self.seq_id = seq_id
|
|
@@ -4550,12 +5329,12 @@ class Brg2GwHbV8():
|
|
|
4550
5329
|
self.wlt_tx_pkts_ctr = wlt_tx_pkts_ctr
|
|
4551
5330
|
self.tags_ctr = tags_ctr
|
|
4552
5331
|
self.tx_queue_watermark = tx_queue_watermark
|
|
4553
|
-
self.
|
|
5332
|
+
self.effective_pacer_increment = effective_pacer_increment
|
|
4554
5333
|
if raw:
|
|
4555
5334
|
self.set(raw)
|
|
4556
5335
|
|
|
4557
5336
|
def __repr__(self) -> str:
|
|
4558
|
-
return "\n==> Packet
|
|
5337
|
+
return "\n==> Packet brg2gw_hb_v9 <==\n" + tabulate.tabulate([['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],['non_wlt_rx_pkts_ctr', f"0x{self.non_wlt_rx_pkts_ctr:X}", self.non_wlt_rx_pkts_ctr],['bad_crc_pkts_ctr', f"0x{self.bad_crc_pkts_ctr:X}", self.bad_crc_pkts_ctr],['wlt_rx_pkts_ctr', f"0x{self.wlt_rx_pkts_ctr:X}", self.wlt_rx_pkts_ctr],['wlt_tx_pkts_ctr', f"0x{self.wlt_tx_pkts_ctr:X}", self.wlt_tx_pkts_ctr],['tags_ctr', f"0x{self.tags_ctr:X}", self.tags_ctr],['tx_queue_watermark', f"0x{self.tx_queue_watermark:X}", self.tx_queue_watermark],['effective_pacer_increment', f"0x{self.effective_pacer_increment:X}", self.effective_pacer_increment]], tablefmt="texttable")
|
|
4559
5338
|
|
|
4560
5339
|
def __eq__(self, other):
|
|
4561
5340
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -4568,12 +5347,13 @@ class Brg2GwHbV8():
|
|
|
4568
5347
|
self.wlt_rx_pkts_ctr == other.wlt_rx_pkts_ctr and
|
|
4569
5348
|
self.wlt_tx_pkts_ctr == other.wlt_tx_pkts_ctr and
|
|
4570
5349
|
self.tags_ctr == other.tags_ctr and
|
|
4571
|
-
self.tx_queue_watermark == other.tx_queue_watermark
|
|
5350
|
+
self.tx_queue_watermark == other.tx_queue_watermark and
|
|
5351
|
+
self.effective_pacer_increment == other.effective_pacer_increment
|
|
4572
5352
|
)
|
|
4573
5353
|
return False
|
|
4574
5354
|
|
|
4575
5355
|
def dump(self):
|
|
4576
|
-
string = bitstruct.pack("u8u8u8u48u24u24u24u16u16u8u8", self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.non_wlt_rx_pkts_ctr, self.bad_crc_pkts_ctr, self.wlt_rx_pkts_ctr, self.wlt_tx_pkts_ctr, self.tags_ctr, self.tx_queue_watermark, self.
|
|
5356
|
+
string = bitstruct.pack("u8u8u8u48u24u24u24u16u16u8u8", self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.non_wlt_rx_pkts_ctr, self.bad_crc_pkts_ctr, self.wlt_rx_pkts_ctr, self.wlt_tx_pkts_ctr, self.tags_ctr, self.tx_queue_watermark, self.effective_pacer_increment)
|
|
4577
5357
|
return string.hex().upper()
|
|
4578
5358
|
|
|
4579
5359
|
def set(self, string):
|
|
@@ -4588,10 +5368,10 @@ class Brg2GwHbV8():
|
|
|
4588
5368
|
self.wlt_tx_pkts_ctr = d[7]
|
|
4589
5369
|
self.tags_ctr = d[8]
|
|
4590
5370
|
self.tx_queue_watermark = d[9]
|
|
4591
|
-
self.
|
|
5371
|
+
self.effective_pacer_increment = d[10]
|
|
4592
5372
|
|
|
4593
|
-
class
|
|
4594
|
-
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_HB, api_version=
|
|
5373
|
+
class Brg2GwHbV8():
|
|
5374
|
+
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_HB, api_version=API_VERSION_V8, seq_id=0, brg_mac=0, non_wlt_rx_pkts_ctr=0, bad_crc_pkts_ctr=0, wlt_rx_pkts_ctr=0, wlt_tx_pkts_ctr=0, tags_ctr=0, tx_queue_watermark=0, unused=0):
|
|
4595
5375
|
self.msg_type = msg_type
|
|
4596
5376
|
self.api_version = api_version
|
|
4597
5377
|
self.seq_id = seq_id
|
|
@@ -4601,12 +5381,13 @@ class Brg2GwHbV7():
|
|
|
4601
5381
|
self.wlt_rx_pkts_ctr = wlt_rx_pkts_ctr
|
|
4602
5382
|
self.wlt_tx_pkts_ctr = wlt_tx_pkts_ctr
|
|
4603
5383
|
self.tags_ctr = tags_ctr
|
|
5384
|
+
self.tx_queue_watermark = tx_queue_watermark
|
|
4604
5385
|
self.unused = unused
|
|
4605
5386
|
if raw:
|
|
4606
5387
|
self.set(raw)
|
|
4607
5388
|
|
|
4608
5389
|
def __repr__(self) -> str:
|
|
4609
|
-
return "\n==> Packet
|
|
5390
|
+
return "\n==> Packet brg2gw_hb_v8 <==\n" + tabulate.tabulate([['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],['non_wlt_rx_pkts_ctr', f"0x{self.non_wlt_rx_pkts_ctr:X}", self.non_wlt_rx_pkts_ctr],['bad_crc_pkts_ctr', f"0x{self.bad_crc_pkts_ctr:X}", self.bad_crc_pkts_ctr],['wlt_rx_pkts_ctr', f"0x{self.wlt_rx_pkts_ctr:X}", self.wlt_rx_pkts_ctr],['wlt_tx_pkts_ctr', f"0x{self.wlt_tx_pkts_ctr:X}", self.wlt_tx_pkts_ctr],['tags_ctr', f"0x{self.tags_ctr:X}", self.tags_ctr],['tx_queue_watermark', f"0x{self.tx_queue_watermark:X}", self.tx_queue_watermark]], tablefmt="texttable")
|
|
4610
5391
|
|
|
4611
5392
|
def __eq__(self, other):
|
|
4612
5393
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -4618,16 +5399,17 @@ class Brg2GwHbV7():
|
|
|
4618
5399
|
self.bad_crc_pkts_ctr == other.bad_crc_pkts_ctr and
|
|
4619
5400
|
self.wlt_rx_pkts_ctr == other.wlt_rx_pkts_ctr and
|
|
4620
5401
|
self.wlt_tx_pkts_ctr == other.wlt_tx_pkts_ctr and
|
|
4621
|
-
self.tags_ctr == other.tags_ctr
|
|
5402
|
+
self.tags_ctr == other.tags_ctr and
|
|
5403
|
+
self.tx_queue_watermark == other.tx_queue_watermark
|
|
4622
5404
|
)
|
|
4623
5405
|
return False
|
|
4624
5406
|
|
|
4625
5407
|
def dump(self):
|
|
4626
|
-
string = bitstruct.pack("
|
|
5408
|
+
string = bitstruct.pack("u8u8u8u48u24u24u24u16u16u8u8", self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.non_wlt_rx_pkts_ctr, self.bad_crc_pkts_ctr, self.wlt_rx_pkts_ctr, self.wlt_tx_pkts_ctr, self.tags_ctr, self.tx_queue_watermark, self.unused)
|
|
4627
5409
|
return string.hex().upper()
|
|
4628
5410
|
|
|
4629
5411
|
def set(self, string):
|
|
4630
|
-
d = bitstruct.unpack("
|
|
5412
|
+
d = bitstruct.unpack("u8u8u8u48u24u24u24u16u16u8u8", binascii.unhexlify(string))
|
|
4631
5413
|
self.msg_type = d[0]
|
|
4632
5414
|
self.api_version = d[1]
|
|
4633
5415
|
self.seq_id = d[2]
|
|
@@ -4637,10 +5419,11 @@ class Brg2GwHbV7():
|
|
|
4637
5419
|
self.wlt_rx_pkts_ctr = d[6]
|
|
4638
5420
|
self.wlt_tx_pkts_ctr = d[7]
|
|
4639
5421
|
self.tags_ctr = d[8]
|
|
4640
|
-
self.
|
|
5422
|
+
self.tx_queue_watermark = d[9]
|
|
5423
|
+
self.unused = d[10]
|
|
4641
5424
|
|
|
4642
|
-
class
|
|
4643
|
-
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_HB, api_version=
|
|
5425
|
+
class Brg2GwHbV7():
|
|
5426
|
+
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_HB, api_version=API_VERSION_V7, seq_id=0, brg_mac=0, non_wlt_rx_pkts_ctr=0, bad_crc_pkts_ctr=0, wlt_rx_pkts_ctr=0, wlt_tx_pkts_ctr=0, tags_ctr=0, unused=0):
|
|
4644
5427
|
self.msg_type = msg_type
|
|
4645
5428
|
self.api_version = api_version
|
|
4646
5429
|
self.seq_id = seq_id
|
|
@@ -4655,7 +5438,7 @@ class Brg2GwHbV6():
|
|
|
4655
5438
|
self.set(raw)
|
|
4656
5439
|
|
|
4657
5440
|
def __repr__(self) -> str:
|
|
4658
|
-
return "\n==> Packet
|
|
5441
|
+
return "\n==> Packet brg2gw_hb_v7 <==\n" + tabulate.tabulate([['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],['non_wlt_rx_pkts_ctr', f"0x{self.non_wlt_rx_pkts_ctr:X}", self.non_wlt_rx_pkts_ctr],['bad_crc_pkts_ctr', f"0x{self.bad_crc_pkts_ctr:X}", self.bad_crc_pkts_ctr],['wlt_rx_pkts_ctr', f"0x{self.wlt_rx_pkts_ctr:X}", self.wlt_rx_pkts_ctr],['wlt_tx_pkts_ctr', f"0x{self.wlt_tx_pkts_ctr:X}", self.wlt_tx_pkts_ctr],['tags_ctr', f"0x{self.tags_ctr:X}", self.tags_ctr]], tablefmt="texttable")
|
|
4659
5442
|
|
|
4660
5443
|
def __eq__(self, other):
|
|
4661
5444
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -4688,7 +5471,7 @@ class Brg2GwHbV6():
|
|
|
4688
5471
|
self.tags_ctr = d[8]
|
|
4689
5472
|
self.unused = d[9]
|
|
4690
5473
|
|
|
4691
|
-
class
|
|
5474
|
+
class Brg2GwHbV6():
|
|
4692
5475
|
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_HB, api_version=API_VERSION_V6, seq_id=0, brg_mac=0, non_wlt_rx_pkts_ctr=0, bad_crc_pkts_ctr=0, wlt_rx_pkts_ctr=0, wlt_tx_pkts_ctr=0, tags_ctr=0, unused=0):
|
|
4693
5476
|
self.msg_type = msg_type
|
|
4694
5477
|
self.api_version = api_version
|
|
@@ -4704,7 +5487,7 @@ class Brg2GwHbV5():
|
|
|
4704
5487
|
self.set(raw)
|
|
4705
5488
|
|
|
4706
5489
|
def __repr__(self) -> str:
|
|
4707
|
-
return "\n==> Packet
|
|
5490
|
+
return "\n==> Packet brg2gw_hb_v6 <==\n" + tabulate.tabulate([['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],['non_wlt_rx_pkts_ctr', f"0x{self.non_wlt_rx_pkts_ctr:X}", self.non_wlt_rx_pkts_ctr],['bad_crc_pkts_ctr', f"0x{self.bad_crc_pkts_ctr:X}", self.bad_crc_pkts_ctr],['wlt_rx_pkts_ctr', f"0x{self.wlt_rx_pkts_ctr:X}", self.wlt_rx_pkts_ctr],['wlt_tx_pkts_ctr', f"0x{self.wlt_tx_pkts_ctr:X}", self.wlt_tx_pkts_ctr],['tags_ctr', f"0x{self.tags_ctr:X}", self.tags_ctr]], tablefmt="texttable")
|
|
4708
5491
|
|
|
4709
5492
|
def __eq__(self, other):
|
|
4710
5493
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -4737,256 +5520,179 @@ class Brg2GwHbV5():
|
|
|
4737
5520
|
self.tags_ctr = d[8]
|
|
4738
5521
|
self.unused = d[9]
|
|
4739
5522
|
|
|
4740
|
-
class
|
|
4741
|
-
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_HB, api_version=
|
|
5523
|
+
class Brg2GwHbV5():
|
|
5524
|
+
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_HB, api_version=API_VERSION_V6, seq_id=0, brg_mac=0, non_wlt_rx_pkts_ctr=0, bad_crc_pkts_ctr=0, wlt_rx_pkts_ctr=0, wlt_tx_pkts_ctr=0, tags_ctr=0, unused=0):
|
|
4742
5525
|
self.msg_type = msg_type
|
|
4743
5526
|
self.api_version = api_version
|
|
4744
5527
|
self.seq_id = seq_id
|
|
4745
|
-
self.gw_mac = gw_mac
|
|
4746
5528
|
self.brg_mac = brg_mac
|
|
4747
|
-
self.
|
|
4748
|
-
self.
|
|
5529
|
+
self.non_wlt_rx_pkts_ctr = non_wlt_rx_pkts_ctr
|
|
5530
|
+
self.bad_crc_pkts_ctr = bad_crc_pkts_ctr
|
|
5531
|
+
self.wlt_rx_pkts_ctr = wlt_rx_pkts_ctr
|
|
5532
|
+
self.wlt_tx_pkts_ctr = wlt_tx_pkts_ctr
|
|
4749
5533
|
self.tags_ctr = tags_ctr
|
|
4750
|
-
self.
|
|
5534
|
+
self.unused = unused
|
|
4751
5535
|
if raw:
|
|
4752
5536
|
self.set(raw)
|
|
4753
5537
|
|
|
4754
5538
|
def __repr__(self) -> str:
|
|
4755
|
-
return "\n==> Packet
|
|
5539
|
+
return "\n==> Packet brg2gw_hb_v5 <==\n" + tabulate.tabulate([['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],['non_wlt_rx_pkts_ctr', f"0x{self.non_wlt_rx_pkts_ctr:X}", self.non_wlt_rx_pkts_ctr],['bad_crc_pkts_ctr', f"0x{self.bad_crc_pkts_ctr:X}", self.bad_crc_pkts_ctr],['wlt_rx_pkts_ctr', f"0x{self.wlt_rx_pkts_ctr:X}", self.wlt_rx_pkts_ctr],['wlt_tx_pkts_ctr', f"0x{self.wlt_tx_pkts_ctr:X}", self.wlt_tx_pkts_ctr],['tags_ctr', f"0x{self.tags_ctr:X}", self.tags_ctr]], tablefmt="texttable")
|
|
4756
5540
|
|
|
4757
5541
|
def __eq__(self, other):
|
|
4758
5542
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
4759
5543
|
return (
|
|
4760
5544
|
self.msg_type == other.msg_type and
|
|
4761
5545
|
self.api_version == other.api_version and
|
|
4762
|
-
self.gw_mac == other.gw_mac and
|
|
4763
5546
|
self.brg_mac == other.brg_mac and
|
|
4764
|
-
self.
|
|
4765
|
-
self.
|
|
5547
|
+
self.non_wlt_rx_pkts_ctr == other.non_wlt_rx_pkts_ctr and
|
|
5548
|
+
self.bad_crc_pkts_ctr == other.bad_crc_pkts_ctr and
|
|
5549
|
+
self.wlt_rx_pkts_ctr == other.wlt_rx_pkts_ctr and
|
|
5550
|
+
self.wlt_tx_pkts_ctr == other.wlt_tx_pkts_ctr and
|
|
4766
5551
|
self.tags_ctr == other.tags_ctr
|
|
4767
5552
|
)
|
|
4768
5553
|
return False
|
|
4769
5554
|
|
|
4770
5555
|
def dump(self):
|
|
4771
|
-
string = bitstruct.pack("
|
|
4772
|
-
return string.hex().upper()
|
|
4773
|
-
|
|
4774
|
-
def set(self, string):
|
|
4775
|
-
d = bitstruct.unpack("u8u8u8u48u48u16u16u16u24", binascii.unhexlify(string))
|
|
4776
|
-
self.msg_type = d[0]
|
|
4777
|
-
self.api_version = d[1]
|
|
4778
|
-
self.seq_id = d[2]
|
|
4779
|
-
self.gw_mac = d[3]
|
|
4780
|
-
self.brg_mac = d[4]
|
|
4781
|
-
self.sent_pkts_ctr = d[5]
|
|
4782
|
-
self.non_wlt_pkts_ctr = d[6]
|
|
4783
|
-
self.tags_ctr = d[7]
|
|
4784
|
-
self.unused1 = d[8]
|
|
4785
|
-
|
|
4786
|
-
class SideInfo():
|
|
4787
|
-
def __init__(self, raw='', brg_mac=0, nfpkt=0, rssi=0, unused2=0, unused0=0, unused1=0, pkt_id=0):
|
|
4788
|
-
self.brg_mac = brg_mac
|
|
4789
|
-
self.nfpkt = nfpkt
|
|
4790
|
-
self.rssi = rssi
|
|
4791
|
-
self.unused2 = unused2
|
|
4792
|
-
self.unused0 = unused0
|
|
4793
|
-
self.unused1 = unused1
|
|
4794
|
-
self.pkt_id = pkt_id
|
|
4795
|
-
if raw:
|
|
4796
|
-
self.set(raw)
|
|
4797
|
-
|
|
4798
|
-
def __repr__(self) -> str:
|
|
4799
|
-
return "\n==> Packet side_info <==\n" + tabulate.tabulate([['brg_mac', f"0x{self.brg_mac:X}", self.brg_mac],['nfpkt', f"0x{self.nfpkt:X}", self.nfpkt],['rssi', f"0x{self.rssi:X}", self.rssi],['pkt_id', f"0x{self.pkt_id:X}", self.pkt_id]], tablefmt="texttable")
|
|
4800
|
-
|
|
4801
|
-
def __eq__(self, other):
|
|
4802
|
-
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
4803
|
-
return (
|
|
4804
|
-
self.brg_mac == other.brg_mac and
|
|
4805
|
-
self.nfpkt == other.nfpkt and
|
|
4806
|
-
self.rssi == other.rssi and
|
|
4807
|
-
self.pkt_id == other.pkt_id
|
|
4808
|
-
)
|
|
4809
|
-
return False
|
|
4810
|
-
|
|
4811
|
-
def dump(self):
|
|
4812
|
-
string = bitstruct.pack("u48u16u8u4u4u80u32", self.brg_mac, self.nfpkt, self.rssi, self.unused2, self.unused0, self.unused1, self.pkt_id)
|
|
4813
|
-
return string.hex().upper()
|
|
4814
|
-
|
|
4815
|
-
def set(self, string):
|
|
4816
|
-
d = bitstruct.unpack("u48u16u8u4u4u80u32", binascii.unhexlify(string))
|
|
4817
|
-
self.brg_mac = d[0]
|
|
4818
|
-
self.nfpkt = d[1]
|
|
4819
|
-
self.rssi = d[2]
|
|
4820
|
-
self.unused2 = d[3]
|
|
4821
|
-
self.unused0 = d[4]
|
|
4822
|
-
self.unused1 = d[5]
|
|
4823
|
-
self.pkt_id = d[6]
|
|
4824
|
-
|
|
4825
|
-
class SensorData():
|
|
4826
|
-
def __init__(self, raw='', data=0, pkt_id=0):
|
|
4827
|
-
self.data = data
|
|
4828
|
-
self.pkt_id = pkt_id
|
|
4829
|
-
if raw:
|
|
4830
|
-
self.set(raw)
|
|
4831
|
-
|
|
4832
|
-
def __repr__(self) -> str:
|
|
4833
|
-
return "\n==> Packet sensor_data <==\n" + tabulate.tabulate([['data', f"0x{self.data:X}", self.data],['pkt_id', f"0x{self.pkt_id:X}", self.pkt_id]], tablefmt="texttable")
|
|
4834
|
-
|
|
4835
|
-
def __eq__(self, other):
|
|
4836
|
-
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
4837
|
-
return (
|
|
4838
|
-
self.data == other.data and
|
|
4839
|
-
self.pkt_id == other.pkt_id
|
|
4840
|
-
)
|
|
4841
|
-
return False
|
|
4842
|
-
|
|
4843
|
-
def dump(self):
|
|
4844
|
-
string = bitstruct.pack("u216u32", self.data, self.pkt_id)
|
|
4845
|
-
return string.hex().upper()
|
|
4846
|
-
|
|
4847
|
-
def set(self, string):
|
|
4848
|
-
d = bitstruct.unpack("u216u32", binascii.unhexlify(string))
|
|
4849
|
-
self.data = d[0]
|
|
4850
|
-
self.pkt_id = d[1]
|
|
4851
|
-
|
|
4852
|
-
class SideInfoSensor():
|
|
4853
|
-
def __init__(self, raw='', brg_mac=0, nfpkt=0, rssi=0, unused2=0, unused0=0, sensor_mac=0, sensor_ad_type=0, sensor_uuid_msb=0, sensor_uuid_lsb=0, api_version=0, unused1=0, is_scrambled=0, is_sensor_embedded=0, is_sensor=0, pkt_id=0):
|
|
4854
|
-
self.brg_mac = brg_mac
|
|
4855
|
-
self.nfpkt = nfpkt
|
|
4856
|
-
self.rssi = rssi
|
|
4857
|
-
self.unused2 = unused2
|
|
4858
|
-
self.unused0 = unused0
|
|
4859
|
-
self.sensor_mac = sensor_mac
|
|
4860
|
-
self.sensor_ad_type = sensor_ad_type
|
|
4861
|
-
self.sensor_uuid_msb = sensor_uuid_msb
|
|
4862
|
-
self.sensor_uuid_lsb = sensor_uuid_lsb
|
|
4863
|
-
self.api_version = api_version
|
|
4864
|
-
self.unused1 = unused1
|
|
4865
|
-
self.is_scrambled = is_scrambled
|
|
4866
|
-
self.is_sensor_embedded = is_sensor_embedded
|
|
4867
|
-
self.is_sensor = is_sensor
|
|
4868
|
-
self.pkt_id = pkt_id
|
|
4869
|
-
if raw:
|
|
4870
|
-
self.set(raw)
|
|
4871
|
-
|
|
4872
|
-
def __repr__(self) -> str:
|
|
4873
|
-
return "\n==> Packet side_info_sensor <==\n" + tabulate.tabulate([['brg_mac', f"0x{self.brg_mac:X}", self.brg_mac],['nfpkt', f"0x{self.nfpkt:X}", self.nfpkt],['rssi', f"0x{self.rssi:X}", self.rssi],['sensor_mac', f"0x{self.sensor_mac:X}", self.sensor_mac],['sensor_ad_type', f"0x{self.sensor_ad_type:X}", self.sensor_ad_type],['sensor_uuid_msb', f"0x{self.sensor_uuid_msb:X}", self.sensor_uuid_msb],['sensor_uuid_lsb', f"0x{self.sensor_uuid_lsb:X}", self.sensor_uuid_lsb],['api_version', f"0x{self.api_version:X}", self.api_version],['is_scrambled', f"0x{self.is_scrambled:X}", self.is_scrambled],['is_sensor_embedded', f"0x{self.is_sensor_embedded:X}", self.is_sensor_embedded],['is_sensor', f"0x{self.is_sensor:X}", self.is_sensor],['pkt_id', f"0x{self.pkt_id:X}", self.pkt_id]], tablefmt="texttable")
|
|
4874
|
-
|
|
4875
|
-
def __eq__(self, other):
|
|
4876
|
-
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
4877
|
-
return (
|
|
4878
|
-
self.brg_mac == other.brg_mac and
|
|
4879
|
-
self.nfpkt == other.nfpkt and
|
|
4880
|
-
self.rssi == other.rssi and
|
|
4881
|
-
self.sensor_mac == other.sensor_mac and
|
|
4882
|
-
self.sensor_ad_type == other.sensor_ad_type and
|
|
4883
|
-
self.sensor_uuid_msb == other.sensor_uuid_msb and
|
|
4884
|
-
self.sensor_uuid_lsb == other.sensor_uuid_lsb and
|
|
4885
|
-
self.api_version == other.api_version and
|
|
4886
|
-
self.is_scrambled == other.is_scrambled and
|
|
4887
|
-
self.is_sensor_embedded == other.is_sensor_embedded and
|
|
4888
|
-
self.is_sensor == other.is_sensor and
|
|
4889
|
-
self.pkt_id == other.pkt_id
|
|
4890
|
-
)
|
|
4891
|
-
return False
|
|
4892
|
-
|
|
4893
|
-
def dump(self):
|
|
4894
|
-
string = bitstruct.pack("u48u16u8u4u4u48u8u8u8u4u1u1u1u1u32", self.brg_mac, self.nfpkt, self.rssi, self.unused2, self.unused0, self.sensor_mac, self.sensor_ad_type, self.sensor_uuid_msb, self.sensor_uuid_lsb, self.api_version, self.unused1, self.is_scrambled, self.is_sensor_embedded, self.is_sensor, self.pkt_id)
|
|
5556
|
+
string = bitstruct.pack("u8u8u8u48u24u24u24u16u16u16", self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.non_wlt_rx_pkts_ctr, self.bad_crc_pkts_ctr, self.wlt_rx_pkts_ctr, self.wlt_tx_pkts_ctr, self.tags_ctr, self.unused)
|
|
4895
5557
|
return string.hex().upper()
|
|
4896
5558
|
|
|
4897
5559
|
def set(self, string):
|
|
4898
|
-
d = bitstruct.unpack("
|
|
4899
|
-
self.
|
|
4900
|
-
self.
|
|
4901
|
-
self.
|
|
4902
|
-
self.
|
|
4903
|
-
self.
|
|
4904
|
-
self.
|
|
4905
|
-
self.
|
|
4906
|
-
self.
|
|
4907
|
-
self.
|
|
4908
|
-
self.
|
|
4909
|
-
self.unused1 = d[10]
|
|
4910
|
-
self.is_scrambled = d[11]
|
|
4911
|
-
self.is_sensor_embedded = d[12]
|
|
4912
|
-
self.is_sensor = d[13]
|
|
4913
|
-
self.pkt_id = d[14]
|
|
5560
|
+
d = bitstruct.unpack("u8u8u8u48u24u24u24u16u16u16", binascii.unhexlify(string))
|
|
5561
|
+
self.msg_type = d[0]
|
|
5562
|
+
self.api_version = d[1]
|
|
5563
|
+
self.seq_id = d[2]
|
|
5564
|
+
self.brg_mac = d[3]
|
|
5565
|
+
self.non_wlt_rx_pkts_ctr = d[4]
|
|
5566
|
+
self.bad_crc_pkts_ctr = d[5]
|
|
5567
|
+
self.wlt_rx_pkts_ctr = d[6]
|
|
5568
|
+
self.wlt_tx_pkts_ctr = d[7]
|
|
5569
|
+
self.tags_ctr = d[8]
|
|
5570
|
+
self.unused = d[9]
|
|
4914
5571
|
|
|
4915
|
-
class
|
|
4916
|
-
def __init__(self, raw='',
|
|
4917
|
-
self.
|
|
4918
|
-
self.
|
|
4919
|
-
self.
|
|
4920
|
-
self.
|
|
4921
|
-
self.
|
|
4922
|
-
self.
|
|
5572
|
+
class Brg2GwHbV1():
|
|
5573
|
+
def __init__(self, raw='', msg_type=BRG_MGMT_MSG_TYPE_HB, api_version=API_VERSION_V1, seq_id=0, gw_mac=0, brg_mac=0, sent_pkts_ctr=0, non_wlt_pkts_ctr=0, tags_ctr=0, unused1=0):
|
|
5574
|
+
self.msg_type = msg_type
|
|
5575
|
+
self.api_version = api_version
|
|
5576
|
+
self.seq_id = seq_id
|
|
5577
|
+
self.gw_mac = gw_mac
|
|
5578
|
+
self.brg_mac = brg_mac
|
|
5579
|
+
self.sent_pkts_ctr = sent_pkts_ctr
|
|
5580
|
+
self.non_wlt_pkts_ctr = non_wlt_pkts_ctr
|
|
5581
|
+
self.tags_ctr = tags_ctr
|
|
5582
|
+
self.unused1 = unused1
|
|
4923
5583
|
if raw:
|
|
4924
5584
|
self.set(raw)
|
|
4925
5585
|
|
|
4926
5586
|
def __repr__(self) -> str:
|
|
4927
|
-
return "\n==> Packet
|
|
5587
|
+
return "\n==> Packet brg2gw_hb_v1 <==\n" + tabulate.tabulate([['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],['gw_mac', f"0x{self.gw_mac:X}", self.gw_mac],['brg_mac', f"0x{self.brg_mac:X}", self.brg_mac],['sent_pkts_ctr', f"0x{self.sent_pkts_ctr:X}", self.sent_pkts_ctr],['non_wlt_pkts_ctr', f"0x{self.non_wlt_pkts_ctr:X}", self.non_wlt_pkts_ctr],['tags_ctr', f"0x{self.tags_ctr:X}", self.tags_ctr]], tablefmt="texttable")
|
|
4928
5588
|
|
|
4929
5589
|
def __eq__(self, other):
|
|
4930
5590
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
4931
5591
|
return (
|
|
4932
|
-
self.
|
|
4933
|
-
self.
|
|
4934
|
-
self.
|
|
4935
|
-
self.
|
|
4936
|
-
self.
|
|
5592
|
+
self.msg_type == other.msg_type and
|
|
5593
|
+
self.api_version == other.api_version and
|
|
5594
|
+
self.gw_mac == other.gw_mac and
|
|
5595
|
+
self.brg_mac == other.brg_mac and
|
|
5596
|
+
self.sent_pkts_ctr == other.sent_pkts_ctr and
|
|
5597
|
+
self.non_wlt_pkts_ctr == other.non_wlt_pkts_ctr and
|
|
5598
|
+
self.tags_ctr == other.tags_ctr
|
|
4937
5599
|
)
|
|
4938
5600
|
return False
|
|
4939
5601
|
|
|
4940
5602
|
def dump(self):
|
|
4941
|
-
string = bitstruct.pack("
|
|
5603
|
+
string = bitstruct.pack("u8u8u8u48u48u16u16u16u24", self.msg_type, self.api_version, self.seq_id, self.gw_mac, self.brg_mac, self.sent_pkts_ctr, self.non_wlt_pkts_ctr, self.tags_ctr, self.unused1)
|
|
4942
5604
|
return string.hex().upper()
|
|
4943
5605
|
|
|
4944
5606
|
def set(self, string):
|
|
4945
|
-
d = bitstruct.unpack("
|
|
4946
|
-
self.
|
|
4947
|
-
self.
|
|
4948
|
-
self.
|
|
4949
|
-
self.
|
|
4950
|
-
self.
|
|
4951
|
-
self.
|
|
5607
|
+
d = bitstruct.unpack("u8u8u8u48u48u16u16u16u24", binascii.unhexlify(string))
|
|
5608
|
+
self.msg_type = d[0]
|
|
5609
|
+
self.api_version = d[1]
|
|
5610
|
+
self.seq_id = d[2]
|
|
5611
|
+
self.gw_mac = d[3]
|
|
5612
|
+
self.brg_mac = d[4]
|
|
5613
|
+
self.sent_pkts_ctr = d[5]
|
|
5614
|
+
self.non_wlt_pkts_ctr = d[6]
|
|
5615
|
+
self.tags_ctr = d[7]
|
|
5616
|
+
self.unused1 = d[8]
|
|
4952
5617
|
|
|
4953
|
-
class
|
|
4954
|
-
def __init__(self, raw='',
|
|
4955
|
-
self.
|
|
4956
|
-
self.
|
|
4957
|
-
self.
|
|
4958
|
-
self.
|
|
4959
|
-
self.
|
|
4960
|
-
self.
|
|
5618
|
+
class ModuleIfV13():
|
|
5619
|
+
def __init__(self, raw='', module_type=MODULE_IF, msg_type=BRG_MGMT_MSG_TYPE_CFG_INFO, api_version=API_VERSION_V13, 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):
|
|
5620
|
+
self.module_type = module_type
|
|
5621
|
+
self.msg_type = msg_type
|
|
5622
|
+
self.api_version = api_version
|
|
5623
|
+
self.seq_id = seq_id
|
|
5624
|
+
self.brg_mac = brg_mac
|
|
5625
|
+
self.board_type = board_type
|
|
5626
|
+
self.bl_version = bl_version
|
|
5627
|
+
self.major_ver = major_ver
|
|
5628
|
+
self.minor_ver = minor_ver
|
|
5629
|
+
self.patch_ver = patch_ver
|
|
5630
|
+
self.sup_cap_glob = sup_cap_glob
|
|
5631
|
+
self.sup_cap_datapath = sup_cap_datapath
|
|
5632
|
+
self.sup_cap_energy2400 = sup_cap_energy2400
|
|
5633
|
+
self.sup_cap_energy_sub1g = sup_cap_energy_sub1g
|
|
5634
|
+
self.sup_cap_calibration = sup_cap_calibration
|
|
5635
|
+
self.sup_cap_pwr_mgmt = sup_cap_pwr_mgmt
|
|
5636
|
+
self.sup_cap_sensors = sup_cap_sensors
|
|
5637
|
+
self.sup_cap_custom = sup_cap_custom
|
|
5638
|
+
self.cfg_hash = cfg_hash
|
|
5639
|
+
self.unused0 = unused0
|
|
4961
5640
|
if raw:
|
|
4962
5641
|
self.set(raw)
|
|
4963
5642
|
|
|
4964
5643
|
def __repr__(self) -> str:
|
|
4965
|
-
return "\n==> Packet
|
|
5644
|
+
return "\n==> Packet module_if_v13 <==\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")
|
|
4966
5645
|
|
|
4967
5646
|
def __eq__(self, other):
|
|
4968
5647
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
4969
5648
|
return (
|
|
4970
|
-
self.
|
|
4971
|
-
self.
|
|
4972
|
-
self.
|
|
4973
|
-
self.
|
|
4974
|
-
self.
|
|
5649
|
+
self.module_type == other.module_type and
|
|
5650
|
+
self.msg_type == other.msg_type and
|
|
5651
|
+
self.api_version == other.api_version and
|
|
5652
|
+
self.brg_mac == other.brg_mac and
|
|
5653
|
+
self.board_type == other.board_type and
|
|
5654
|
+
self.bl_version == other.bl_version and
|
|
5655
|
+
self.major_ver == other.major_ver and
|
|
5656
|
+
self.minor_ver == other.minor_ver and
|
|
5657
|
+
self.patch_ver == other.patch_ver and
|
|
5658
|
+
self.sup_cap_glob == other.sup_cap_glob and
|
|
5659
|
+
self.sup_cap_datapath == other.sup_cap_datapath and
|
|
5660
|
+
self.sup_cap_energy2400 == other.sup_cap_energy2400 and
|
|
5661
|
+
self.sup_cap_energy_sub1g == other.sup_cap_energy_sub1g and
|
|
5662
|
+
self.sup_cap_calibration == other.sup_cap_calibration and
|
|
5663
|
+
self.sup_cap_pwr_mgmt == other.sup_cap_pwr_mgmt and
|
|
5664
|
+
self.sup_cap_sensors == other.sup_cap_sensors and
|
|
5665
|
+
self.sup_cap_custom == other.sup_cap_custom and
|
|
5666
|
+
self.cfg_hash == other.cfg_hash
|
|
4975
5667
|
)
|
|
4976
5668
|
return False
|
|
4977
5669
|
|
|
4978
5670
|
def dump(self):
|
|
4979
|
-
string = bitstruct.pack("
|
|
5671
|
+
string = bitstruct.pack("u4u4u8u8u48u8u8u8u8u8u1u1u1u1u1u1u1u1u32u40", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.board_type, self.bl_version, self.major_ver, self.minor_ver, self.patch_ver, self.sup_cap_glob, self.sup_cap_datapath, self.sup_cap_energy2400, self.sup_cap_energy_sub1g, self.sup_cap_calibration, self.sup_cap_pwr_mgmt, self.sup_cap_sensors, self.sup_cap_custom, self.cfg_hash, self.unused0)
|
|
4980
5672
|
return string.hex().upper()
|
|
4981
5673
|
|
|
4982
5674
|
def set(self, string):
|
|
4983
|
-
d = bitstruct.unpack("
|
|
4984
|
-
self.
|
|
4985
|
-
self.
|
|
4986
|
-
self.
|
|
4987
|
-
self.
|
|
4988
|
-
self.
|
|
4989
|
-
self.
|
|
5675
|
+
d = bitstruct.unpack("u4u4u8u8u48u8u8u8u8u8u1u1u1u1u1u1u1u1u32u40", binascii.unhexlify(string))
|
|
5676
|
+
self.module_type = d[0]
|
|
5677
|
+
self.msg_type = d[1]
|
|
5678
|
+
self.api_version = d[2]
|
|
5679
|
+
self.seq_id = d[3]
|
|
5680
|
+
self.brg_mac = d[4]
|
|
5681
|
+
self.board_type = d[5]
|
|
5682
|
+
self.bl_version = d[6]
|
|
5683
|
+
self.major_ver = d[7]
|
|
5684
|
+
self.minor_ver = d[8]
|
|
5685
|
+
self.patch_ver = d[9]
|
|
5686
|
+
self.sup_cap_glob = d[10]
|
|
5687
|
+
self.sup_cap_datapath = d[11]
|
|
5688
|
+
self.sup_cap_energy2400 = d[12]
|
|
5689
|
+
self.sup_cap_energy_sub1g = d[13]
|
|
5690
|
+
self.sup_cap_calibration = d[14]
|
|
5691
|
+
self.sup_cap_pwr_mgmt = d[15]
|
|
5692
|
+
self.sup_cap_sensors = d[16]
|
|
5693
|
+
self.sup_cap_custom = d[17]
|
|
5694
|
+
self.cfg_hash = d[18]
|
|
5695
|
+
self.unused0 = d[19]
|
|
4990
5696
|
|
|
4991
5697
|
class ModuleIfV12():
|
|
4992
5698
|
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):
|
|
@@ -5459,6 +6165,54 @@ class ModuleIfV7():
|
|
|
5459
6165
|
self.sup_cap_custom = d[17]
|
|
5460
6166
|
self.unused0 = d[18]
|
|
5461
6167
|
|
|
6168
|
+
class ModuleCalibrationV13():
|
|
6169
|
+
def __init__(self, raw='', module_type=MODULE_CALIBRATION, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V13, 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):
|
|
6170
|
+
self.module_type = module_type
|
|
6171
|
+
self.msg_type = msg_type
|
|
6172
|
+
self.api_version = api_version
|
|
6173
|
+
self.seq_id = seq_id
|
|
6174
|
+
self.brg_mac = brg_mac
|
|
6175
|
+
self.interval = interval
|
|
6176
|
+
self.output_power = output_power
|
|
6177
|
+
self.pattern = pattern
|
|
6178
|
+
self.unused0 = unused0
|
|
6179
|
+
self.unused1 = unused1
|
|
6180
|
+
if raw:
|
|
6181
|
+
self.set(raw)
|
|
6182
|
+
|
|
6183
|
+
def __repr__(self) -> str:
|
|
6184
|
+
return "\n==> Packet module_calibration_v13 <==\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")
|
|
6185
|
+
|
|
6186
|
+
def __eq__(self, other):
|
|
6187
|
+
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
6188
|
+
return (
|
|
6189
|
+
self.module_type == other.module_type and
|
|
6190
|
+
self.msg_type == other.msg_type and
|
|
6191
|
+
self.api_version == other.api_version and
|
|
6192
|
+
self.brg_mac == other.brg_mac and
|
|
6193
|
+
self.interval == other.interval and
|
|
6194
|
+
self.output_power == other.output_power and
|
|
6195
|
+
self.pattern == other.pattern
|
|
6196
|
+
)
|
|
6197
|
+
return False
|
|
6198
|
+
|
|
6199
|
+
def dump(self):
|
|
6200
|
+
string = bitstruct.pack("u4u4u8u8u48u8s8u4u4u96", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.interval, self.output_power, self.pattern, self.unused0, self.unused1)
|
|
6201
|
+
return string.hex().upper()
|
|
6202
|
+
|
|
6203
|
+
def set(self, string):
|
|
6204
|
+
d = bitstruct.unpack("u4u4u8u8u48u8s8u4u4u96", binascii.unhexlify(string))
|
|
6205
|
+
self.module_type = d[0]
|
|
6206
|
+
self.msg_type = d[1]
|
|
6207
|
+
self.api_version = d[2]
|
|
6208
|
+
self.seq_id = d[3]
|
|
6209
|
+
self.brg_mac = d[4]
|
|
6210
|
+
self.interval = d[5]
|
|
6211
|
+
self.output_power = d[6]
|
|
6212
|
+
self.pattern = d[7]
|
|
6213
|
+
self.unused0 = d[8]
|
|
6214
|
+
self.unused1 = d[9]
|
|
6215
|
+
|
|
5462
6216
|
class ModuleCalibrationV12():
|
|
5463
6217
|
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):
|
|
5464
6218
|
self.module_type = module_type
|
|
@@ -5717,13 +6471,71 @@ class ModuleCalibrationV7():
|
|
|
5717
6471
|
return string.hex().upper()
|
|
5718
6472
|
|
|
5719
6473
|
def set(self, string):
|
|
5720
|
-
d = bitstruct.unpack("u4u4u8u8u48u120", binascii.unhexlify(string))
|
|
6474
|
+
d = bitstruct.unpack("u4u4u8u8u48u120", binascii.unhexlify(string))
|
|
6475
|
+
self.module_type = d[0]
|
|
6476
|
+
self.msg_type = d[1]
|
|
6477
|
+
self.api_version = d[2]
|
|
6478
|
+
self.seq_id = d[3]
|
|
6479
|
+
self.brg_mac = d[4]
|
|
6480
|
+
self.unused0 = d[5]
|
|
6481
|
+
|
|
6482
|
+
class ModuleDatapathV13():
|
|
6483
|
+
def __init__(self, raw='', module_type=MODULE_DATAPATH, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V13, 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):
|
|
6484
|
+
self.module_type = module_type
|
|
6485
|
+
self.msg_type = msg_type
|
|
6486
|
+
self.api_version = api_version
|
|
6487
|
+
self.seq_id = seq_id
|
|
6488
|
+
self.brg_mac = brg_mac
|
|
6489
|
+
self.rssi_threshold = rssi_threshold
|
|
6490
|
+
self.pacer_interval = pacer_interval
|
|
6491
|
+
self.pkt_filter = pkt_filter
|
|
6492
|
+
self.tx_repetition = tx_repetition
|
|
6493
|
+
self.output_power = output_power
|
|
6494
|
+
self.pattern = pattern
|
|
6495
|
+
self.rx_channel = rx_channel
|
|
6496
|
+
self.unused0 = unused0
|
|
6497
|
+
if raw:
|
|
6498
|
+
self.set(raw)
|
|
6499
|
+
|
|
6500
|
+
def __repr__(self) -> str:
|
|
6501
|
+
return "\n==> Packet module_datapath_v13 <==\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")
|
|
6502
|
+
|
|
6503
|
+
def __eq__(self, other):
|
|
6504
|
+
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
6505
|
+
return (
|
|
6506
|
+
self.module_type == other.module_type and
|
|
6507
|
+
self.msg_type == other.msg_type and
|
|
6508
|
+
self.api_version == other.api_version and
|
|
6509
|
+
self.brg_mac == other.brg_mac and
|
|
6510
|
+
self.rssi_threshold == other.rssi_threshold and
|
|
6511
|
+
self.pacer_interval == other.pacer_interval and
|
|
6512
|
+
self.pkt_filter == other.pkt_filter and
|
|
6513
|
+
self.tx_repetition == other.tx_repetition and
|
|
6514
|
+
self.output_power == other.output_power and
|
|
6515
|
+
self.pattern == other.pattern and
|
|
6516
|
+
self.rx_channel == other.rx_channel
|
|
6517
|
+
)
|
|
6518
|
+
return False
|
|
6519
|
+
|
|
6520
|
+
def dump(self):
|
|
6521
|
+
string = bitstruct.pack("u4u4u8u8u48s8u16u5u3s8u4u4u72", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, ((self.rssi_threshold-0)//-1), self.pacer_interval, self.pkt_filter, self.tx_repetition, self.output_power, self.pattern, self.rx_channel, self.unused0)
|
|
6522
|
+
return string.hex().upper()
|
|
6523
|
+
|
|
6524
|
+
def set(self, string):
|
|
6525
|
+
d = bitstruct.unpack("u4u4u8u8u48s8u16u5u3s8u4u4u72", binascii.unhexlify(string))
|
|
5721
6526
|
self.module_type = d[0]
|
|
5722
6527
|
self.msg_type = d[1]
|
|
5723
6528
|
self.api_version = d[2]
|
|
5724
6529
|
self.seq_id = d[3]
|
|
5725
6530
|
self.brg_mac = d[4]
|
|
5726
|
-
self.
|
|
6531
|
+
self.rssi_threshold = ((d[5]*-1)+0)
|
|
6532
|
+
self.pacer_interval = d[6]
|
|
6533
|
+
self.pkt_filter = d[7]
|
|
6534
|
+
self.tx_repetition = d[8]
|
|
6535
|
+
self.output_power = d[9]
|
|
6536
|
+
self.pattern = d[10]
|
|
6537
|
+
self.rx_channel = d[11]
|
|
6538
|
+
self.unused0 = d[12]
|
|
5727
6539
|
|
|
5728
6540
|
class ModuleDatapathV12():
|
|
5729
6541
|
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):
|
|
@@ -6030,7 +6842,7 @@ class ModuleDatapathV8():
|
|
|
6030
6842
|
self.unused1 = d[10]
|
|
6031
6843
|
|
|
6032
6844
|
class ModuleDatapathV7():
|
|
6033
|
-
def __init__(self, raw='', module_type=MODULE_DATAPATH, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V7, seq_id=0, brg_mac=0, global_pacing_group=0, unused0=0, pacer_interval=BRG_DEFAULT_PACER_INTERVAL,
|
|
6845
|
+
def __init__(self, raw='', module_type=MODULE_DATAPATH, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V7, seq_id=0, brg_mac=0, global_pacing_group=0, unused0=0, pacer_interval=BRG_DEFAULT_PACER_INTERVAL, unused2=0, tx_repetition=BRG_DEFAULT_TX_REPETITION, unused1=0):
|
|
6034
6846
|
self.module_type = module_type
|
|
6035
6847
|
self.msg_type = msg_type
|
|
6036
6848
|
self.api_version = api_version
|
|
@@ -6039,14 +6851,14 @@ class ModuleDatapathV7():
|
|
|
6039
6851
|
self.global_pacing_group = global_pacing_group
|
|
6040
6852
|
self.unused0 = unused0
|
|
6041
6853
|
self.pacer_interval = pacer_interval
|
|
6042
|
-
self.
|
|
6854
|
+
self.unused2 = unused2
|
|
6043
6855
|
self.tx_repetition = tx_repetition
|
|
6044
6856
|
self.unused1 = unused1
|
|
6045
6857
|
if raw:
|
|
6046
6858
|
self.set(raw)
|
|
6047
6859
|
|
|
6048
6860
|
def __repr__(self) -> str:
|
|
6049
|
-
return "\n==> Packet module_datapath_v7 <==\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],['global_pacing_group', f"0x{self.global_pacing_group:X}", self.global_pacing_group],['pacer_interval', f"0x{self.pacer_interval:X}", self.pacer_interval],['
|
|
6861
|
+
return "\n==> Packet module_datapath_v7 <==\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],['global_pacing_group', f"0x{self.global_pacing_group:X}", self.global_pacing_group],['pacer_interval', f"0x{self.pacer_interval:X}", self.pacer_interval],['tx_repetition', f"0x{self.tx_repetition:X}", self.tx_repetition]], tablefmt="texttable")
|
|
6050
6862
|
|
|
6051
6863
|
def __eq__(self, other):
|
|
6052
6864
|
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
@@ -6057,13 +6869,12 @@ class ModuleDatapathV7():
|
|
|
6057
6869
|
self.brg_mac == other.brg_mac and
|
|
6058
6870
|
self.global_pacing_group == other.global_pacing_group and
|
|
6059
6871
|
self.pacer_interval == other.pacer_interval and
|
|
6060
|
-
self.unsued2 == other.unsued2 and
|
|
6061
6872
|
self.tx_repetition == other.tx_repetition
|
|
6062
6873
|
)
|
|
6063
6874
|
return False
|
|
6064
6875
|
|
|
6065
6876
|
def dump(self):
|
|
6066
|
-
string = bitstruct.pack("u4u4u8u8u48u4u4u16u5u3u88", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.global_pacing_group, self.unused0, self.pacer_interval, self.
|
|
6877
|
+
string = bitstruct.pack("u4u4u8u8u48u4u4u16u5u3u88", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.global_pacing_group, self.unused0, self.pacer_interval, self.unused2, self.tx_repetition, self.unused1)
|
|
6067
6878
|
return string.hex().upper()
|
|
6068
6879
|
|
|
6069
6880
|
def set(self, string):
|
|
@@ -6076,10 +6887,64 @@ class ModuleDatapathV7():
|
|
|
6076
6887
|
self.global_pacing_group = d[5]
|
|
6077
6888
|
self.unused0 = d[6]
|
|
6078
6889
|
self.pacer_interval = d[7]
|
|
6079
|
-
self.
|
|
6890
|
+
self.unused2 = d[8]
|
|
6080
6891
|
self.tx_repetition = d[9]
|
|
6081
6892
|
self.unused1 = d[10]
|
|
6082
6893
|
|
|
6894
|
+
MODULE_ENERGY_2400_V13_SIGNAL_INDICATOR_REP_ENC = {SIGNAL_INDICATOR_REP_1:0, SIGNAL_INDICATOR_REP_2:1, SIGNAL_INDICATOR_REP_3:2, SIGNAL_INDICATOR_REP_4:3}
|
|
6895
|
+
MODULE_ENERGY_2400_V13_SIGNAL_INDICATOR_REP_DEC = {0:SIGNAL_INDICATOR_REP_1, 1:SIGNAL_INDICATOR_REP_2, 2:SIGNAL_INDICATOR_REP_3, 3:SIGNAL_INDICATOR_REP_4}
|
|
6896
|
+
class ModuleEnergy2400V13():
|
|
6897
|
+
def __init__(self, raw='', module_type=MODULE_ENERGY_2400, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V13, 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):
|
|
6898
|
+
self.module_type = module_type
|
|
6899
|
+
self.msg_type = msg_type
|
|
6900
|
+
self.api_version = api_version
|
|
6901
|
+
self.seq_id = seq_id
|
|
6902
|
+
self.brg_mac = brg_mac
|
|
6903
|
+
self.duty_cycle = duty_cycle
|
|
6904
|
+
self.pattern = pattern
|
|
6905
|
+
self.output_power = output_power
|
|
6906
|
+
self.signal_indicator_cycle = signal_indicator_cycle
|
|
6907
|
+
self.signal_indicator_rep = signal_indicator_rep
|
|
6908
|
+
self.unused0 = unused0
|
|
6909
|
+
if raw:
|
|
6910
|
+
self.set(raw)
|
|
6911
|
+
|
|
6912
|
+
def __repr__(self) -> str:
|
|
6913
|
+
return "\n==> Packet module_energy_2400_v13 <==\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")
|
|
6914
|
+
|
|
6915
|
+
def __eq__(self, other):
|
|
6916
|
+
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
6917
|
+
return (
|
|
6918
|
+
self.module_type == other.module_type and
|
|
6919
|
+
self.msg_type == other.msg_type and
|
|
6920
|
+
self.api_version == other.api_version and
|
|
6921
|
+
self.brg_mac == other.brg_mac and
|
|
6922
|
+
self.duty_cycle == other.duty_cycle and
|
|
6923
|
+
self.pattern == other.pattern and
|
|
6924
|
+
self.output_power == other.output_power and
|
|
6925
|
+
self.signal_indicator_cycle == other.signal_indicator_cycle and
|
|
6926
|
+
self.signal_indicator_rep == other.signal_indicator_rep
|
|
6927
|
+
)
|
|
6928
|
+
return False
|
|
6929
|
+
|
|
6930
|
+
def dump(self):
|
|
6931
|
+
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_V13_SIGNAL_INDICATOR_REP_ENC[self.signal_indicator_rep], self.unused0)
|
|
6932
|
+
return string.hex().upper()
|
|
6933
|
+
|
|
6934
|
+
def set(self, string):
|
|
6935
|
+
d = bitstruct.unpack("u4u4u8u8u48u8u8s8u14u2u80", binascii.unhexlify(string))
|
|
6936
|
+
self.module_type = d[0]
|
|
6937
|
+
self.msg_type = d[1]
|
|
6938
|
+
self.api_version = d[2]
|
|
6939
|
+
self.seq_id = d[3]
|
|
6940
|
+
self.brg_mac = d[4]
|
|
6941
|
+
self.duty_cycle = d[5]
|
|
6942
|
+
self.pattern = d[6]
|
|
6943
|
+
self.output_power = d[7]
|
|
6944
|
+
self.signal_indicator_cycle = d[8]
|
|
6945
|
+
self.signal_indicator_rep = MODULE_ENERGY_2400_V13_SIGNAL_INDICATOR_REP_DEC[d[9]]
|
|
6946
|
+
self.unused0 = d[10]
|
|
6947
|
+
|
|
6083
6948
|
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}
|
|
6084
6949
|
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}
|
|
6085
6950
|
class ModuleEnergy2400V12():
|
|
@@ -6391,6 +7256,57 @@ class ModuleEnergy2400V7():
|
|
|
6391
7256
|
self.unused0 = d[10]
|
|
6392
7257
|
self.unused1 = d[11]
|
|
6393
7258
|
|
|
7259
|
+
MODULE_ENERGY_SUB1G_V13_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}
|
|
7260
|
+
MODULE_ENERGY_SUB1G_V13_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}
|
|
7261
|
+
class ModuleEnergySub1GV13():
|
|
7262
|
+
def __init__(self, raw='', module_type=MODULE_ENERGY_SUB1G, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V13, 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):
|
|
7263
|
+
self.module_type = module_type
|
|
7264
|
+
self.msg_type = msg_type
|
|
7265
|
+
self.api_version = api_version
|
|
7266
|
+
self.seq_id = seq_id
|
|
7267
|
+
self.brg_mac = brg_mac
|
|
7268
|
+
self.pattern = pattern
|
|
7269
|
+
self.duty_cycle = duty_cycle
|
|
7270
|
+
self.signal_indicator_cycle = signal_indicator_cycle
|
|
7271
|
+
self.signal_indicator_rep = signal_indicator_rep
|
|
7272
|
+
self.unused0 = unused0
|
|
7273
|
+
if raw:
|
|
7274
|
+
self.set(raw)
|
|
7275
|
+
|
|
7276
|
+
def __repr__(self) -> str:
|
|
7277
|
+
return "\n==> Packet module_energy_sub1g_v13 <==\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")
|
|
7278
|
+
|
|
7279
|
+
def __eq__(self, other):
|
|
7280
|
+
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
7281
|
+
return (
|
|
7282
|
+
self.module_type == other.module_type and
|
|
7283
|
+
self.msg_type == other.msg_type and
|
|
7284
|
+
self.api_version == other.api_version and
|
|
7285
|
+
self.brg_mac == other.brg_mac and
|
|
7286
|
+
self.pattern == other.pattern and
|
|
7287
|
+
self.duty_cycle == other.duty_cycle and
|
|
7288
|
+
self.signal_indicator_cycle == other.signal_indicator_cycle and
|
|
7289
|
+
self.signal_indicator_rep == other.signal_indicator_rep
|
|
7290
|
+
)
|
|
7291
|
+
return False
|
|
7292
|
+
|
|
7293
|
+
def dump(self):
|
|
7294
|
+
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_V13_SIGNAL_INDICATOR_REP_ENC[self.signal_indicator_rep], self.unused0)
|
|
7295
|
+
return string.hex().upper()
|
|
7296
|
+
|
|
7297
|
+
def set(self, string):
|
|
7298
|
+
d = bitstruct.unpack("u4u4u8u8u48u8u8u14u2u88", binascii.unhexlify(string))
|
|
7299
|
+
self.module_type = d[0]
|
|
7300
|
+
self.msg_type = d[1]
|
|
7301
|
+
self.api_version = d[2]
|
|
7302
|
+
self.seq_id = d[3]
|
|
7303
|
+
self.brg_mac = d[4]
|
|
7304
|
+
self.pattern = d[5]
|
|
7305
|
+
self.duty_cycle = d[6]
|
|
7306
|
+
self.signal_indicator_cycle = d[7]
|
|
7307
|
+
self.signal_indicator_rep = MODULE_ENERGY_SUB1G_V13_SIGNAL_INDICATOR_REP_DEC[d[8]]
|
|
7308
|
+
self.unused0 = d[9]
|
|
7309
|
+
|
|
6394
7310
|
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}
|
|
6395
7311
|
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}
|
|
6396
7312
|
class ModuleEnergySub1GV12():
|
|
@@ -6705,6 +7621,73 @@ class ModuleEnergySub1GV7():
|
|
|
6705
7621
|
self.frequency = MODULE_ENERGY_SUB1G_V7_FREQUENCY_DEC[d[6]]
|
|
6706
7622
|
self.unused0 = d[7]
|
|
6707
7623
|
|
|
7624
|
+
class ModulePwrMgmtV13():
|
|
7625
|
+
def __init__(self, raw='', module_type=MODULE_PWR_MGMT, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V13, 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):
|
|
7626
|
+
self.module_type = module_type
|
|
7627
|
+
self.msg_type = msg_type
|
|
7628
|
+
self.api_version = api_version
|
|
7629
|
+
self.seq_id = seq_id
|
|
7630
|
+
self.brg_mac = brg_mac
|
|
7631
|
+
self.static_leds_on = static_leds_on
|
|
7632
|
+
self.static_keep_alive_period = static_keep_alive_period # 5sec resolution
|
|
7633
|
+
self.static_keep_alive_scan = static_keep_alive_scan # 10msec resolution
|
|
7634
|
+
self.static_on_duration = static_on_duration # 30sec resolution
|
|
7635
|
+
self.static_sleep_duration = static_sleep_duration # 60sec resolution
|
|
7636
|
+
self.dynamic_leds_on = dynamic_leds_on
|
|
7637
|
+
self.dynamic_keep_alive_period = dynamic_keep_alive_period # 5sec resolution
|
|
7638
|
+
self.dynamic_keep_alive_scan = dynamic_keep_alive_scan # 10msec resolution
|
|
7639
|
+
self.dynamic_on_duration = dynamic_on_duration # 30sec resolution
|
|
7640
|
+
self.dynamic_sleep_duration = dynamic_sleep_duration # 60sec resolution
|
|
7641
|
+
self.unused0 = unused0
|
|
7642
|
+
if raw:
|
|
7643
|
+
self.set(raw)
|
|
7644
|
+
|
|
7645
|
+
def __repr__(self) -> str:
|
|
7646
|
+
return "\n==> Packet module_pwr_mgmt_v13 <==\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")
|
|
7647
|
+
|
|
7648
|
+
def __eq__(self, other):
|
|
7649
|
+
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
7650
|
+
return (
|
|
7651
|
+
self.module_type == other.module_type and
|
|
7652
|
+
self.msg_type == other.msg_type and
|
|
7653
|
+
self.api_version == other.api_version and
|
|
7654
|
+
self.brg_mac == other.brg_mac and
|
|
7655
|
+
self.static_leds_on == other.static_leds_on and
|
|
7656
|
+
self.static_keep_alive_period == other.static_keep_alive_period and
|
|
7657
|
+
self.static_keep_alive_scan == other.static_keep_alive_scan and
|
|
7658
|
+
self.static_on_duration == other.static_on_duration and
|
|
7659
|
+
self.static_sleep_duration == other.static_sleep_duration and
|
|
7660
|
+
self.dynamic_leds_on == other.dynamic_leds_on and
|
|
7661
|
+
self.dynamic_keep_alive_period == other.dynamic_keep_alive_period and
|
|
7662
|
+
self.dynamic_keep_alive_scan == other.dynamic_keep_alive_scan and
|
|
7663
|
+
self.dynamic_on_duration == other.dynamic_on_duration and
|
|
7664
|
+
self.dynamic_sleep_duration == other.dynamic_sleep_duration
|
|
7665
|
+
)
|
|
7666
|
+
return False
|
|
7667
|
+
|
|
7668
|
+
def dump(self):
|
|
7669
|
+
string = bitstruct.pack("u4u4u8u8u48u8u8u8u8u16u8u8u8u8u16u24", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.static_leds_on, ((self.static_keep_alive_period-0)//5), ((self.static_keep_alive_scan-0)//10), ((self.static_on_duration-0)//30), ((self.static_sleep_duration-0)//60), self.dynamic_leds_on, ((self.dynamic_keep_alive_period-0)//5), ((self.dynamic_keep_alive_scan-0)//10), ((self.dynamic_on_duration-0)//30), ((self.dynamic_sleep_duration-0)//60), self.unused0)
|
|
7670
|
+
return string.hex().upper()
|
|
7671
|
+
|
|
7672
|
+
def set(self, string):
|
|
7673
|
+
d = bitstruct.unpack("u4u4u8u8u48u8u8u8u8u16u8u8u8u8u16u24", binascii.unhexlify(string))
|
|
7674
|
+
self.module_type = d[0]
|
|
7675
|
+
self.msg_type = d[1]
|
|
7676
|
+
self.api_version = d[2]
|
|
7677
|
+
self.seq_id = d[3]
|
|
7678
|
+
self.brg_mac = d[4]
|
|
7679
|
+
self.static_leds_on = d[5]
|
|
7680
|
+
self.static_keep_alive_period = ((d[6]*5)+0)
|
|
7681
|
+
self.static_keep_alive_scan = ((d[7]*10)+0)
|
|
7682
|
+
self.static_on_duration = ((d[8]*30)+0)
|
|
7683
|
+
self.static_sleep_duration = ((d[9]*60)+0)
|
|
7684
|
+
self.dynamic_leds_on = d[10]
|
|
7685
|
+
self.dynamic_keep_alive_period = ((d[11]*5)+0)
|
|
7686
|
+
self.dynamic_keep_alive_scan = ((d[12]*10)+0)
|
|
7687
|
+
self.dynamic_on_duration = ((d[13]*30)+0)
|
|
7688
|
+
self.dynamic_sleep_duration = ((d[14]*60)+0)
|
|
7689
|
+
self.unused0 = d[15]
|
|
7690
|
+
|
|
6708
7691
|
class ModulePwrMgmtV12():
|
|
6709
7692
|
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):
|
|
6710
7693
|
self.module_type = module_type
|
|
@@ -7107,6 +8090,55 @@ class ModulePwrMgmtV7():
|
|
|
7107
8090
|
self.dynamic_sleep_duration = ((d[14]*60)+0)
|
|
7108
8091
|
self.unused0 = d[15]
|
|
7109
8092
|
|
|
8093
|
+
class ModuleExtSensorsV13():
|
|
8094
|
+
def __init__(self, raw='', module_type=MODULE_EXT_SENSORS, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V13, 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):
|
|
8095
|
+
self.module_type = module_type
|
|
8096
|
+
self.msg_type = msg_type
|
|
8097
|
+
self.api_version = api_version
|
|
8098
|
+
self.seq_id = seq_id
|
|
8099
|
+
self.brg_mac = brg_mac
|
|
8100
|
+
self.sensor0 = sensor0
|
|
8101
|
+
self.sensor1 = sensor1
|
|
8102
|
+
self.rssi_threshold = rssi_threshold
|
|
8103
|
+
self.sub1g_rssi_threshold = sub1g_rssi_threshold
|
|
8104
|
+
self.unused = unused
|
|
8105
|
+
if raw:
|
|
8106
|
+
self.set(raw)
|
|
8107
|
+
|
|
8108
|
+
def __repr__(self) -> str:
|
|
8109
|
+
return "\n==> Packet module_ext_sensors_v13 <==\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")
|
|
8110
|
+
|
|
8111
|
+
def __eq__(self, other):
|
|
8112
|
+
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
8113
|
+
return (
|
|
8114
|
+
self.module_type == other.module_type and
|
|
8115
|
+
self.msg_type == other.msg_type and
|
|
8116
|
+
self.api_version == other.api_version and
|
|
8117
|
+
self.brg_mac == other.brg_mac and
|
|
8118
|
+
self.sensor0 == other.sensor0 and
|
|
8119
|
+
self.sensor1 == other.sensor1 and
|
|
8120
|
+
self.rssi_threshold == other.rssi_threshold and
|
|
8121
|
+
self.sub1g_rssi_threshold == other.sub1g_rssi_threshold
|
|
8122
|
+
)
|
|
8123
|
+
return False
|
|
8124
|
+
|
|
8125
|
+
def dump(self):
|
|
8126
|
+
string = bitstruct.pack("u4u4u8u8u48u32u32s8s8u40", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, self.sensor0, self.sensor1, ((self.rssi_threshold-0)//-1), ((self.sub1g_rssi_threshold-0)//-1), self.unused)
|
|
8127
|
+
return string.hex().upper()
|
|
8128
|
+
|
|
8129
|
+
def set(self, string):
|
|
8130
|
+
d = bitstruct.unpack("u4u4u8u8u48u32u32s8s8u40", binascii.unhexlify(string))
|
|
8131
|
+
self.module_type = d[0]
|
|
8132
|
+
self.msg_type = d[1]
|
|
8133
|
+
self.api_version = d[2]
|
|
8134
|
+
self.seq_id = d[3]
|
|
8135
|
+
self.brg_mac = d[4]
|
|
8136
|
+
self.sensor0 = d[5]
|
|
8137
|
+
self.sensor1 = d[6]
|
|
8138
|
+
self.rssi_threshold = ((d[7]*-1)+0)
|
|
8139
|
+
self.sub1g_rssi_threshold = ((d[8]*-1)+0)
|
|
8140
|
+
self.unused = d[9]
|
|
8141
|
+
|
|
7110
8142
|
class ModuleExtSensorsV12():
|
|
7111
8143
|
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):
|
|
7112
8144
|
self.module_type = module_type
|
|
@@ -7431,6 +8463,52 @@ class ModuleExtSensorsV7():
|
|
|
7431
8463
|
self.unused1 = d[13]
|
|
7432
8464
|
self.unused2 = d[14]
|
|
7433
8465
|
|
|
8466
|
+
class ModuleCustomV13():
|
|
8467
|
+
def __init__(self, raw='', module_type=MODULE_CUSTOM, msg_type=BRG_MGMT_MSG_TYPE_CFG_SET, api_version=API_VERSION_V13, 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):
|
|
8468
|
+
self.module_type = module_type
|
|
8469
|
+
self.msg_type = msg_type
|
|
8470
|
+
self.api_version = api_version
|
|
8471
|
+
self.seq_id = seq_id
|
|
8472
|
+
self.brg_mac = brg_mac
|
|
8473
|
+
self.motion_sensitivity_threshold = motion_sensitivity_threshold # 31 [mg] resolution
|
|
8474
|
+
self.s2d_transition_time = s2d_transition_time # 3 [sec] resolution
|
|
8475
|
+
self.d2s_transition_time = d2s_transition_time # 5 [sec] resolution
|
|
8476
|
+
self.unused1 = unused1
|
|
8477
|
+
if raw:
|
|
8478
|
+
self.set(raw)
|
|
8479
|
+
|
|
8480
|
+
def __repr__(self) -> str:
|
|
8481
|
+
return "\n==> Packet module_custom_v13 <==\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")
|
|
8482
|
+
|
|
8483
|
+
def __eq__(self, other):
|
|
8484
|
+
if other and set(other.__dict__.keys()) == set(self.__dict__.keys()):
|
|
8485
|
+
return (
|
|
8486
|
+
self.module_type == other.module_type and
|
|
8487
|
+
self.msg_type == other.msg_type and
|
|
8488
|
+
self.api_version == other.api_version and
|
|
8489
|
+
self.brg_mac == other.brg_mac and
|
|
8490
|
+
self.motion_sensitivity_threshold == other.motion_sensitivity_threshold and
|
|
8491
|
+
self.s2d_transition_time == other.s2d_transition_time and
|
|
8492
|
+
self.d2s_transition_time == other.d2s_transition_time
|
|
8493
|
+
)
|
|
8494
|
+
return False
|
|
8495
|
+
|
|
8496
|
+
def dump(self):
|
|
8497
|
+
string = bitstruct.pack("u4u4u8u8u48u8u8u8u96", self.module_type, self.msg_type, self.api_version, self.seq_id, self.brg_mac, ((self.motion_sensitivity_threshold-0)//31), ((self.s2d_transition_time-0)//3), ((self.d2s_transition_time-0)//5), self.unused1)
|
|
8498
|
+
return string.hex().upper()
|
|
8499
|
+
|
|
8500
|
+
def set(self, string):
|
|
8501
|
+
d = bitstruct.unpack("u4u4u8u8u48u8u8u8u96", binascii.unhexlify(string))
|
|
8502
|
+
self.module_type = d[0]
|
|
8503
|
+
self.msg_type = d[1]
|
|
8504
|
+
self.api_version = d[2]
|
|
8505
|
+
self.seq_id = d[3]
|
|
8506
|
+
self.brg_mac = d[4]
|
|
8507
|
+
self.motion_sensitivity_threshold = ((d[5]*31)+0)
|
|
8508
|
+
self.s2d_transition_time = ((d[6]*3)+0)
|
|
8509
|
+
self.d2s_transition_time = ((d[7]*5)+0)
|
|
8510
|
+
self.unused1 = d[8]
|
|
8511
|
+
|
|
7434
8512
|
class ModuleCustomV12():
|
|
7435
8513
|
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):
|
|
7436
8514
|
self.module_type = module_type
|
|
@@ -7833,7 +8911,7 @@ class SignalIndicatorDataV1():
|
|
|
7833
8911
|
self.unused0 = d[8]
|
|
7834
8912
|
self.pkt_id = d[9]
|
|
7835
8913
|
|
|
7836
|
-
MODULES_LIST = [ModuleIfV12, ModuleIfV11, ModuleIfV10, ModuleIfV9, ModuleIfV8, ModuleIfV7, ModuleCalibrationV12, ModuleCalibrationV11, ModuleCalibrationV10, ModuleCalibrationV9, ModuleCalibrationV8, ModuleCalibrationV7, ModuleDatapathV12, ModuleDatapathV11, ModuleDatapathV10, ModuleDatapathV9, ModuleDatapathV8, ModuleDatapathV7, ModuleEnergy2400V12, ModuleEnergy2400V11, ModuleEnergy2400V10, ModuleEnergy2400V9, ModuleEnergy2400V8, ModuleEnergy2400V7, ModuleEnergySub1GV12, ModuleEnergySub1GV11, ModuleEnergySub1GV10, ModuleEnergySub1GV9, ModuleEnergySub1GV8, ModuleEnergySub1GV7, ModulePwrMgmtV12, ModulePwrMgmtV11, ModulePwrMgmtV10, ModulePwrMgmtV9, ModulePwrMgmtV8, ModulePwrMgmtV7, ModuleExtSensorsV12, ModuleExtSensorsV11, ModuleExtSensorsV10, ModuleExtSensorsV9, ModuleExtSensorsV8, ModuleExtSensorsV7, ModuleCustomV12, ModuleCustomV11, ModuleCustomV10, ModuleCustomV9, ModuleCustomV8]
|
|
8914
|
+
MODULES_LIST = [ModuleIfV13, ModuleIfV12, ModuleIfV11, ModuleIfV10, ModuleIfV9, ModuleIfV8, ModuleIfV7, ModuleCalibrationV13, ModuleCalibrationV12, ModuleCalibrationV11, ModuleCalibrationV10, ModuleCalibrationV9, ModuleCalibrationV8, ModuleCalibrationV7, ModuleDatapathV13, ModuleDatapathV12, ModuleDatapathV11, ModuleDatapathV10, ModuleDatapathV9, ModuleDatapathV8, ModuleDatapathV7, ModuleEnergy2400V13, ModuleEnergy2400V12, ModuleEnergy2400V11, ModuleEnergy2400V10, ModuleEnergy2400V9, ModuleEnergy2400V8, ModuleEnergy2400V7, ModuleEnergySub1GV13, ModuleEnergySub1GV12, ModuleEnergySub1GV11, ModuleEnergySub1GV10, ModuleEnergySub1GV9, ModuleEnergySub1GV8, ModuleEnergySub1GV7, ModulePwrMgmtV13, ModulePwrMgmtV12, ModulePwrMgmtV11, ModulePwrMgmtV10, ModulePwrMgmtV9, ModulePwrMgmtV8, ModulePwrMgmtV7, ModuleExtSensorsV13, ModuleExtSensorsV12, ModuleExtSensorsV11, ModuleExtSensorsV10, ModuleExtSensorsV9, ModuleExtSensorsV8, ModuleExtSensorsV7, ModuleCustomV13, ModuleCustomV12, ModuleCustomV11, ModuleCustomV10, ModuleCustomV9, ModuleCustomV8]
|
|
7837
8915
|
MODULES_DICT = {MODULE_IF:'ModuleIfV', MODULE_CALIBRATION:'ModuleCalibrationV', MODULE_DATAPATH:'ModuleDatapathV', MODULE_ENERGY_2400:'ModuleEnergy2400V', MODULE_ENERGY_SUB1G:'ModuleEnergySub1GV', MODULE_PWR_MGMT:'ModulePwrMgmtV', MODULE_EXT_SENSORS:'ModuleExtSensorsV', MODULE_CUSTOM:'ModuleCustomV'}
|
|
7838
8916
|
ACTIONS_DICT = {ACTION_EMPTY:'ActionGenericV', ACTION_GW_HB:'ActionGwHbV', ACTION_REBOOT:'ActionRebootV', ACTION_BLINK:'ActionBlinkV', ACTION_GET_MODULE:'ActionGetModuleV', ACTION_RESTORE_DEFAULTS:'ActionRestoreDefaultsV', ACTION_SEND_HB:'ActionSendHbV', ACTION_GET_BATTERY_SENSOR:'ActionGetBatterySensorV', ACTION_GET_POF_DATA:'ActionGetPofDataV', ACTION_PL_STATUS:'ActionPlStatusV'}
|
|
7839
|
-
WLT_PKT_TYPES = [UnifiedEchoExtPkt, UnifiedEchoPktV1, UnifiedEchoPktV0, ActionGenericV12, ActionGenericV11, ActionGenericV10, ActionGenericV9, ActionGenericV8, ActionGenericV7, ActionGwHbV12, ActionGwHbV11, ActionGwHbV10, ActionGwHbV9, ActionGwHbV8, ActionRebootV12, ActionRebootV11, ActionRebootV10, ActionRebootV9, ActionRebootV8, ActionBlinkV12, ActionBlinkV11, ActionBlinkV10, ActionBlinkV9, ActionBlinkV8, ActionGetModuleV12, ActionGetModuleV11, ActionGetModuleV10, ActionGetModuleV9, ActionGetModuleV8, ActionRestoreDefaultsV12, ActionRestoreDefaultsV11, ActionRestoreDefaultsV10, ActionRestoreDefaultsV9, ActionRestoreDefaultsV8, ActionSendHbV12, ActionSendHbV11, ActionSendHbV10, ActionSendHbV9, ActionSendHbV8, ActionGetBatterySensorV12, ActionGetBatterySensorV11, ActionGetBatterySensorV10, ActionGetBatterySensorV9, ActionGetBatterySensorV8, ActionGetPofDataV12, ActionGetPofDataV11, ActionGetPofDataV10, ActionGetPofDataV9, ActionGetPofDataV8, ActionPlStatusV12, ActionPlStatusV11, ActionPlStatusV10, Brg2BrgOtaV12, Brg2BrgOtaV11, Brg2BrgOtaV10, Brg2BrgOtaV9, Brg2BrgCfgV12, Brg2BrgCfgV11, Brg2BrgCfgV10, Brg2BrgCfgV9, Gw2BrgCfgV8, Gw2BrgCfgV7, Brg2GwCfgV8, Brg2GwCfgV7, Brg2GwCfgV6, Brg2GwCfgV5, Brg2GwCfgV2, Brg2GwHbSleepV12, Brg2GwHbSleepV11, Brg2GwHbSleepV10, Brg2GwHbV12, Brg2GwHbV11, Brg2GwHbV10, Brg2GwHbV9, Brg2GwHbV8, Brg2GwHbV7, Brg2GwHbV6, Brg2GwHbV5, Brg2GwHbV1,
|
|
8917
|
+
WLT_PKT_TYPES = [UnifiedEchoExtPkt, UnifiedEchoPktV1, UnifiedEchoPktV0, SideInfo, SensorData, SideInfoSensor, ActionGenericV13, ActionGenericV12, ActionGenericV11, ActionGenericV10, ActionGenericV9, ActionGenericV8, ActionGenericV7, ActionGwHbV13, ActionGwHbV12, ActionGwHbV11, ActionGwHbV10, ActionGwHbV9, ActionGwHbV8, ActionRebootV13, ActionRebootV12, ActionRebootV11, ActionRebootV10, ActionRebootV9, ActionRebootV8, ActionBlinkV13, ActionBlinkV12, ActionBlinkV11, ActionBlinkV10, ActionBlinkV9, ActionBlinkV8, ActionGetModuleV13, ActionGetModuleV12, ActionGetModuleV11, ActionGetModuleV10, ActionGetModuleV9, ActionGetModuleV8, ActionRestoreDefaultsV13, ActionRestoreDefaultsV12, ActionRestoreDefaultsV11, ActionRestoreDefaultsV10, ActionRestoreDefaultsV9, ActionRestoreDefaultsV8, ActionSendHbV13, ActionSendHbV12, ActionSendHbV11, ActionSendHbV10, ActionSendHbV9, ActionSendHbV8, ActionGetBatterySensorV13, ActionGetBatterySensorV12, ActionGetBatterySensorV11, ActionGetBatterySensorV10, ActionGetBatterySensorV9, ActionGetBatterySensorV8, ActionGetPofDataV13, ActionGetPofDataV12, ActionGetPofDataV11, ActionGetPofDataV10, ActionGetPofDataV9, ActionGetPofDataV8, ActionPlStatusV13, ActionPlStatusV12, ActionPlStatusV11, ActionPlStatusV10, Brg2BrgOtaV13, Brg2BrgOtaV12, Brg2BrgOtaV11, Brg2BrgOtaV10, Brg2BrgOtaV9, Brg2BrgCfgV13, Brg2BrgCfgV12, Brg2BrgCfgV11, Brg2BrgCfgV10, Brg2BrgCfgV9, Gw2BrgCfgV8, Gw2BrgCfgV7, Brg2GwCfgV8, Brg2GwCfgV7, Brg2GwCfgV6, Brg2GwCfgV5, Brg2GwCfgV2, Brg2GwHbSleepV13, Brg2GwHbSleepV12, Brg2GwHbSleepV11, Brg2GwHbSleepV10, Brg2GwHbV13, Brg2GwHbV12, Brg2GwHbV11, Brg2GwHbV10, Brg2GwHbV9, Brg2GwHbV8, Brg2GwHbV7, Brg2GwHbV6, Brg2GwHbV5, Brg2GwHbV1, ModuleIfV13, ModuleIfV12, ModuleIfV11, ModuleIfV10, ModuleIfV9, ModuleIfV8, ModuleIfV7, ModuleCalibrationV13, ModuleCalibrationV12, ModuleCalibrationV11, ModuleCalibrationV10, ModuleCalibrationV9, ModuleCalibrationV8, ModuleCalibrationV7, ModuleDatapathV13, ModuleDatapathV12, ModuleDatapathV11, ModuleDatapathV10, ModuleDatapathV9, ModuleDatapathV8, ModuleDatapathV7, ModuleEnergy2400V13, ModuleEnergy2400V12, ModuleEnergy2400V11, ModuleEnergy2400V10, ModuleEnergy2400V9, ModuleEnergy2400V8, ModuleEnergy2400V7, ModuleEnergySub1GV13, ModuleEnergySub1GV12, ModuleEnergySub1GV11, ModuleEnergySub1GV10, ModuleEnergySub1GV9, ModuleEnergySub1GV8, ModuleEnergySub1GV7, ModulePwrMgmtV13, ModulePwrMgmtV12, ModulePwrMgmtV11, ModulePwrMgmtV10, ModulePwrMgmtV9, ModulePwrMgmtV8, ModulePwrMgmtV7, ModuleExtSensorsV13, ModuleExtSensorsV12, ModuleExtSensorsV11, ModuleExtSensorsV10, ModuleExtSensorsV9, ModuleExtSensorsV8, ModuleExtSensorsV7, ModuleCustomV13, ModuleCustomV12, ModuleCustomV11, ModuleCustomV10, ModuleCustomV9, ModuleCustomV8]
|