Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can termux access phone's bluetooth adapter? #235

Open
ghost opened this issue Jan 10, 2017 · 19 comments
Open

Can termux access phone's bluetooth adapter? #235

ghost opened this issue Jan 10, 2017 · 19 comments

Comments

@ghost
Copy link

ghost commented Jan 10, 2017

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?

@fornwall
Copy link
Member

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?

@ghost
Copy link
Author

ghost commented Jan 10, 2017

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

@Martmists-GH
Copy link

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.

@wayofthefuture
Copy link

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.

@wayofthefuture
Copy link

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.

@tomtom
Copy link

tomtom commented Nov 20, 2017

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.

@Grimler91
Copy link
Member

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

@tomtom
Copy link

tomtom commented Nov 20, 2017

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.

@Grimler91
Copy link
Member

@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

@junfengzh
Copy link

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 like this idea. What is needed to implement?

@blackprojects
Copy link

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"

@ghost

This comment has been minimized.

@blackprojects

This comment has been minimized.

@Martmists-GH

This comment has been minimized.

@ghost

This comment has been minimized.

@ghost

This comment has been minimized.

@RodrigoTomeES
Copy link

Hi,

There is any update about this feature?

Thanks!

@bruhMomentFixer
Copy link

hello there, im trying to write a c program that uses <bluetooth/bluetooth.h>, <bluetooth/hci.h> and <bluetooth/hci_lib.h> includes (in Termux). I somehow managed to install the blueZ library straight from google git source files and now I am able to compile without errors my c program. The function hci_get_route(NULL); returns negative value which means there is no local bluetooth device. When I execute sudo hcitool dev it shows no device. Is the fact that the c function is not finding a bt device linked in some way to the fact that the command is not showing devices? And if it is like that, what can I do to fix it?

(PD: srry in advance if this is not the correct conversation to post this request)

@Munchax10
Copy link

I made a pull request for this, please merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests