jacobschaer / python-doipclient

Pure Python ISO 13400 Client
MIT License
151 stars 50 forks source link

help me about DID scanning #19

Closed daytona675 closed 2 years ago

daytona675 commented 2 years ago

Hi Jacob, i don't know how to scan DID with DoiPClient library. I use this piece of code:
from doipclient.connectors import DoIPClientUDSConnector from udsoncan.client import Client, Request

uds_client = Client(uds_connection) with Client(uds_connection, request_timeout=2) as client: try: client.read_data_by_identifier_first([0xF190]) except NegativeResponseException as e: print('Server refused our request for service %s with code "%s" (0x%02x)' % (e.response.service.get_name(), e.response.code_name, e.response.code)) except (InvalidResponseException, UnexpectedResponseException) as e: print('Server sent an invalid payload : %s' % e.response.original_payload) and when I run this script I 've this error: [ConfigError] : Actual data identifier configuration contains no definition for data identifier 0xf190 [ConfigError] : Actual data identifier configuration contains no definition for data identifier 0xf190

For me that normal, because I've don't initiate the config dictionnary with right parameters for this record.

But my aim is to discovers services and DID in UDS so how to define something I don't know at the beginning ?

So if you can help me ? many thanks by advance :)

jacobschaer commented 2 years ago

This question is better suited to the udsoncan project as DID's are not DoIP related. But from what I recall there is no such service in UDS. You're only options are to: 1) Know the DIDs because you're the OEM and the define the config struct accordingly 2) Have access to a definition file like ODX which defines these things in a machine readable format 3) Fuzz the network and figure out from the errors what ID's are valid in any given session and what their buffer sizes are

daytona675 commented 2 years ago

Thanks for your answer. I m trying something Best regards

Le dim. 28 août 2022 à 08:37, Jacob Schaer @.***> a écrit :

Closed #19 https://github.com/jacobschaer/python-doipclient/issues/19 as completed.

— Reply to this email directly, view it on GitHub https://github.com/jacobschaer/python-doipclient/issues/19#event-7272984372, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB565KH3D4SNCYMWERIYUVLV3MCL7ANCNFSM57SGO2IA . You are receiving this because you authored the thread.Message ID: @.***>