[Mono-dev] SerialPort and Ring Indicator signal
Carlos Alberto Cortez
calberto.cortez at gmail.com
Tue May 23 02:16:00 EDT 2006
The functionality for serial port inside kernel32.dll allows to access
the RING signal (the wrapper class makes public the access to it), but
it's only available on Windows (kernel32.dll is a core windows library).
Of course you could try to wrap some functionality in Unix systems
-using termios and ioctl interfaces- in a new class.
But from the System.IO.Ports.SerialPort is not possible to access that
pin signal -because of the api compatibility-.
For monitoring the RING signal -only checking its state-, take a look at
SerialPort.SerialPinChange event (observe that RING signal is not yet
monitored, although doing it is a matter of adding some constants in a
pair of places). I will take a look at it on the weekend.
El mar, 23-05-2006 a las 09:53 +0200, jfm escribió:
> Thank you Carlos for your answer
> I'm not sure I've well undestound but here are some information about
> the app I'm porting.
> As serial port are not supported in .Net 1, the app was using the
> Rs232.vb class that is wide spread accros the internet... This class
> is some kind of wrapper upon the kernel32.dll... I'm not sure these
> informations are of any help...
> In you mail you said that RI can be monotored with events ?? please
> could you give mon hints about this ??? this could be a solution for
> me !
> Thank you.
> PS : please forget my English ;)
> Carlos Alberto Cortez wrote:
> > Well, RING indicator can't be directly used (as opossed to Cts, Dsr, CD,
> > Rts and Dtr). The public API in .Net does not expose this indicator
> > directly (you can only monitor it based on the events).
> > Of course we could add it to the get_signal_code () function and
> > retrieve it. But the real problem is that we can't add it - we must keep
> > compatibility with .Net API.
> > Probably this is achieved in some way - since you mentioned that you are
> > porting a .Net app-. But in that case, we must have additional info -and
> > some code-.
> > Carlos.
> > El lun, 22-05-2006 a las 18:58 +0200, jfm escribió:
> > > Hi,
> > > I'm porting a program running on microsoft .net to mono. This program
> > > uses modem information like Dsr and Cts but it also uses RI (ring
> > > indicator).
> > > My problem is that RI doesn't seem to be supported (see enum
> > > MonoSerialSignal in the get_signal_code function in serial.c), am I right ?
> > > If yes, I could make the modification, I think it is only few lines
> > > (adding a new entry to the enum and a if with TIOCM_RI (defined in
> > > ioctl-type.h) in the function but it might involve recompiling a lots of
> > > thing and I don't know how to do.
> > >
> > > Best regards
> > >
> > > Jean-François
> > > _______________________________________________
> > > Mono-devel-list mailing list
> > > Mono-devel-list at lists.ximian.com
> > > http://lists.ximian.com/mailman/listinfo/mono-devel-list
> > >
More information about the Mono-devel-list