mirror of
https://github.com/lowobservable/coax.git
synced 2026-02-27 09:28:56 +00:00
Remove unimplemented transmit and receive commands
This commit is contained in:
@@ -79,8 +79,6 @@ void sendErrorMessage(uint8_t code, const char *description)
|
||||
}
|
||||
|
||||
#define COMMAND_RESET 0x01
|
||||
#define COMMAND_TRANSMIT 0x02
|
||||
#define COMMAND_RECEIVE 0x04
|
||||
#define COMMAND_TRANSMIT_RECEIVE 0x06
|
||||
|
||||
void handleResetCommand(uint8_t *buffer, int bufferCount)
|
||||
|
||||
@@ -7,12 +7,6 @@ class Interface:
|
||||
def reset(self):
|
||||
raise NotImplementedError
|
||||
|
||||
def transmit(self, words, repeat_count=None, repeat_offset=1):
|
||||
raise NotImplementedError
|
||||
|
||||
def receive(self, length=None, timeout=None):
|
||||
raise NotImplementedError
|
||||
|
||||
def transmit_receive(self, transmit_words, transmit_repeat_count=None,
|
||||
transmit_repeat_offset=1, receive_length=None,
|
||||
receive_timeout=None):
|
||||
|
||||
@@ -45,35 +45,6 @@ class SerialInterface(Interface):
|
||||
|
||||
return '{}.{}.{}'.format(major, minor, patch)
|
||||
|
||||
def transmit(self, words, repeat_count=None, repeat_offset=1):
|
||||
message = bytes([0x02])
|
||||
|
||||
message += _pack_transmit_header(repeat_count, repeat_offset)
|
||||
message += _pack_transmit_data(words)
|
||||
|
||||
self._write_message(message)
|
||||
|
||||
message = self._read_message()
|
||||
|
||||
if message[0] != 0x01:
|
||||
raise _convert_error(message)
|
||||
|
||||
def receive(self, length=None, timeout=None):
|
||||
timeout_milliseconds = self._calculate_timeout_milliseconds(timeout)
|
||||
|
||||
message = bytes([0x04])
|
||||
|
||||
message += _pack_receive_header(length, timeout_milliseconds)
|
||||
|
||||
self._write_message(message)
|
||||
|
||||
message = self._read_message()
|
||||
|
||||
if message[0] != 0x01:
|
||||
raise _convert_error(message)
|
||||
|
||||
return _unpack_receive_data(message[1:])
|
||||
|
||||
def transmit_receive(self, transmit_words, transmit_repeat_count=None,
|
||||
transmit_repeat_offset=1, receive_length=None,
|
||||
receive_timeout=None):
|
||||
|
||||
Reference in New Issue
Block a user