Android Question Connect to a Remote Shutter

Humberto

Active Member
Licensed User
Longtime User
Hi
Iused a bluetooth sample to connect to a remote shutter.

I could find a device and after choosing this option to connect this error occurs.


** Activity (main) Resume **
State: 12
AB Shutter 3:DF:84:51:0B:95:04
connected: false
java.io.IOException: read failed, socket might closed or timeout, read ret: -1
AB Shutter 3:DF:84:51:0B:95:04
connected: false
java.io.IOException: read failed, socket might closed or timeout, read ret: -1
** Service (widgetservice) Start **

It fails to open the serial channel
 
Last edited:

Humberto

Active Member
Licensed User
Longtime User
Upvote 0

Humberto

Active Member
Licensed User
Longtime User
I can not understand

Window{43454bc8 u0 Keyguard}mOrientationRequetedFromKeyguard=false
id=2583 createSurf (1x1),1 flag=4, Uoast
Window{43454bc8 u0 Keyguard}mOrientationRequetedFromKeyguard=false
0.1 8.9 3.6
[api] acquire WakeLock flags=0x2000000a tag=WindowManager uid=1000 pid=2357
id=2582 Removed nain (6/8)
id=2582 Removed nain (-2/8)
ContainerPolicy Service is not yet ready!!!
ContainerId: 0
log() is called by non admin
sendUserActionEvent() mView == null
Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@437e2300 attribute=null, token = android.os.BinderProxy@43904f80
db_query_create: id EnforceMasterRole :: key KEY_BDADDR, value df:84:51:0b:95:04
db_query_add_key: key KEY_LMP_MFCT, value 148
db_query_add_key: key KEY_LMP_VER, value 4:8754
db_query_add_key: key KEY_DIR_ALL, value *
db_query_execute: result 1
remote version info [df:84:51:0b:95:04]: 4, 94, 2232
aclStateChangeCallback: State:Connected to Device:DF:84:51:0B:95:04
Received android.bluetooth.device.action.ACL_CONNECTED deviceClass = 1344
Remote Device name is: AB Shutter 3
id=2581 Removed nain (5/7)
id=2581 Removed nain (-2/7)
GC_CONCURRENT freed 402K, 15% free 9769K/11392K, paused 7ms+2ms, total 61ms
java.io.IOException: read failed, socket might closed or timeout, read ret: -1
at android.bluetooth.BluetoothSocket.readAll(BluetoothSocket.java:1016)
at android.bluetooth.BluetoothSocket.readInt(BluetoothSocket.java:1036)
at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:654)
at anywheresoftware.b4a.objects.Serial$1.run(Serial.java:157)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390)
at java.util.concurrent.FutureTask.run(FutureTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:841)
connected: false
java.io.IOException: read failed, socket might closed or timeout, read ret: -1
Refusing to reopen boot DEX '/system/framework/commonimsinterface.jar'
SIOP:: AP = 330 (read only)
onReceive
btif_config_save_file(L181): in file name:/data/misc/bluedroid/bt_config.new
Could not find method android.app.ActivityManager.isLowRamDevice, referenced from method com.google.android.apps.gsa.shared.util.cj.bQ
VFY: unable to resolve virtual method 300: Landroid/app/ActivityManager;.isLowRamDevice ()Z
VFY: replacing opcode 0x6e at 0x000f
Process com.android.settings (pid 17481) (adj 9) has died.
Process com.eclipsim.gpsstatus2 (pid 17062) (adj 13) has died.
Process br.org.sidi.aplicacoesbrasil.widget (pid 17467) (adj 11) has died.
onReceive(context, Intent { act=android.bluetooth.device.action.ACL_CONNECTED flg=0x8000010 cmp=com.google.android.googlequicksearchbox/com.google.android.search.core.service.BluetoothConnectionReceiver (has extras) }, [BluetoothDevice: address=DF:84:51:0B:95:04, alias=null, name=AB Shutter 3, majorDeviceClass=1280, deviceClass=1344]
DexOpt: couldn't find static field Landroid/os/Build;.SUPPORTED_ABIS
 
Upvote 0

Humberto

Active Member
Licensed User
Longtime User
Works

After paring the remote control acts as a keyboard.
One key send "Enter" and other one send volume up

No need the serial command

Now how the get this keys in a service ?

I can know the difference between local volume up and bluetooth volume up ?

Thanks
 
Upvote 0

Humberto

Active Member
Licensed User
Longtime User
I will use this remote to fire a app and must detect in a service.

I can catch already the volume in a service but I must distinguish the key pressed from cellphone or remote shutter.
 
Upvote 0
Top