mirror of https://github.com/commaai/panda.git
SPI: send hw type with version (#1490)
Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
parent
abcbfb44b4
commit
d693e89df2
|
@ -95,6 +95,10 @@ void spi_rx_done(void) {
|
|||
#endif
|
||||
data_len += 12U;
|
||||
|
||||
// HW type
|
||||
spi_buf_tx[data_pos + data_len] = hw_type;
|
||||
data_len += 1U;
|
||||
|
||||
// SPI protocol version
|
||||
spi_buf_tx[data_pos + data_len] = 0x1;
|
||||
data_len += 1U;
|
||||
|
|
|
@ -21,10 +21,13 @@ class TestSpi:
|
|||
def test_protocol_version(self, p):
|
||||
v = p._handle.get_protocol_version()
|
||||
|
||||
uid = binascii.hexlify(v[:-1]).decode()
|
||||
uid = binascii.hexlify(v[:12]).decode()
|
||||
assert uid == p.get_uid()
|
||||
|
||||
assert v[-1:] == b"\x01"
|
||||
hwtype = v[12]
|
||||
assert hwtype == ord(p.get_type())
|
||||
|
||||
assert v[-1] == 1
|
||||
|
||||
def test_all_comm_types(self, mocker, p):
|
||||
spy = mocker.spy(p._handle, '_wait_for_ack')
|
||||
|
|
Loading…
Reference in New Issue