I am currently making an Android utility related to Bluetooth, and I need to change the device discovery range of my device..
Is there a way for me to do so? I am currently looking into using the TPL to do this, but I am not so sure..
Either an Android application or changes in the kernel are possible.
Thank you very much.. :)
You seem to be on the right track. To reduce the range you would need to reduce the Tx power while searching and this should be possible through the HCI command hci_write_inquiry_transmit_power_level (external/bluetooth/bluez/lib/bluetooth/hci_lib.h)
You need to figure out how this is done in Bluez (if it is being used) and then extend it to use in your application.
Related
So, what I want is just to scan the environment and see if any packages are sent without pairing or connecting to a device. Just a general scan of bluetooth in the air and being able to see some of what comes up, like packages exchanged and maybe some information of them. Everything I've read so far is about pairing or connecting first.
Thanks in advance!
The question is old, but since nobody gave an answer I try to fill the gap.
Bluetooth is, because of its technical specifications (frequency hopping etc.), difficult to sniff. A monitor mode like in WiFi doesn't exist out of the box. You would need to scan all Bluetooth channels at the same time. And then there is the challenge that since you managed to detect something, you need to know the next hop (to which channel the devices jump next). There are commercial hardware that can do that. Also some open source projects come up like Ubertooth, but with less capabilities.
You could try to purchase an Ubertooth and play with it.
I am new to ANdroid development (but have worked on linux)..We can tune TCP parameters(window size..etc) to get better performance on desktop's either windows or linux.
Was wondering can we do the same on andriod based smart phones? ...i was informed that only on root access devices we can do it...how about non-root access devices?
This for all TCP based connections initiated from android device and not specific to a socket.
I was solution something similar to what we do desktop/laptop's ....i.e configure the TCP parameters in the OS example increasing windo size. so that any further connections started/initiated from the box would use that as the default value...
Thx in advance
This sounds like you aren't working with an app, you want the whole system(2g/3g/4g/wifi etc.) to move faster, correct?
In that case you must be rooted and the solution to your question is to flash a custom kernel that supports those options in its network stack.
With a custom kernel you can easily set the TCP congestion algorithm to your preference.
There are Socket.setSendBufferSize() and Socket.setReceiveBufferSize(). I don't see any reason why root privileges should be required.
I'm studying Bluetooth protocol and implementing a position system reading RSSI in dBm from some devices. System will be implemented with 3 fix stations with an known latitude and longitude and a mobile station. Positioning will be done on mobile station with the power received in dBm from each fix station and the typically position algorithm.
In order to increase the efficiency of the system, some parameters from Bluetooth devices needs to be changed. This parameters could be:
Scan time on fix stations to decrease time on response to Inquires.
Inquires access codes to get answered to inquires just from selected devices(our 3 fix stations)
Some others.
There are some scenarios that can be used to do that depending on used tecnologies(some of them are limited):
Fix stations with Linux OS(no problem to modify parameters), mobile station with Android (seems to have just typically functions on its Bluetooth library but bluetooth setting are difficult or impossible to be modified).
See: http://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html
All stations running Linux OS, and C++ on mobile station(seems to be easy to run from shell scripts hcitool for fix stations modifying our settings, but it seems difficult to implement source code on C++ to get RSSI with our need values on dBm of links to fix stations on mobile station).
The nasty way. All stations running Linux OS and shell scripts, on mobile station running under shell scripts parsing values from RSSI from output redirection of hcidump after lunching inquires.
It seems to be very difficult to find useful info related to this scenario. Maybe some one of you can help to choose best scenario and to describe how should be implemented.
(Sorry if something it's not explained in a better way.. my English is terrible..)
Thanks.
I'm sorry, I didn't follow everything you wrote, but I think the first step is to get down to the HCI layer on the fixed stations. That is fairly straight-forward to accomplish and gives you a fair bit of control.
As you mentioned, hcitool is very useful, but it doesn't matter what tool or language you use. You can access HCI commands from any language.
For example, I did something like this with Voyage Linux on an ALIX box. Voyage is debian based so now problem to load BlueZ, PyBluez, and Python. Python made it easy to quickly prototype a solution which you can convert to C++ later if need be. (More here.)
But that's just an example - use whatever stack you are comfortable with as long as you can get at the HCI layer. (Getting past the HCI layer requires you to work with a specific chipset and load code directly into the Bluetooth chipset.)
On the mobile device you might be severely limited: if you are trying for potential real world implementation. If this is just for the lab, you should get rooted Android devices that use the standard Bluez stack and then, like on the fixed devices, you can get at the HCI interface. Android is, after all, just Linux so you can do what you want if you have root.
Can anyone tell me how can I cause a busy phone state in Android. I'm developing an application about contacts. Help me please, thanks!
You can't.
Modem is the one that is reporting the states, and you can't override this state from Android side.
Even more, modem is always closed proprietary source and is located on a separate silicon (but it might be placed in the same package).
The simplest way to implement a blacklist is to drop the calls. This is what most of the available applications on the market are doing.
Some operator supports blacklisting on their side, in this case you need to know what AT commands are used to add/remove blacklisted numbers.
Cyanogen mod is open source, and they have implemented a blacklist on Android side. If you need a quick reference - have a look there.
I have a quick question about trying to develop a new app on Android. So as the title says, I'm to use Bluetooth to link up two Bluetooth capable devices and when they are at a specific maximum range (5-20 ft), have the phone play some sort of alarm.
I do not however, own an Android Phone, but I am instead developing it on the Emulator on my computer. Earlier, I discovered that the emu is not Bluetooth capable nor does it have any form of sounds.
Is there any way of continuing on besides getting a real phone? Any helpful workarounds are welcome
regarding the emulator capabilities : you'd better buy a device soon ... duplicate?
And regarding the alarm triggering i'm a bit curious : on what are you relying ? SNR ? is there an easy way to access this kind of data on Android ? (only had a glance at the reference pages)