Skip to content
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

Feature request - Splitting Railcom into Send/Recv part? #823

Open
chatelao opened this issue Feb 7, 2025 · 2 comments
Open

Feature request - Splitting Railcom into Send/Recv part? #823

chatelao opened this issue Feb 7, 2025 · 2 comments

Comments

@chatelao
Copy link

chatelao commented Feb 7, 2025

I like this implementation of RailCom and would like to reuse parts in a decoder implementation.

For this purpose it would be helpful, if the "send" and "receive" part would be a bit more seperate and easy extractable.

I know, this are big whishes, but would maybe also simplifiy the resuse and share of fixes :-).

Thanks a lot for publishing under this great license
Oli

@balazsracz
Copy link
Collaborator

Currently there is very little implemented in terms of the "send" part for railcom.
They are all static functions in the RailcomDefs class here: https://github.com/bakerstu/openmrn/blob/master/src/dcc/RailCom.hxx#L135

There is an example that I started working on but I am not convinced that I ever finished it to the point that it would be working:
https://github.com/bakerstu/openmrn/blob/master/applications/dcc_decoder/main.cxx
Even if it does work, a lot of the code in here would probably need to be refactored into some shared libraries. (Contributions are welcome!)

The good news is that even if you take the files (railcom.hxx/cxx and railcom.h) as-is, the linker will eliminate all code and constants that you are not actually using. So for example the railcom_decode[] array will not take code space in your decoder.

@chatelao
Copy link
Author

chatelao commented Feb 7, 2025

Thanks for your feedback and if I will achieve something working based on your start, I'll come back and drop you a note.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants