Comments (7)
Maybe implementing an ioctl for SIOCOUTQ
or SIOCOUTQNSD
?
from can-isotp.
Hm. Would this mean you need to poll with tons of ioctl() syscalls to check, when the PDU has been sent entirely??
Today the next (second) write access to the socket blocks the process until the former transmission has been completed. There is just a single PDU buffer for transmission.
What about blocking even the first write syscall until the PDU has been sent out?
We would then still have one buffer but the process would be blocked until the PDU is sent completely.
from can-isotp.
That would mean polling, yes. I am comfortable with this given that I don't need a fine granularity.
I am not sure about blocking at write time. Wouldn't that cause problem for full duplex operation?
Are you saying that I could write a 0 length payload to the socket and the success of this operation would confirm that my previous payload is completely out?
from can-isotp.
In term of ISO-15765-2. This feature would correspond to providing N_USData.confirm
. Actually, it would be ideal to detect the beginning of a reception through N_USData.FF.ind
. The UDS P2 timer is relative to the end of transmission and beginning of reception. If N_USData.FF.ind
is not available (sart of reception), ISO-14229-2 suggest to time between end of transmission and end of reception (P6 timer).
My actual implementation count between start of transmission and end of reception.
The N_USData.confirm service is issued by the network layer. The service primitive confirms the completion
of an N_USData.request service identified by the address information in N_SA, N_TA, N_TAtype [and N_AE].
The parameter <N_Result> provides the status of the service request (see 7.3 for parameter definition).
from can-isotp.
I was checking out some more documentation about sockets. And in fact sockets are usually blocking. So if we would block the write() syscall until the PDU is sent, this would be correct.
The programmer would be able to set the socket into a NON-BLOCKING mode, where you get an -EWOULDBLOCK error, when the buffer is not free (== the PDU is not sent).
This can be handles with poll() or better select() to monitor the sending socket.
The question whether you are losing the full-duplex capability:
- UDS is a half-duplex protocol, right?
- if you use select() you have separate 'watchers' for read/write even on the same file descriptor
So the select() call would either return when you received a PDU or when the writing filedescriptor signals to be writable again.
I wonder if it would make sense to create a "standard conform" blocking version of the current implementation to play with select() and see if it fits the needs?!?
from can-isotp.
Hi,
- UDS is mainly hald duplex, except for some services that can send payloads on event. I don't support these services anyway. My reasoning stopped at the transport layer level, ISO-15765 is full duplex by definition (I think).
- Would probably work.
I think it would make sense to try the blocking version of the module. No rush.
from can-isotp.
Addressed here pylessard/python-udsoncan#43 (comment)
and hopefully closed ;-)
from can-isotp.
Related Issues (20)
- use read() function and add notify function. HOT 18
- ERRNO 84 on recv() HOT 2
- FlowControl: isotp vs. "real" OBD2 adapter behavior HOT 4
- how to send > 4095 isotp message HOT 3
- wait_tx_done does not seem to be working [RPi + python-can-isotp] HOT 31
- MAX_MSG_LENGTH to 66000 commit is missing from this repo HOT 1
- When trying to read 8K messages on ISO-TP socket using Classic CAN receive back -1 with errno 110 ETIMEDOUT HOT 5
- FlowControl frame address tx_id vs. rx_id - 8? HOT 2
- Unrecoverable error when using python socket with CAN_ISOTP. HOT 8
- Sending rate cannot be faster than 300us HOT 12
- unstable transmission of data: sequence number of consecutive frames get messed up HOT 3
- MSG_CMSG_COMPAT set by the kernel for `recvmsg` HOT 7
- Compiling of branch mainline-5.4+ HOT 2
- IP over CAN ISO-TP multi-host HOT 2
- Address extension in one direction but not the other HOT 2
- ISOTP module does not ignore the priority bits (high 3 bits of extended ID) HOT 4
- read: Network is down HOT 2
- missing feedback on expired timer for first flow control (FC) frame HOT 2
- best way to programatically test if the module is installed? HOT 6
- make fails and I can't figure out why. Hoping someone can help out HOT 3
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 can-isotp.