feat: implement set_project_info functionality and add POC test script
This commit is contained in:
@@ -413,6 +413,40 @@ class MiniMateProtocol:
|
||||
)
|
||||
return header_bytes, length
|
||||
|
||||
def read_waveform_data_raw(self) -> bytes:
|
||||
"""
|
||||
Send the SUB 09 (WAVEFORM_DATA) two-step read and return the raw
|
||||
202-byte (0xCA) waveform data block.
|
||||
|
||||
This is the "waveform data" block that Blastware reads from the device
|
||||
before the write sequence (confirmed from 3-11-26 BW TX capture BW[80-81]).
|
||||
The returned bytes are used verbatim as the ``waveform_data`` payload for
|
||||
``write_waveform_data()`` / ``push_config_raw()``.
|
||||
|
||||
Returns:
|
||||
Raw data section starting at data[11:], typically 204 bytes.
|
||||
(data[11 : 11 + 0xCA] = 202 bytes on some firmware; the actual
|
||||
length may be 204 depending on firmware version.)
|
||||
|
||||
Raises:
|
||||
ProtocolError: on timeout, bad checksum, or wrong response SUB.
|
||||
"""
|
||||
SUB_WAVEFORM_DATA = 0x09
|
||||
rsp_sub = _expected_rsp_sub(SUB_WAVEFORM_DATA) # 0xFF - 0x09 = 0xF6
|
||||
length = DATA_LENGTHS[SUB_WAVEFORM_DATA] # 0xCA = 202
|
||||
|
||||
log.debug("read_waveform_data_raw: 09 probe")
|
||||
self._send(build_bw_frame(SUB_WAVEFORM_DATA, 0))
|
||||
self._recv_one(expected_sub=rsp_sub)
|
||||
|
||||
log.debug("read_waveform_data_raw: 09 data request offset=0x%02X", length)
|
||||
self._send(build_bw_frame(SUB_WAVEFORM_DATA, length))
|
||||
data_rsp = self._recv_one(expected_sub=rsp_sub)
|
||||
|
||||
raw = data_rsp.data[11:]
|
||||
log.debug("read_waveform_data_raw: got %d bytes", len(raw))
|
||||
return raw
|
||||
|
||||
def read_waveform_record(self, key4: bytes) -> bytes:
|
||||
"""
|
||||
Send the SUB 0C (WAVEFORM_RECORD / FULL_WAVEFORM_RECORD) two-step read.
|
||||
|
||||
Reference in New Issue
Block a user