-
Notifications
You must be signed in to change notification settings - Fork 31
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 utility function to retrieve MAC address #255
Add utility function to retrieve MAC address #255
Conversation
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.
Looks good. I could only test it using Windows. Works with Dymola (MSVC and MinGW), doesn't work with OMC. However, since it works with MinGW I don't really understand why it fails with OMC.
Does it fail to build or to simulate with OMC on Win? |
The build fails. I get errors like
This can be avoided by adding a model Testme
String s;
equation
when sample(0.1,0.1) then
s = Modelica_DeviceDrivers.Utilities.Functions.getMACAddress();
Modelica.Utilities.Streams.print(s);
end when;
end Testme; compiles (though there are some linker issues):
However, the simulation process crashes immediately. |
Hm, we have |
f579ab6 fixes one redefinition warning. I am also about to mark Modelica_DeviceDrivers.Utilities.Functions.getMACAddress as pure function, since normally you will not change physical address of network adapter while M_DD simulation runs. OK to change? |
Do you mean to change it by using the Modelica |
No, I simply want to remove the Impure annotation. |
Sure, makes sense. |
Tested with Cygwin, MinGW, MSVC and GCC on Linux.
As mentioned in #244 (comment) I needed to split the utility functions in separate header files to avoid linker errors,
TODO: Add libIPHlpApi.a to the Linux libraries