good serial port class for the .net framework? -


Does anyone know a good (expected free) class to replace the .NET serialport class? This is causing me problems and I need one which is slightly more flexible.

, but must be issued by issuing the IOCTL_SERIAL_SET_DTR and IOCTL_SERIAL_CLR_DTR commands when I open the port, so I need some more flexibility to provide the class provided by the Net Workwork.

Many years ago I had used serial support purely. It's a compact framework, but I used it for both compact devices and regular Windows apps. You can get the source code so that you can modify it yourself, which I have done.

This creates a c # wrapper around the serial function imported from kernel 32.dll

Maybe you can

here There is a code that I used to call it

  using OpenNETCF.IO.Serial; Public static port port; Private wide port settings port settings; Private Mutex updatebook = new mutes (); // Try the port {// Turn off port settings Port Settings = New HandshakeNone (); PortSettings.BasicSettings.BaudRate = BaudRates.CBR_9600; Do not create a default port on COM 3 which does not have any hands-off port = new port ("Com 3:", port settings); // Define an event handler port. DataReceived + = New Port.CommEvent (port_DataReceived); Port.RThreshold = 1; Port.InputLen = 0; Port .stresshold = 1; Try {port.Open (); } Hold {port Close (); }} Hold {port.Close (); } Private void port_DataReceived () {// Since RThreshold = 1, we receive an event for each character byte [] inputData = port.Input; // Do something with the data // Note that this is called from a read thread so that you should // save the main bag from any data pass from here to the mate thread // Do not forget to use mutex in the original thread Well UpdateBusy.WaitOne (); // Copy data update another data structure. Revsmutux (); } Private Zero port_SendBuff () {byte [] outputData = new byte [essence]; CRC = 0xffff; J = 0; OutputData [J ++] = FS; // More code to fill the buff output data [j ++] = FS; // The number of characters sent is determined by the size of the output data port. Output = outputdata; } // the code to close the port if (port.IsOpen) {port.Close (); } Port.Dispose ();  

Comments