Skip to content

Commit b8204d6

Browse files
committed
refactor class name to 64b command, fix docs
1 parent 9c27b5b commit b8204d6

2 files changed

Lines changed: 8 additions & 14 deletions

File tree

src/explorepy/command.py

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class CommandID(Enum):
1616
"""Command ID enum class"""
1717
API2BCMD = b'\xA0'
1818
API4BCMD = b'\xB0'
19-
API40BCMD = b'\xC0'
19+
API64BCMD = b'\xC0'
2020

2121

2222
class OpcodeID(Enum):
@@ -184,12 +184,12 @@ def __str__(self):
184184
"""prints the appropriate info about the command. """
185185

186186

187-
class Command40B(Command):
187+
class Command64B(Command):
188188
"""An abstract base class for Explore 40 Byte command data length packets"""
189189

190190
def __init__(self):
191191
super().__init__()
192-
self.pid = CommandID.API40BCMD
192+
self.pid = CommandID.API64BCMD
193193
self.payload_length = int2bytearray(40, 2)
194194

195195
@abc.abstractmethod
@@ -228,14 +228,8 @@ def __str__(self):
228228
return "Set sampling rate command"
229229

230230

231-
class SetBinaryTime(Command40B):
232-
"""Set the sampling rate of ExG device"""
233-
234-
def __init__(self, time):
235-
"""
236-
Args:
237-
sps_rate (int): sampling rate per seconds. It should be one of these values: 250, 500 or 1000
238-
"""
231+
class SetBinaryTime(Command64B):
232+
def __init__(self):
239233
super().__init__()
240234
self.opcode = OpcodeID.CMD_SET_EMMC_TIME
241235
from datetime import datetime
@@ -254,7 +248,7 @@ def __init__(self, time):
254248
3,
255249
]
256250
)
257-
self.param = date_time + bytes(41)
251+
self.param = date_time + bytes(51)
258252

259253
def __str__(self):
260254
return "set time cmd"
@@ -330,7 +324,7 @@ def __str__(self):
330324
COMMAND_CLASS_DICT = {
331325
CommandID.API2BCMD: Command2B,
332326
CommandID.API4BCMD: Command4B,
333-
CommandID.API40BCMD: Command40B
327+
CommandID.API64BCMD: Command64B
334328
}
335329

336330

src/explorepy/explore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ def set_binary_time(self):
661661
Returns:
662662
bool: True for success, False otherwise
663663
"""
664-
cmd = SetBinaryTime(self)
664+
cmd = SetBinaryTime()
665665
if self.stream_processor.configure_device(cmd):
666666
logger.info('Device set to current time.')
667667
return True

0 commit comments

Comments
 (0)