All scanner share the same basic connection args.
Transports are subclasses of {class}gallia.transports.BaseTransport.
The argument --target specifies all parameters which are required to establish a connection to the device under test.
The argument to --target is specified as a URI.
An URI consists of these components:
scheme://host:port?param1=foo¶m2=bar
|location |
The parameters support: string, int (use 0x prefix for hex values) and bool (true/false) values. The relevant transport protocol is specified in the scheme.
ISO-TP (ISO 15765-2) as provided by the Linux socket API.
The can interface is specified as a host, e.g. can0.
The following parameters are available (these are ISOTP transport settings):
tx_id (required)
: The ISOTP source address as int.
rx_id (required)
: The ISOTP destination address as int.
force_extended (optional)
: Use extended CAN identifiers.
is_fd (optional)
: Use CAN-FD frames.
frame_txtime (optional)
: The time in milliseconds the kernel waits before sending a ISOTP consecutive frame.
ext_address (optional)
: The extended ISOTP address as int.
rx_ext_address (optional)
: The extended ISOTP rx address.
tx_padding (optional)
: Use padding in sent frames.
rx_padding (optional)
: Expect padding in received frames.
tx_dl (optional)
: CAN-FD max payload size.
Example:
isotp://can0?src_addr=0x6f4&dst_addr=0x654&rx_ext_address=0xf4&ext_address=0x54&is_fd=false
force_extended_ids (optional)
: Use extended CAN identifiers.
is_fd (optional)
: Use CAN-FD frames.
Example:
can-raw://can1?is_fd=true
The DoIP gateway address is specified in the location.
src_addr (required)
: The source address as int.
target_addr (required)
: The target address as int.
activation_type (optional)
: Overwrite the routing activation type.
protocol_version (optional)
: Overwrite the DoIP protocol in the header.
Example:
doip://169.254.100.100:13400?src_addr=0x0e00&target_addr=0x1d
The gateway address is specified in the location.
src_addr(required): The source address as int.dst_addr(required): The destination address as int.ack_timeout: Specify the HSFZ acknowledge timeout in ms.
Example:
hsfz://169.254.100.100:6801?src_addr=0xf4&dst_addr=0x1d
A simple tcp based transport. UDS messages are sent linebased in ascii hex encoding. Mainly useful for testing.
Example:
tcp-lines://127.0.0.1:1234
Transports can also be used in own standalone scripts; transports are created with the .connect() method which takes a URI.
import asyncio
from gallia.log import setup_logging
from gallia.transports import DOiPTransport
async def main():
transport = await DOiPTransport.connect("doip://192.0.2.5:13400?src_addr=0xf4&dst_addr=0x1d")
await transport.write(bytes([0x10, 0x01]))
setup_logging()
asyncio.run(main())