I produced this library to overcome a few shortcomings with the Serial2 library, in particular using it for binary data transfers. You can read what they are in the help. This library is a superset of Serial2 with additional events for errors and pin changes and is an almost complete exposure of the .NET SerialPort class.
Help and source for merging together with the libary are in the attachment. I didn't bother with a demo for this library - use one for Serial2 and expand it if you want to experiment.
I have just transferred my app from the PC to the device and discovered that the GetPorts method does not return the full list of available ports on a device. I only got COM1, 2, 4, & 3. I had to use the Registry to do it (http://www.basic4ppc.com/forum/code-...-registry.html). This returned 1 to 8 (including the bluetooth ports)
Is there any particular reason for this? Would it be possible to merge the Registry functionality into the SerialEx dll?
The .NET SerialPort GetPorts method gets its information from the Registry using the entries under HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM which is valid on both device and desktop. Erel's code uses HKEY_LOCAL_MACHINE\DRIVERS\ACTIVE which only exists on the device. I don't know what the difference is.
Quote:
Would it be possible to merge the Registry functionality into the SerialEx dll?
Possible yes, probable no - unless I have another reason to release an updated version of the library.
IF I ever did do it I would write the device COM port Registry search into the SerialEx.GetPorts method. I didn't mean that I would merge the two libraries into one!
StopBits=0 gives me an error stating "Enumvalue was out of Legal Range."
StopBits=1 works with no erros...
But I'm still in the configuring the com port, so I haven't even opened it yet...
Can this be a bug?
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France-Saumur
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate) B4PPC DLL Version Listing - B4Android DLL Version Listing
No, it seems deliberate on Microsofts part for some reason. The StopBits enumeration is documented to have (and actually has when checked with Reflector) the four values shown in the help, 0, 1, 1.5 or 2 and most hardware can support these. However when I look with Reflector inside the SerialPort class, for some reason known only to whoever wrote that software, it is deliberately programmed to only accept either 1 or 1.5 stop bits. I have no idea why this limitation exists! 1 stop bit is universal nowadays, I haven't seen 1.5 used since the days of 5 hole mechanical teletype machines.
So If I really need to set the value to zero, is there any workaround?
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France-Saumur
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate) B4PPC DLL Version Listing - B4Android DLL Version Listing