Bluetooth Serial in not working

126 views
Skip to first unread message

Syed Munawer Hassan

unread,
Feb 10, 2023, 9:40:47 PM2/10/23
to DroidScript
Bluetooth serial in not able to send and receive messages is there any problem with DS ?

Dave

unread,
Feb 11, 2023, 2:45:48 PM2/11/23
to DroidScript
We need more info.

- Is it BLE or classic Bluetooth?
- Is it Android 10,11,12 ?
- What type of DS app is this?

Dave

unread,
Feb 11, 2023, 2:46:14 PM2/11/23
to DroidScript
Also what version of DS are you using?

pta khi

unread,
Feb 13, 2023, 9:24:51 AM2/13/23
to DroidScript
I am working on ELM327 OBDII car scanner i think it is using classic BT i have android version 2 and using latest. DS version 
BT device is paired with my phone and i am can send commands to BT device and getting response from it I am also able to send and receive messages between two android phones ELM32 works on hex input command i.e. 010c provide hex output which then can be decoded to get actual speed   

AlexIoT

unread,
Feb 22, 2023, 11:27:15 AM2/22/23
to DroidScript
HI,
I have same problem. Now with Android 12 on cell phone, Serial Bluetooth isn't working anymore. 
I'm using DS 2.57. 
With android 12, bluetoorh device list not working...

CODE:
    if( !app.IsBluetoothEnabled() )
        app.SetBluetoothEnabled( true );
    while( !app.IsBluetoothOn() ) app.Wait(.4);
    app.HideProgress();
    bt = app.CreateBluetoothSerial();
    bt.SetOnConnect( bt_OnConnect );
    bt.SetOnReceive( bt_OnReceive );
    bt.SetSplitMode( "End", "\n" );
    bt.Listen( true );  
    lst = app.CreateBluetoothList();
    lst.SetOnTouch(lst_OnTouch)

In last android release, lst works fine...
Have some workaround?
Regards
Alex

Right2TheV0id

unread,
Feb 22, 2023, 12:15:30 PM2/22/23
to DroidScript
Alex I tested your code on Android 12 and it made DS crash when attempting app.CreateBluetoothList()
Looking in the logcat I have the following information:

DS-Uncaught Exception:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.smartphoneremote.androidscriptfree/com.smartphoneremote.ioioscript.DeviceListActivity}: java.lang.SecurityException: Need android.permission.BLUETOOTH_CONNECT permission for android.content.AttributionSource@ce27c18c: AdapterService getBondedDevices

I presume this is linked to this issue:

Dave

unread,
Feb 22, 2023, 1:40:30 PM2/22/23
to DroidScript
Latest beta version (which seems pretty stable) has that permission added.

Reply all
Reply to author
Forward
0 new messages