Smart evb kit does not have any files or directories which referenced by SC20 doucments

Hello.

I was trying to connect Uart serial communication via app.

However, I got the error like below.

2020-02-15 12:47:37.159 9179-9179/com.dlab.serialtest E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.dlab.serialtest, PID: 9179
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dlab.serialtest/com.dlab.serialtest.MainActivity}: java.lang.NullPointerException: Attempt to get length of null array
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2666)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2727)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1478)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6121)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
Caused by: java.lang.NullPointerException: Attempt to get length of null array
at android_serialport_api.SerialPortFinder$Driver.getDevices(SerialPortFinder.java:46)
at android_serialport_api.SerialPortFinder.getAllDevices(SerialPortFinder.java:92)
at com.dlab.serialtest.MainActivity.OpenSerialPort(MainActivity.kt:66)
at com.dlab.serialtest.MainActivity.onCreate(MainActivity.kt:57)
at android.app.Activity.performCreate(Activity.java:6723)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2619)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2727)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1478)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6121)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
2020-02-15 12:47:37.126 9179-9179/com.dlab.serialtest W/dlab.serialtest: type=1400 audit(0.0:9611): avc: denied { read } for name="/" dev=“tmpfs” ino=8206 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:device:s0 tclass=dir permissive=0

and this was my source code.

<SerialPortFinder.java>

File dev = new File ("/dev"); //43
File [] files = dev.listFiles(); //44
int i; //45
for (i=0; i<files.length; i++) { //46
if (files[i].getAbsolutePath().startsWith(mDeviceRoot)) { //47
Log.d(TAG, "Found new device: " + files[i]); //48
mDevices.add(files[i]); //49
}
}

It seemed like I cannot read /dev directory at all. That was why I got ‘java.lang.NullPointerException: Attempt to get length of null array’ error.

So, I tried to find /dev and saw all the files which are in /dev directory.

Unexpectedly, everything looked good and nothing was wrong like below.

msm8909:/dev # ls
properties input ppp subsys_modem tty37 tun
alarm ion psaux subsys_venus tty38 uhid
android_mbim kgsl-3d0 ptmx subsys_wcnss tty39 uinput
android_rndis_qc kmsg pts tgt tty4 uio0
android_serial_device log qce tty tty40 uio1
apr_apps2 loop-control qseecom tty0 tty41 uio2
ashmem media0 radio0 tty1 tty42 urandom
avtimer media1 ramdump_modem tty10 tty43 usb-ffs
battery_data media2 ramdump_smem tty11 tty44 usb_accessory
binder memcg ramdump_venus tty12 tty45 usb_ext_chg
block msm-rng ramdump_wcnss tty13 tty46 v4l-subdev0
ccid_bridge msm_aac random tty14 tty47 v4l-subdev1
ccid_bulk msm_aac_in rmnet_ctrl tty15 tty48 v4l-subdev10
ccid_ctrl msm_alac rmnet_ctrl1 tty16 tty49 v4l-subdev2
console msm_amrnb rmnet_ctrl2 tty17 tty5 v4l-subdev3
coresight-stm msm_amrnb_in rmnet_ctrl3 tty18 tty50 v4l-subdev4
coresight-tmc-etf msm_amrwb rtc0 tty19 tty51 v4l-subdev5
coresight-tmc-etr msm_amrwb_in smcmod tty2 tty52 v4l-subdev6
coresight-tmc-etr-stream msm_amrwbplus smd1 tty20 tty53 v4l-subdev7
cpu_dma_latency msm_ape smd11 tty21 tty54 v4l-subdev8
cpuctl msm_audio_cal smd2 tty22 tty55 v4l-subdev9
cpuset msm_evrc smd21 tty23 tty56 vcs
device-mapper msm_evrc_in smd22 tty24 tty57 vcs1
diag msm_mp3 smd3 tty25 tty58 vcsa
dpl_ctrl msm_multi_aac smd36 tty26 tty59 vcsa1
fd msm_qcelp smd5 tty27 tty6 video0
fscklogs msm_qcelp_in smd6 tty28 tty60 video1
full msm_rtac smd7 tty29 tty61 video2
fuse msm_sps smd8 tty3 tty62 video32
graphics msm_thermal_query smd_pkt_loopback tty30 tty63 video33
hw_random msm_wma smdcntl0 tty31 tty7 vm_bms
i2c-1 msm_wmapro smdcntl8 tty32 tty8 voice_svc
i2c-2 mtp_usb smem_log tty33 tty9 wcnss_ctrl
i2c-3 network_latency snd tty34 ttyHSL! wcnss_wlan
i2c-4 network_throughput socket tty35 ttyHSL0 xt_qtaguid
i2c-5 null stune tty36 ttyHSL1 zero

While I was seriously agonizing, I thought that I gotta test whether uart was ported or not first.

These are from SC20 docs.

1.1. API Files

quectel-core\ql-peripheral\ql-uart\include\ql_uart.h
quectel-core\ql-peripheral\ql-uart\lib\libql_uart.so

2.1. Demonstrate Steps

  1. cd /usr/bin/
  2. su # get root permission.
  3. ./uarttest /dev/ttyHSL1 115200N8N1

I cannot see any following directories and files in my adb shell.

I think my device got some wrong in the factory default setting.

Please check these out

Thank you!