Comments (6)
No need to encode the data when requesting for a read. You need to decode when receiving the response
If you need to do a read and pass data, then what you are doing is not standard UDS. Assign a DID to each IO, or use DynamicDID.
from python-udsoncan.
You are probably right that it's non standard UDS. But that's the way it was implemented on the ECU, so I have to deal with it.
I programmed a workaround, but thanks for your reply anyways.
from python-udsoncan.
You may want to use this feature
https://udsoncan.readthedocs.io/en/latest/udsoncan/client.html#overriding-the-output
from python-udsoncan.
Thanks for the hint. I tried it but it doesn't really satisfy me like adding this snippet from WriteDataByIdentifier to ReadDataByIdentifier:
req.data = struct.pack('>H', did) # encode DID number
if codec.__class__ == DidCodec and isinstance(value, tuple):
req.data += codec.encode(*value) # Fixes issue #29
else:
req.data += codec.encode(value, cls._sid)
return req
Simply for the reason that I can add additional arguments to the encode function
from python-udsoncan.
Okay sounds good. Drawback is that you have to maintain it and you'll eventually get out of sync with updates.
You could get something not so far by passing a function to the override_payload
method. Using a partial function, you can always make sure that the list of codec is available to that function. Then you recraft your payload with your custom logic and the client interpret the response like if it was a normal response.
Anyhow, you know what's best for your case.
Cheers
from python-udsoncan.
Haven't thought about that tbh.
But this seems to work quite nicely and not having to maintain it is actually a big plus.
Thanks again
from python-udsoncan.
Related Issues (20)
- ReadDataByIdentifier.py TimeoutException Did not receive response in time HOT 2
- send uds req with suppress postive response bit failed HOT 3
- Allow requesting a did without decoding it HOT 11
- Unexpected UDS Authentication message byte order(Subfunction 0x05,0x6) HOT 12
- IsoTPSocketConnection can not be closed with tpsock in blocking mode HOT 5
- struct.error on change_session interpret_response HOT 9
- PythonIsoTpConnection [cilent.py]send_request() tigger TimeoutException,then ISOTP rxthread_task run isotp_send() HOT 7
- IsoTPSocketConnection doesn't work with can-isotp versions 2 and up HOT 9
- Performance tests HOT 16
- When using CAN as a diagnostic channel,other application messages are sent periodically on the bus, calling the client.change_session interface will block at the self.conn.empty_rxqueue() interface. HOT 3
- cannot import name 'Literal' from 'typing' (/usr/lib/python3.7/typing.py) HOT 8
- Act as server and parse python-can messages HOT 6
- No data received: [TimeoutException] Problem HOT 12
- Security access SAPR response not correctly interpreted HOT 3
- WriteDataByIdentifier service execution returned a negative response IncorrectMessageLengthOrInvalidFormat (0x13) when data length is correct HOT 4
- Adding parameter to Communication Control Service(0x28) HOT 10
- SecurityAccess mishandes a level value of 0 HOT 3
- SocketConnection cannot be closed HOT 6
- P2 timer issue on client.transfer_data(block_number, data HOT 22
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-udsoncan.