Library "libc:6"
' int tcgetattr (int __fd, struct termios *__termios_p)
' Put the state of FD into *TERMIOS_P.
Private Extern tcgetattr(__fd As Integer, __termios_p As Pointer) As Integer
Public Sub Main()
Dim fl As File
Dim termios As Pointer
Dim baud As New Collection
Dim dev As String
With baud
.Add(0, "0")
.Add(600, "10")
.Add(1200, "11")
.Add(1800, "12")
.Add(2400, "13")
.Add(4800, "14")
.Add(9600, "15")
.Add(19200, "16")
.Add(38400, "17")
.Add(57600, "10001")
.Add(115200, "10002")
.Add(230400, "10003")
.Add(460800, "10004")
.Add(500000, "10005")
End With
' Elegimos un file-device:
dev = "/dev/tty"
' Hace falta ensertar la propia PASSWORD:
If Access(dev, gb.Read) = False Then Shell "echo MI-PASSWORD | sudo -S chmod 666 " & dev Wait
' Abre el file-device:
fl = Open dev For Read
' Asigna una area de memoria apuntada por el Puntero:
termios = Alloc(60)
tcgetattr(fl.Handle, termios)
Print "\n"; dev; ":\n"
Print "Baud rate de Entrada: ", baud[Int@(termios + 52)];; "baud"
Print "Baud rate de Salida: ", baud[Int@(termios + 56)];; "baud"
' Liberat memoriam in aeternum terminando.... :-D
Free(termios)
fl.Close
End
' int tcgetattr (int __fd, struct termios *__termios_p)
' Put the state of FD into *TERMIOS_P.
Private Extern tcgetattr(__fd As Integer, __termios_p As Pointer) As Integer
Public Sub Main()
Dim fl As File
Dim termios As Pointer
Dim baud As New Collection
Dim dev As String
With baud
.Add(0, "0")
.Add(600, "10")
.Add(1200, "11")
.Add(1800, "12")
.Add(2400, "13")
.Add(4800, "14")
.Add(9600, "15")
.Add(19200, "16")
.Add(38400, "17")
.Add(57600, "10001")
.Add(115200, "10002")
.Add(230400, "10003")
.Add(460800, "10004")
.Add(500000, "10005")
End With
' Elegimos un file-device:
dev = "/dev/tty"
' Hace falta ensertar la propia PASSWORD:
If Access(dev, gb.Read) = False Then Shell "echo MI-PASSWORD | sudo -S chmod 666 " & dev Wait
' Abre el file-device:
fl = Open dev For Read
' Asigna una area de memoria apuntada por el Puntero:
termios = Alloc(60)
tcgetattr(fl.Handle, termios)
Print "\n"; dev; ":\n"
Print "Baud rate de Entrada: ", baud[Int@(termios + 52)];; "baud"
Print "Baud rate de Salida: ", baud[Int@(termios + 56)];; "baud"
' Liberat memoriam in aeternum terminando.... :-D
Free(termios)
fl.Close
End