mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-08 23:22:04 +08:00
a7db075f08
* start * hmm API doesn't seem great * better * rm line * sendcan -> can_send callable for best static type coverage, list -> tuple msg TODO: logcan * more sendcan -> can_send references * remove pandad's capnp from selfdrive/car * fix and remove cereal from test_can_fingerprint * test_fw_fingerprint: remove pandad, less cereal * comment done too * better comment * fix test_models test * niceeee it works * move to can_definitions * can't come up with a better name :( * I think we can remove SimpleNamespace soon * fix test_can_fingerprint.py * maintain previous behavior * Revert "maintain previous behavior" This reverts commit f848fd32132391692c6191a305bb38f74091ec91. * can test comment * no need for get_one_can now! * big clean up: no SimpleNamespace * now self explanatory! * not needed * use empty can again since this is now real * cmt old-commit-hash: 9880b1393c7bfc2b71aec01b6b91caffb72f9cc0
16 lines
309 B
Python
16 lines
309 B
Python
from collections.abc import Callable
|
|
from typing import NamedTuple, Protocol
|
|
|
|
|
|
class CanData(NamedTuple):
|
|
address: int
|
|
dat: bytes
|
|
src: int
|
|
|
|
|
|
CanSendCallable = Callable[[list[CanData]], None]
|
|
|
|
|
|
class CanRecvCallable(Protocol):
|
|
def __call__(self, wait_for_one: bool = False) -> list[list[CanData]]: ...
|