Home > other >  Help ~!!! About the Android U3D development of the serial port
Help ~!!! About the Android U3D development of the serial port

Time:09-22

I just want to read an android to a serial port data, but the android has been submitted to the DLLNotFindExcetion: MonoPosixHelper
How to deal with, just want to read a serial port...
Hardware must be no problem, use Google's open source API serial port tried, online search for a long time still no results, only to ask everyone, help...
Below is the code:
 void SerialPortInit (string com) 
{
String portName;
If (com==null)
PortName="COM0";
The else
PortName=com;
Int baudRate=115200;
Parity Parity=Parity. None;
Int dataBits=8;
StopBits StopBits=StopBits. One;
Int ReadTimeOut=400;
SerialPort sp=null;
Sp=new SerialPort (portName baudRate, parity, dataBits, stopBits);
Sp. ReadTimeout=ReadTimeout;
Try
{
If (sp. IsOpen)
{
Sp. The Close ();
Sp. The Open ();
}
The else
{
Sp. The Open ();
}
}
The catch (Exception ex)
{
The Debug Log (" error: "+ ex. Message);
}
}

CodePudding user response:

Help, everyone...

CodePudding user response:

I also in the as a serial port development
  • Related