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

Provide number of received bytes in UDPReceive block as output #236

Closed
bernhard-thiele opened this issue Jul 31, 2018 · 9 comments
Closed
Assignees
Milestone

Comments

@bernhard-thiele
Copy link
Collaborator

Sometimes one would like to know how many new bytes were received. Particularly, one would like to know if a new package has been received at all (hence, received bytes > 0).

The idea is to introduce an additional integer output nRecvBytes to the UDPReceive blocks. This output will be 0 if no new package was received, otherwise its value will be the number of received bytes.

@bernhard-thiele bernhard-thiele added this to the v1.6.0 milestone Jul 31, 2018
@bernhard-thiele bernhard-thiele self-assigned this Jul 31, 2018
@bernhard-thiele
Copy link
Collaborator Author

Additionally, there could be an output nRecvbufOverwrites which allows to check whether the receive buffer was overwritten with new data before the last data was retrieved by the Modelica simulation.

bernhard-thiele added a commit to bernhard-thiele/Modelica_DeviceDrivers that referenced this issue Aug 1, 2018
1. Additional output nRecvBytes. Output is not visible on diagram layer
as default, but can be made visible by a parameter in "Advanced" tab.
2. Additional output nRecvbufOverwrites
bernhard-thiele added a commit that referenced this issue Aug 1, 2018
UDPReceive blocks enhancements. Closes #236
@tbeu
Copy link
Collaborator

tbeu commented Aug 5, 2018

Do you want me to update the SimulationX-specific ITI_MDD.dll already now?

@tbeu tbeu reopened this Aug 5, 2018
@bernhard-thiele
Copy link
Collaborator Author

Yes that would be fine, since I don't have another PR in the pipeline. Could also be good idea to integrate a SimulationX target in the CMakeLists.txt file so that a user of the master branch can easily recompile for SimulationX, if needed.

@tbeu tbeu closed this as completed in c43f5ae Aug 6, 2018
@tbeu
Copy link
Collaborator

tbeu commented Aug 7, 2018

Could also be good idea to integrate a SimulationX target in the CMakeLists.txt file

We have it already, don't we?

@tbeu
Copy link
Collaborator

tbeu commented Aug 24, 2018

The commited changes actually break the API for the UDP send functions, both on Modelica and C level. Should we rather add (and utilize) new functions and keep the existing functions (as obsolete), in order to not break custom models relying on the function layer?

@tbeu tbeu reopened this Aug 24, 2018
@bernhard-thiele
Copy link
Collaborator Author

I don't think this will be an issue since existing code should still work. Since there had been no return value, existing code will not check for any return value, hence it should be backwards compatible, shouldn't it?

@tbeu
Copy link
Collaborator

tbeu commented Aug 24, 2018

@tbeu
Copy link
Collaborator

tbeu commented Aug 28, 2018

To be on the safe side and in compliance with semantic versioning I'd recommend to introduce new/extended functions or to label the new version 2.0.0.

@bernhard-thiele
Copy link
Collaborator Author

bernhard-thiele commented Aug 29, 2018

Hm, in general I don't see the signature of external C functions as part of the public API of a Modelica library, but rather as a part of the internal implementation. However, it's not a big deal to add some functions to maintain backwards compatibility of the C layer in this case, so I will do it.

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

No branches or pull requests

2 participants