-
Notifications
You must be signed in to change notification settings - Fork 214
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
Add defines for changing transport to endianness agnostic #276
Add defines for changing transport to endianness agnostic #276
Conversation
Hi @amgross , thank you for your PR. |
We can use the defines I added to make it (if we will decide to do it I can), but as you can see also they not handle float and double because it is more complex issue (about 64 bits, I don't know if always swapping all bytes or there are architecture that swapping each 4 bytes separately).
It can be done, but why switch-case is cleaner/faster than handling each type in its function? (BTW, it preffered to have in both read and write, so all data passes will be in same endianness) |
I am just thinking what is better. Let's keep it as you have it, just add note to Codec class and BasicCodec class that this classes are handling endianess |
But still i would say that it is better to create port file and include it. Maybe trough one macro in config file... |
So you want me:
Sounds OK? |
I was thinking something like: in basic_codec source file: |
Sounds OK for me (will do id probably tomorrow), we don't want to add working example currently? |
Working example would be great. What do you think @MichalPrincNXP ? |
@Hadatko I done what we talked about, |
Hi @MichalPrincNXP , |
@Hadatko I see one of the CI tests got to timeout, can you try to rerun it? |
Yes this happens sometimes. We should fix that. |
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.
Hello @amgross , I am sorry for delayed response. I am ok with the approach and the proposed changes. Internal on-board testing passed, not affecting any test. But, we do not test the case when two different endianness is used, we rely on your case and the correct functionality on your side. Anyway, I am happy that we have a solution for these cases, thank you for the effort with the PR.
@MichalPrincNXP Wasn't it better to collapse all commits to one before merging? I thought you will ask me to do it or you will do it before merging. |
I am doing the merge from the web and I am not sure if it allows to do the squash merge (unless you are doing it manually on command line) |
Hello @amgross , I am sorry I missed that there is no copyright and license header in newly introduced erpc_endianness_undefined.h and erpc_endianness_agnostic_example.h sources which is not good and we should solve that. Could you please add copyright headers into mentioned files with BSD-3 Clause license, please? Thank you. |
@MichalPrincNXP DONE #417 |
Pull request
Choose Correct
Describe the pull request
Added defines for user for changing the bytes that transport to some endianness agnostic way he decide on.
To Reproduce
Expected behavior
Screenshots
Desktop (please complete the following information):
Steps you didn't forgot to do
Additional context
Tested with two cores with different endianness, the core with little endian changed its endianness while read+write and the other didn't changed anything. 64 bit types and pointer types wasn't tested.
Fixes #106