1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

Android Question Android 4.4.2 Raad Data ttyS0

Discussion in 'Android Questions' started by Jmendezc1971, May 11, 2019.

  1. Jmendezc1971

    Jmendezc1971 New Member

    a lot of time has passed. Did you solve this problem?
    I have a computer with android 4.4.2, this comes with 4 serial ports rs232 (I use ttyS6). It works very well only after running Serial_Port_Api (Console option). but if I do not run I can not read data by ttyS6. The code is:

    Sub Activity_Create(FirstTime As Boolean)
    ' '''coment THI NOT FUNTION : Result = Ph.Shell("stty -F /dev/ttyO0 115200 cs8 -parenb -cstopb -crtscts", Arh, StdOut, StdErr) ' set 115200,N,8,1 '' this no funtion
    sout = File.OpenOutput("","/dev/ttyS6",True) ' open serial output
    sinp = File.OpenInput("","/dev/ttyS6") ' open serial input

    Sub Timer2_Tick
    ''desde aqui serial

    Dim c, rxlen,vDes,vHas,i As Int
    timer2.Enabled = False

    rxlen = sinp.BytesAvailable ' check if bytes available on serial input Label5.Text = rxlen
    If rxlen > 0 Then
    sinp.ReadBytes(inpkt,0,rxlen) ' read pending characters For c = 0 To rxlen-1' build string from characters

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice