mirror of
https://github.com/controllerzz/carbus_lib.git
synced 2026-05-22 19:51:41 +03:00
update readme.md
This commit is contained in:
16
README.md
16
README.md
@@ -122,18 +122,16 @@ print("ISO-TP:", resp.hex())
|
|||||||
|
|
||||||
Клиент UDS использует IsoTpChannel:
|
Клиент UDS использует IsoTpChannel:
|
||||||
````python
|
````python
|
||||||
from uds_async.client import UdsClient
|
from isotp_async import CarBusCanTransport
|
||||||
from isotp_async.transport import IsoTpChannel
|
from isotp_async.transport import IsoTpChannel
|
||||||
|
from uds_async import UdsClient
|
||||||
|
|
||||||
isotp = IsoTpChannel(dev, channel=1, tx_id=0x7E0, rx_id=0x7E8)
|
can_tr = CarBusCanTransport(dev, channel=1, rx_id=0x7E8)
|
||||||
uds = UdsClient(isotp_channel=isotp)
|
isotp = IsoTpChannel(can_tr, tx_id=0x7E0, rx_id=0x7E8)
|
||||||
|
uds = UdsClient(isotp)
|
||||||
|
|
||||||
# переход в расширенную диагностическую сессию
|
vin = await uds.read_data_by_identifier(0xF190)
|
||||||
await uds.diagnostic_session_control(0x03)
|
print("VIN:", vin.decode(errors="ignore"))
|
||||||
|
|
||||||
# чтение VIN (DID F190)
|
|
||||||
vin_bytes = await uds.read_data_by_identifier(0xF190)
|
|
||||||
print("VIN:", vin_bytes.decode(errors="ignore"))
|
|
||||||
````
|
````
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user