Skip to content

Commit 5c499e5

Browse files
committed
add new dev info and adjust time cmd
1 parent d51195b commit 5c499e5

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

src/explorepy/command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def __init__(self, time):
254254
3,
255255
]
256256
)
257-
self.param = date_time + bytes(30)
257+
self.param = date_time + bytes(41)
258258

259259
def __str__(self):
260260
return "set time cmd"

src/explorepy/explore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def connect(self, device_name=None, mac_address=None, file_path=None):
112112
raise ConnectionAbortedError(
113113
"Could not get info packet from the device")
114114
cnt += 1
115-
if self.stream_processor.device_info['firmware_version'] in FW_VERSIONS_SUPPORTING_BIN_TIME_COMMAND:
115+
if 'time_cmd' in self.stream_processor.device_info:
116116
self.set_binary_time()
117117
if self.stream_processor.device_info['is_imp_mode'] is True:
118118
self.stream_processor.disable_imp()

src/explorepy/packet.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class PACKET_ID(IntEnum):
2525
# Info packet from BLE devices, applies to Explore Pro
2626
INFO_BLE = 98
2727
INFO_HYP = 99
28+
INFO_TIME_CMD = 100
2829
# New info packet containing memory and board ID: this applies to all Explore+ systems
2930
INFO_V2 = 97
3031
INFO = 96
@@ -697,6 +698,17 @@ def get_info(self):
697698

698699
class DeviceInfoHyp(DeviceInfoBLE):
699700
pass
701+
def get_info(self):
702+
as_dict = super().get_info()
703+
as_dict['is_hypersync'] = True
704+
return as_dict
705+
706+
class DeviceInfoBinTimeCmd(DeviceInfoHyp):
707+
pass
708+
def get_info(self):
709+
as_dict = super().get_info()
710+
as_dict['time_cmd'] = True
711+
return as_dict
700712

701713

702714
class CommandRCV(Packet):
@@ -837,6 +849,7 @@ def __str__(self):
837849
PACKET_ID.INFO_V2: DeviceInfoV2,
838850
PACKET_ID.INFO_BLE: DeviceInfoBLE,
839851
PACKET_ID.INFO_HYP: DeviceInfoHyp,
852+
PACKET_ID.INFO_TIME_CMD: DeviceInfoBinTimeCmd,
840853
PACKET_ID.EEG94: EEG94,
841854
PACKET_ID.EEG98: EEG98,
842855
PACKET_ID.EEG99: EEG99,

0 commit comments

Comments
 (0)