Skip to content

Commit f106224

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

3 files changed

Lines changed: 13 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: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,17 @@ def get_info(self):
697697

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

701712

702713
class CommandRCV(Packet):

0 commit comments

Comments
 (0)