-
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TP]: Rewrite to aid maintainability and possiblity to expand with other features #344
Conversation
Yeah I see what you mean, when implementing I tried to keep in mind a third "SessionDirection" which would be something like "ListenOnly" but thats not yet in there. But an approach like yours might work as good as well, though it introduces some dupplication when maintaining the stack. Something we already experience quite a bit with the current 3 transport protocols being very similar in some places. |
It would of course, and each protocol is juuuust different enough to make sharing code between them troublesome. The good thing is, the transport layer is quite stable from an ISO/J1939 requirements perspective, and probably won't need to be messed with too often once a listener is working (especially if we can ever hit it with the AEF conformance test tool to get it 100% compliant). Going back to your (paraphrased) goal with this:
This strikes me as a, lets say, abnormal thing to want in a "normal" ISOBUS application but something many people will want regardless of course, so, one thing I really like about a separate object is that it makes it clear when you use it that you are doing things outside the "core" functionality of the stack - something extra with a clearly defined but separate data path. Like, you really have to opt-in. Plus, then the fairly substantial extra storage associated with it becomes more optional, especially if we control linking it with CMake, because sniffing could result in us storing (253 + (253 * 252)) = 63756 sessions!!!! (or, 253+(253!)/(2!*(253-2)!)*2 if you want to be pedantic about your equations). |
I'm sure we can control the memory cost without making it optionally linkable of course, it's just something to think over and consider. No matter what path we go, we may want to not sniff anything unless specifically configured to do so one way or another. |
4de4a21
to
05014db
Compare
b8b8926
to
19d2bb3
Compare
@ad3154, I still think this is a great addition. I changed a lot and in my opinion it is now more modular and future proof. I can easily implement a message 'sniffer' based on this format that doesn't hurt our performance/memory usage, and is opt-in without too much extra codebase. Though you might still think otherwise, and hence I'm curious for your thoughts on this :) edit: it most-likely still has some bugs in it that need to be catched |
Ah, ok, I can take another look and let you know my thoughts 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do think there's valuable stuff in here, especially in the TP file and it does make some steps towards multiple goals we wanted.
I would like to do some load testing with it just to make sure it still all works OK with multiple sessions going at once, and of both types of sessions to see if we can provoke any bugs.
My main mental sticking point is still that I don't enjoy too many levels of abstract data types on top of abstract data types. I'm still not sure I grasp the benefit of having things like CANMessageDataVector which inherits from CANMessageData which inherits from a vector, when the data, really, is just a vector. Or CANMessageDataView which inherits from CANMessageData which inherits from CANDataSpan which is really just a templated version of DataSpan, which is just an array of bytes and a size. (I know I'm being a little over-simplify-y here, appologies)
Was your thinking mainly to consolidate CANMessageDataCallback? It just feels like a lot of misdirection which at least kinda feels more confusing to me than just interacting with the native/standard types.
I dunno... I could be convinced I think, maybe I am just not grasping your whole picture here, or maybe you need this to better enable sniffing? I might just need more explaining
Yeah that's basically one of the two main reasons I think:
I feel like it will reduce the chance of failures in the future, at least from inside the stack. Not that, that was a problem in the first place, but a little more robust structure should not harm.
Yeah definitely, though I think it's better to think of it as a simple 'interface'. No need to worry about the levels of abstraction beneath it. How I like to think about it:
So no need to worry about all the ADT's behind it, I know we still are low level developers by heart, but let's appreciate a bit of abstraction here hahah. |
0e674bb
to
a3f7248
Compare
I appreciate your explanations, they do help me see what you mean, and I do feel a bit better about it now... Like I mentioned I'd like to run some tests just because I am paranoid about changing TP, but then I think I'm OK with it and will give it one last look over. Sorry I'm stalling, haha |
Yeah no worries, I was planning on trying to cover it with unit tests first as well. But I'm not sure where to start to be completely honest. Since the TP probably won't change in the mean time, i'm fine with leaving it open a little longer to be sure there are no issues. |
94f8c7b
to
b0301bd
Compare
In b0301bd I removed the There's still a list I want to do before thinking about merging this into main:
|
f97bb58
to
7f22945
Compare
b7ebe5a
to
07bb2d7
Compare
07dc021
to
92f4717
Compare
92f4717
to
4e47e6e
Compare
9b7cfdf
to
f294c79
Compare
b804c00
to
721f36c
Compare
Quality Gate passedThe SonarCloud Quality Gate passed, but some issues were introduced. 23 New issues |
Replaced by #391 |
This is basically a proof of concept that works as far as the unit tests go. Now I seek some feedback if we actually want these changes or not.
What changes: