Termux-app: Can termux access phone's bluetooth adapter?

Created on 10 Jan 2017  路  16Comments  路  Source: termux/termux-app

I recently started using termux and I can't seem to find a way to access my phone's bluetooth adapter. Is it even possible?

enhancement

Most helpful comment

A command could perhaps be added to the Termux:API add-on app.

Do you have an idea of how it would look like? Perhaps something like

termux-bluetooth-scan

to find out addresses, and

termux-bluetooth-connect <address>

to connect to a device, communicating over stdout&stdin?

All 16 comments

A command could perhaps be added to the Termux:API add-on app.

Do you have an idea of how it would look like? Perhaps something like

termux-bluetooth-scan

to find out addresses, and

termux-bluetooth-connect <address>

to connect to a device, communicating over stdout&stdin?

I don't think it would it be possible to use third party tools with that approach though.
Maybe native access like wifi?

Having a library that supports Bluetooth headers would be a great idea in my opinion, as e.g. pybluez needs bluetooth/bluetooth.h, and I'm using quite a lot of projects that depend on pybluez.

Is it a complex problem to add the ability to stream data from a Bluetooth device? Does Termux not have access to this device after installing? Just trying to understand the problem and possible solutions. Thanks.

I am able to see the serial port devices under the root drive "/dev/tty...", does this mean I can read data from these ports from the Termux shell or running app? We have NodeJS installed on Termux. Thanks.

Would it be possible to have a command to switch bluetooth on and off again? I personally don't need to be able to configure bluetooth from the command line.

@tomtom what's the purpose of switching it on and off?

Basic use case: have bluetooth turned off by default but turn it on when starting termux -- and maybe turn it off again when quitting termux.

@tomtom that makes sense.

I might be possible already today to turn on/off bluetooth using am, but would require root unless some permissions are added to the app I think. See https://stackoverflow.com/questions/37259260/android-enable-disable-bluetooth-via-command-line

A command could perhaps be added to the Termux:API add-on app.

Do you have an idea of how it would look like? Perhaps something like


to find out addresses, and

termux-bluetooth-connect <address>

to connect to a device, communicating over stdout&stdin?

I like this idea. What is needed to implement?

Maybe anybody can take code from https://github.com/StevenSalazarM/Termux-api-bluetooth and integrate? I try this package, but always has error - "unused DT entry: type 0xXX arg"

Maybe anybody can take code

No, we can't. At least because it will not work without corresponding API implementation on Termux:API application's side.

@xeffyr do you think about implement?

This implementation (in my opinion) lacks the bluetooth.h header one would expect from bluetooth support.

@martmists This is not "implementation" at all. Just a clone of https://github.com/termux/termux-api-package with few more scripts.

For those who seeking for implementation, it is in https://github.com/termux/termux-app/pull/517.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TheNickVendetta picture TheNickVendetta  路  4Comments

joakim-noah picture joakim-noah  路  5Comments

rjsteinert picture rjsteinert  路  4Comments

ngroup picture ngroup  路  5Comments

flipflop97 picture flipflop97  路  3Comments