Lines Matching +full:re +full:- +full:sending
3 # SPDX-License-Identifier: Apache-2.0
6 Zephyr CAN shell module support for providing a python-can bus interface for testing.
9 import re
21 class CanShellBus(BusABC): # pylint: disable=abstract-method
27 can_filters: Optional[CanFilters] = None, **kwargs) -> None:
52 def _get_capabilities(self) -> list[str]:
56 regex_compiled = re.compile(r'capabilities:\s+(?P<caps>.*)')
64 def _set_mode(self, mode: str) -> None:
79 def send(self, msg: Message, timeout: Optional[float] = None) -> None:
80 logger.debug('sending: %s', msg)
83 cmd += ' -e' if msg.is_extended_id else ''
84 cmd += ' -r' if msg.is_remote_frame else ''
85 cmd += ' -f' if msg.is_fd else ''
86 cmd += ' -b' if msg.bitrate_switch else ''
97 regex_compiled = re.compile(r'enqueuing\s+CAN\s+frame\s+#(?P<id>\d+)')
111 def _add_filter(self, can_id: int, can_mask: int, extended: bool) -> None:
114 cmd += ' -e' if extended else ''
124 regex_compiled = re.compile(r'filter\s+ID:\s+(?P<id>\d+)')
134 def _remove_filter(self, filter_id: int) -> None:
144 def _remove_all_filters(self) -> None:
149 def _apply_filters(self, filters: Optional[CanFilters]) -> None:
168 def _recv_internal(self, timeout: Optional[float]) -> Tuple[Optional[Message], bool]:
169 frame_regex = r'.*' + re.escape(self._device) + \
170 r'\s+(?P<brs>\S)(?P<esi>\S)\s+(?P<can_id>\d+)\s+\[(?P<dlc>\d+)\]\s*(?P<data>[a-z0-9 ]*)'
174 regex_compiled = re.compile(frame_regex)
193 def shutdown(self) -> None: