Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

MultiDeviceSearch API will cause SQLiteDatabase error

Rank

Total Posts: 1

Joined 2015-10-16

PM

Hi,

We write an application to do ANT+ Heart Rate connection stress test.

We use MultiDeviceSearch API to search device, sometimes that will cause SQLite error.

E/antradio( 661): query version: hw: 0x8a12!
E/SQLiteLog( 1698): (14) os_unix.c:30046: (24) open(/data/data/com.dsi.ant.plugins.antplus/databases/saved_devices.db-journal) -
E/SQLiteLog( 1698): (14) os_unix.c:30046: (24) open(/data/data/com.dsi.ant.plugins.antplus/databases/saved_devices.db-journal) -
E/SQLiteDatabase( 1698): Failed to open database '/data/data/com.dsi.ant.plugins.antplus/databases/saved_devices.db'.
E/SQLiteDatabase( 1698): android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (code 14): , while compiling: PRAGMA journal_mode
E/SQLiteDatabase( 1698): at com.dsi.ant.plugins.antplus.utility.db.SavedDeviceDb.getDeviceInfoByChanDevId(SavedDeviceDb.java:361)
E/SQLiteDatabase( 1698): at com.dsi.ant.plugins.antplus.multisearch.ClientInterface.getInfo(ClientInterface.java:382)
E/SQLiteDatabase( 1698): at com.dsi.ant.plugins.antplus.multisearch.ClientInterface.getResult(ClientInterface.java:339)
E/SQLiteDatabase( 1698): at com.dsi.ant.plugins.antplus.multisearch.ClientInterface.onScanResult(ClientInterface.java:240)
E/SQLiteDatabase( 1698): at com.dsi.ant.plugins.antplus.multisearch.ScanController$DiscoveryResultHandler.onDeviceFound(ScanController.java:248)
E/SQLiteDatabase( 1698): at com.dsi.ant.plugins.antplus.utility.search.StandardDiscoverySearch$ResultProcessor$2.run(StandardDiscoverySearch.java:76)
E/SQLiteOpenHelper( 1698): android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (code 14): , while compiling: PRAGMA journal_mode
E/SQLiteOpenHelper( 1698): at com.dsi.ant.plugins.antplus.utility.db.SavedDeviceDb.getDeviceInfoByChanDevId(SavedDeviceDb.java:361)
E/SQLiteOpenHelper( 1698): at com.dsi.ant.plugins.antplus.multisearch.ClientInterface.getInfo(ClientInterface.java:382)
E/SQLiteOpenHelper( 1698): at com.dsi.ant.plugins.antplus.multisearch.ClientInterface.getResult(ClientInterface.java:339)
E/SQLiteOpenHelper( 1698): at com.dsi.ant.plugins.antplus.multisearch.ClientInterface.onScanResult(ClientInterface.java:240)
E/SQLiteOpenHelper( 1698): at com.dsi.ant.plugins.antplus.multisearch.ScanController$DiscoveryResultHandler.onDeviceFound(ScanController.java:248)
E/SQLiteOpenHelper( 1698): at com.dsi.ant.plugins.antplus.utility.search.StandardDiscoverySearch$ResultProcessor$2.run(StandardDiscoverySearch.java:76)
E/SQLiteLog( 1698): (14) os_unix.c:30046: (24) open(/data/data/com.dsi.ant.plugins.antplus/databases/saved_devices.db-journal) -
E/AndroidRuntime( 1698): Process: com.dsi.ant.plugins.antplus, PID: 1698
E/AndroidRuntime( 1698): at com.dsi.ant.plugins.antplus.utility.db.SavedDeviceDb.getDeviceInfoByChanDevId(SavedDeviceDb.java:361)
E/AndroidRuntime( 1698): at com.dsi.ant.plugins.antplus.multisearch.ClientInterface.getInfo(ClientInterface.java:382)
E/AndroidRuntime( 1698): at com.dsi.ant.plugins.antplus.multisearch.ClientInterface.getResult(ClientInterface.java:339)
E/AndroidRuntime( 1698): at com.dsi.ant.plugins.antplus.multisearch.ClientInterface.onScanResult(ClientInterface.java:240)
E/AndroidRuntime( 1698): at com.dsi.ant.plugins.antplus.multisearch.ScanController$DiscoveryResultHandler.onDeviceFound(ScanController.java:248)
E/AndroidRuntime( 1698): at com.dsi.ant.plugins.antplus.utility.search.StandardDiscoverySearch$ResultProcessor$2.run(StandardDiscoverySearch.java:76)

How can to resolve this issue?

Thanks,
Alex.      
Rank

Total Posts: 4

Joined 2015-11-23

PM

Hi all,

