B4J Question Call a shell command in interactive mode

Alessandra Pellegri

Active Member
Licensed User
Longtime User
I would like to open something like bluetoothctl and interact with it.
For example:
B4X:
[bluetoothctl] menu gatt
[bluetoothctl] register-service 0xFFFF # (Choose yes when asked if primary service)
[NEW] Primary Service
        /org/bluez/app/service0x10e51e0
        0xFFFF
        Unknown
[/org/bluez/app/service0x10e51e0] Primary (yes/no): yes
[bluetoothctl] register-characteristic 0xAAAA read       # (Select a value of 1 when prompted)
[NEW] Characteristic
        /org/bluez/app/service0x10e51e0/chrc0x10e5688
        0xAAAA
        Unknown
[/org/bluez/app/service0x10e51e0/chrc0x10e5688] Enter value: 1
[bluetoothctl] register-application # (This commits the services/characteristics and registers the profile)
[bluetoothctl] back
[bluetoothctl] advertise on

So I'd need to generate an event everytime the shell writes something.

Is it possible ?

Thank you
 
Top