The gambas serial implementation has one bug!

the Xon/Xoff flow control are not implemented and only are the "Both" that
could be confused with!

that's why my class does not work! i'll report then now

Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com

2015-11-30 18:26 GMT-04:30 PICCORO McKAY Lenz <mckaygerh...@gmail.com>:

> i'm trying t5o use the serial port with a class..
>
> but when i try to write to the serial port nothing happened.. only wend
> data if i made all the port stuff from the form class
>
> here the code and the problems in comments:
>
> '' ************* Begin class serial manager
> Private SComm As SerialPort
> Public Sub _new()
>   SComm = New SerialPort As "SComm"
>   SComm.Speed = 9600
>   SComm.Parity = SerialPort.None
>   SComm.DataBits = SerialPort.Bits8
>   SComm.StopBits = SerialPort.Bits1
>   SComm.FlowControl = SerialPort.Both
> End
> Public Function usarpuerto(puerto As String) As Boolean
>   ' use port name passed
>       SComm.PortName = puerto
>   Try
>     SComm.Open()
>     If Error Then
>       Print "Error " & Error.Code & " en " & Error.Text & " ---- " &
> Error.Backtrace
>       Return Null
>     Endif
>  ' write to the port
>       Print #SComm, Chr$(2) & "X" & Chr$(3)
>       If Error Then
>         Return False
>       Endif
>   ' now close the port
>       If SComm.Status = Net.Active Then
>         Try
>         SComm.Close()
>         If Error Then
>           Return Null
>         Endif
>       Endif
>   Return True
> End
> '' ************ end class serial manager
>
> '' ************ begin of the from that implements serial class
> Public libreria As ClassSerial
>
> Public Sub Form_Open()
>
>   Dim dispositivo As SerialPort
>   libreria = New ClassSerial
> End
>
> Public Sub btn_Click()
>
>   libreria.usarpuerto("/dev/ttyS0")
>   '' here nothings happened on the device
>   '' but if i code all on the form class works
>
> End
>
> '' ************ end of form that implements the class
>
>
>
>
>
> Lenz McKAY Gerardo (PICCORO)
> http://qgqlochekone.blogspot.com
>
------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to