How to read the com port data in ue4?

I have a hardware device,Data from the com port, I want Read its data in the UE4.

I try to use the WINAPI ReadFile, it does not work in ue4.But on the outside of the UE4, it work properly.
This looks very strange.

Does anyone know what’s going on?

thanks everybody

Same way you would in any other C++ program.

For example: GitHub - wjwwood/serial: Cross-platform, Serial Port library written in C++

If you want information on linking to the external library from your project, see this question: https://answers.unrealengine.com/questions/197667/how-do-you-statically-link-an-external-dlldylib-to.html

Thank you, I have a try

Problem solved, thank you

Hi Juvarunst, could you please post the solution ? I’ve tried many ways but all ended faliure.

I make a dll, I link the this dll in UE4

Hello, I have the same problem now. I hope I can get your help.My version is 4.20.May I have your email address?My email is 1278263100@qq.com