- 积分
- 45
贡献20
飞刀2 FD
注册时间2012-4-11
在线时间14 小时
扫一扫,手机访问本帖
|
今天使用开源项目(android-serialport-api)来实现控制串口,始终在开发板上报错(串口应用程序因异常关闭),使用logcat有如下打印:
10-31 12:59:18.250: I/PackageParser(83): android_serialport_api.sample: compat added android.permission.WRITE_EXTERNAL_STORAGE android.permission.READ_PHONE_STATE
10-31 12:59:18.260: I/PackageManager(83): Unpacking native libraries for /data/app/android_serialport_api.sample-1.apk
10-31 12:59:18.470: I/PackageManager(83): Linking native library dir for /data/app/android.serialport.sample-1.apk
10-31 13:39:21.790: I/ActivityManager(83): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=android.serialport.sample/.MainMenu } from pid 152
10-31 13:39:22.060: I/ActivityManager(83): Start proc android.serialport.sample for activity android.serialport.sample/.MainMenu: pid=426 uid=10039 gids={}
10-31 13:39:23.520: I/ActivityManager(83): Displayed android.serialport.sample/.MainMenu: +1s496ms
10-31 13:39:28.970: I/ActivityManager(83): Starting: Intent { cmp=android.serialport.sample/.SerialPortPreferences } from pid 426
10-31 13:39:29.120: W/ApplicationContext(426): Attempt to read preferences file /data/data/android.serialport.sample/shared_prefs/android.serialport.sample_preferences.xml without permission
10-31 13:39:29.150: D/SerialPort(426): Found new driver: /dev/s3c2410_serial
10-31 13:39:29.220: D/SerialPort(426): Found new device: /dev/s3c2410_serial0
10-31 13:39:29.220: D/SerialPort(426): Found new device: /dev/s3c2410_serial1
10-31 13:39:29.220: D/SerialPort(426): Found new device: /dev/s3c2410_serial2
10-31 13:39:29.220: D/SerialPort(426): Found new device: /dev/s3c2410_serial3
10-31 13:39:29.690: I/ActivityManager(83): Displayed android.serialport.sample/.SerialPortPreferences: +679ms
10-31 13:39:33.670: E/ApplicationContext(426): Couldn't rename file /data/data/android.serialport.sample/shared_prefs/android.serialport.sample_preferences.xml to backup file /data/data/android.serialport.sample/shared_prefs/android.serialport.sample_preferences.xml.bak
10-31 13:39:36.830: I/InputQueue-JNI(426): Sending finished signal for input channel '4082b788 android.serialport.sample/android.serialport.sample.SerialPortPreferences (client)' since it is being unregistered while an input message is still in progress.
10-31 13:39:36.990: E/ApplicationContext(426): Couldn't rename file /data/data/android.serialport.sample/shared_prefs/android.serialport.sample_preferences.xml to backup file /data/data/android.serialport.sample/shared_prefs/android.serialport.sample_preferences.xml.bak
10-31 13:39:49.040: E/ApplicationContext(426): Couldn't rename file /data/data/android.serialport.sample/shared_prefs/android.serialport.sample_preferences.xml to backup file /data/data/android.serialport.sample/shared_prefs/android.serialport.sample_preferences.xml.bak
10-31 13:39:51.700: I/ActivityManager(83): Starting: Intent { cmp=android.serialport.sample/.ConsoleActivity } from pid 426
10-31 13:39:51.820: W/dalvikvm(426): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Landroid/serialport/SerialPort;
10-31 13:39:51.850: E/AndroidRuntime(426): at android.serialport.sample.Application.getSerialPort(Application.java:46)
10-31 13:39:51.850: E/AndroidRuntime(426): at android.serialport.sample.SerialPortActivity.onCreate(SerialPortActivity.java:78)
10-31 13:39:51.850: E/AndroidRuntime(426): at android.serialport.sample.ConsoleActivity.onCreate(ConsoleActivity.java:33)
10-31 13:39:51.850: E/AndroidRuntime(426): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load serial_port: findLibrary returned null
10-31 13:39:51.850: E/AndroidRuntime(426): at android.serialport.SerialPort.<clinit>(SerialPort.java:83)
10-31 13:39:51.890: W/ActivityManager(83): Force finishing activity android.serialport.sample/.ConsoleActivity
10-31 13:39:51.890: W/ActivityManager(83): Force finishing activity android.serialport.sample/.MainMenu
10-31 13:39:52.410: W/ActivityManager(83): Activity pause timeout for HistoryRecord{4087ab60 android.serialport.sample/.ConsoleActivity}
10-31 13:39:54.240: I/ActivityManager(83): Process android.serialport.sample (pid 426) has died.
10-31 13:39:54.250: E/InputDispatcher(83): channel '4085bc08 android.serialport.sample/android.serialport.sample.MainMenu (server)' ~ Consumer closed input channel or an error occurred. events=0x8
10-31 13:39:54.250: E/InputDispatcher(83): channel '4085bc08 android.serialport.sample/android.serialport.sample.MainMenu (server)' ~ Channel is unrecoverably broken and will be disposed!
10-31 13:39:54.310: I/WindowManager(83): WIN DEATH: Window{4085bc08 android.serialport.sample/android.serialport.sample.MainMenu paused=true}
10-31 13:40:02.900: W/ActivityManager(83): Activity destroy timeout for HistoryRecord{407f82f8 android.serialport.sample/.MainMenu}
10-31 13:40:02.950: W/ActivityManager(83): Activity destroy timeout for HistoryRecord{4087ab60 android.serialport.sample/.ConsoleActivity}
请版主指导一下是什么原因造成了不能使用,同时还有几个问题问一下:
1、我使用pm命令来安装我的.apk,安装文件的位置在什么地方,那我在终端使用什么命令来卸载这个程序?
2、在ok6410上我们看到几个串口号同时存在,请问一下版主ok6410的A板是用的哪一个口?
这些问题很繁琐,还望版主谅解与解答,谢谢! |
|