Access serial port in managed plugin?

I’ve written a plugin DLL in C# and Visual Studio to access the serial port. It works fine standalone, but when I place the DLL in Unity, I can not get data from the serial port using events. Does Unity shut this down? Do I have to write the DLL in C/C++ and have the Pro version?
I’m using the free version of Unity.

Thanks

I can not get data from the serial
port using events

Make sure you are compiling the project using the .net 2.0 compatibility. This will include the assemblies needed to access Serial Ports.

https://docs.unity3d.com/Manual/class-PlayerSettingsStandalone.html

Do I have to write the DLL in C/C++
and have the Pro version?

No, you can use the Free version.


There are many resources online that talk about communicating to via a Serial Port with Unity. I found this one that is a good starting point:

http://www.dyadica.co.uk/unity3d-serialport-script/