OS: Android L
ANT+ Plugins Service: 3.5.0

i monitor com.dsi.ant.plusings.antplus process:

$ adb shell ls -a /proc/"process's pid"/fd

When my android use MultiDeivceSearch to search HeartRate sensor,

i find a sensor, the folder "fd" will be increase 3 inode.

when i close search, these inode will be release.

When i connect to HeartRate sensor, the fd will incress 3 inode,

but i release hrpcc, these inode no be released,
=================================================================================
like it:
lrwx------ u0_a25 u0_a25 2010-01-06 22:25 0 -> /dev/null
lrwx------ u0_a25 u0_a25 2010-01-06 22:25 1 -> /dev/null
lr-x------ u0_a25 u0_a25 2010-01-06 22:25 10 -> /system/framework/mediatek-res/mediatek-res.apk
lr-x------ u0_a25 u0_a25 2010-01-06 22:25 11 -> pipe:[332592]
lr-x------ u0_a25 u0_a25 2010-01-06 22:25 12 -> /dev/alarm
l-wx------ u0_a25 u0_a25 2010-01-06 22:25 13 -> pipe:[332592]
l-wx------ u0_a25 u0_a25 2010-01-06 22:25 14 -> /dev/cpuctl/tasks
l-wx------ u0_a25 u0_a25 2010-01-06 22:25 15 -> /dev/cpuctl/bg_non_interactive/tasks
lrwx------ u0_a25 u0_a25 2010-01-06 22:25 16 -> socket:[392835]
lrwx------ u0_a25 u0_a25 2010-01-06 22:25 17 -> /dev/binder
lr-x------ u0_a25 u0_a25 2010-01-06 22:25 18 -> pipe:[392838]
l-wx------ u0_a25 u0_a25 2010-01-06 22:25 19 -> pipe:[392838]
lrwx------ u0_a25 u0_a25 2010-01-06 22:25 2 -> /dev/null
lrwx------ u0_a25 u0_a25 2010-01-06 22:25 20 -> anon_inode:[eventpoll]
lr-x------ u0_a25 u0_a25 2010-01-06 22:25 21 -> /system/app/ANTPlusPlugins/ANTPlusPlugins.apk
lr-x------ u0_a25 u0_a25 2010-01-06 22:25 22 -> pipe:[393165]
l-wx------ u0_a25 u0_a25 2010-01-06 22:25 23 -> pipe:[393165]
lrwx------ u0_a25 u0_a25 2010-01-06 22:25 24 -> anon_inode:[eventpoll]
lr-x------ u0_a25 u0_a25 2010-01-06 22:25 25 -> pipe:[393167]
l-wx------ u0_a25 u0_a25 2010-01-06 22:25 26 -> pipe:[393167]
lrwx------ u0_a25 u0_a25 2010-01-06 22:25 27 -> anon_inode:[eventpoll]
lr-x------ u0_a25 u0_a25 2010-01-06 22:25 28 -> pipe:[393412]
l-wx------ u0_a25 u0_a25 2010-01-06 22:25 29 -> pipe:[393412]
lrwx------ u0_a25 u0_a25 2010-01-06 22:25 3 -> socket:[4467]
lrwx------ u0_a25 u0_a25 2010-01-06 22:25 30 -> anon_inode:[eventpoll]
lr-x------ u0_a25 u0_a25 2010-01-06 22:25 31 -> pipe:[394253]
l-wx------ u0_a25 u0_a25 2010-01-06 22:25 32 -> pipe:[394253]
lrwx------ u0_a25 u0_a25 2010-01-06 22:25 33 -> anon_inode:[eventpoll]

l-wx------ u0_a25 u0_a25 2010-01-06 22:25 4 -> /sys/kernel/debug/tracing/trace_marker
lrwx------ u0_a25 u0_a25 2010-01-06 22:25 5 -> socket:[4593]
lr-x------ u0_a25 u0_a25 2010-01-06 22:25 6 -> /system/framework/framework-res.apk
lr-x------ u0_a25 u0_a25 2010-01-06 22:25 7 -> /system/framework/core-libart.jar
lr-x------ u0_a25 u0_a25 2010-01-06 22:25 8 -> /dev/__properties__
lrwx------ u0_a25 u0_a25 2010-01-06 22:25 9 -> socket:[332591]
=================================================================================

When the inode's number over 1024, the "com.dsi.ant.plugins.antplus" will be crash, so SQLiteDatabase cannot open file.

My question is:
1. Is "com.dsi.ant.plugins.antplus" not close some file, when i release hrpcc?
2. How to solved it?

More information:
i try ANT+ Plugins Service: 3.6.0, also had same issue.

Thanks
Henry