Trying to retrieve previously paired bluetooth device in IOS app will not respond with failure if device is off |
Two points you need to know about retrievePeripherals: and
connectPeripheral:
1.) retrievePeripherals: attempts to retrieve the CBPeripheral object
associated with the uuid you supply. Even if the ble device is off (or on
the other side of the country) retrievePeripherals: will still return an
instance of CBPeripheral that you can call connectPeripheral: on. This is
done intentionally so that you can issue a call to a peripheral that is not
even around and still automatically connect to it when it comes back into
range. It basically creates a marker inside the system bluetooth so that
when the device is actually seen, it will know it should connect to it.
2.)connectPeripheral: will not time out unless the communication channel is
broken with the actual device. If the iOS device has not s
|
how to record the voice from bluetooth device mic and play in device speaker |
yes above concept is correct and very helpful for me(but there is little
bit addition or modification done) but routing to
speaker(device-speaker)required new session to create
for taking input from Bluetooth we have create session like
//// create and set up the audio session
AVAudioSession* audioSession = [AVAudioSession sharedInstance];
[audioSession setDelegate:self];
[audioSession setCategory: AVAudioSessionCategoryRecord error: nil];
[audioSession setActive: YES error: nil];
// set up for bluetooth microphone input
UInt32 allowBluetoothInput = 1;
AudioSessionSetProperty
(kAudioSessionProperty_OverrideCategoryEnableBluetoothInput,sizeof
(allowBluetoothInput),&allowBluetoothInput);
and when ever u want to paly the sound not in bluetoothdevice speaker at
that time override
|
How to connect Android device to an iOS device over BLE (Bluetooth Low Energy) |
I've written a simple working example, well relatively simple, and included
it open-source on Github: https://github.com/GitGarage. So far it has only
been tested with an Android Nexus 9 and an iPhone 5s, but I presume it
would also work with a Nexus 6 and various iPhone types. So far it is set
up explicitly to communicate between one Android and one iPhone, but I
presume it is tweakable to do much more.
|
Isolating obd scan tool from other bluetooth devices during bluetooth device search |
Try what @Erik Smekens suggested. You can connect to OBD-2 without pairing
via insecure RFCOMM.
|
Bluetooth connectivity using IOS device |
There are three frameworks available in iOS using which you can develop the
bluetooth applications:
GameKit: This is the publicly available framework . But using this you can
only establish and communicate between only two iOS device. So this
framework having its own limitations .
BluetoothManager: This is private framework .I used this framework to
discover the non iOS devices . I have established the connection also . But
cant able to do the data exchange. I think it is still under development.
For the reference you can refer this link
CoreBluetooth: This is also the public framework. This can only discover
BLE enabled devices . I have successfully used this to transfer the data
between the BLE enabled devices.
|
Connect to a bluetooth device? |
You can try adding bluetooth using that Mac Address. Go to bluetooth and
look for connect to device (Manual or something) and enter the address.
Trying switching reboot your device as well as phone.
|
Connecting to a bluetooth device programatically |
There might be a timing problem, onCreate and onResume are called in very
short order. In the case that the BT is not enabled the code in onResume
might be called before the BT service is online.
My advice: Try to delay the initiation a few seconds by putting the code in
a Runnable.
private Handler mHandler = new Handler();
public void onCreate() {
[...]
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
btAdapter.enable();
// Set up a pointer to the remote node using it's address.
BluetoothDevice device = btAdapter.getRemoteDevice(address);
// Two things are needed to make a connection:
// A MAC address, which we got above.
// A Service ID or UUID. In this
|
Is there API for iphone app to change it's own device bluetooth name? |
I think. NO there is no public API for this. There may well be some
undocumented private method or with some Jail Broken devices ,But as this
is not something you put with your iOS App On App Store
|
iOS: can I pair more than one bluetooth audio device at once? |
The bluetooth specification allows up to seven devices to connect, but it's
not straightforward, as it is dependent on the type of device and the
service profile it provides. For example, you can have a bluetooth
keyboard, mouse, and headset connected at the same time, and an A2DP
(Advanced Audio Distribution Profile) device to stream music, but you can't
have two devices that performing the same service profile connected at the
same time. check the link below for more info.
http://en.wikipedia.org/wiki/Bluetooth
|
How to Record Audio via Bluetooth device? |
manifest file
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission
android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.BROADCAST_STICKY"/>
code
am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
registerReceiver(new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
int state = intent.getIntExtra(AudioManager.EXTRA_SCO_AUDIO_STATE,
-1);
Log.d(TAG, "Audio SCO state: " + state);
if (AudioManager.SCO_AUDIO_STATE_CONNECTED == state) {
/*
* Now the connection has been established to the bluetooth
device.
* Record audio or whatever (on another thread).With AudioR
|
Bluetooth not sending file to other device |
Maybe you can try another solution with BufferedWriter and BufferedReader.
Here is a snipped code:
BluetoothDevice mmDevice;
Set<BluetoothDevice> mBluetoothAdapter;
BluetoothAdapter bAdapter = BluetoothAdapter
.getDefaultAdapter();
mBluetoothAdapter = bAdapter.getBondedDevices();
for (BluetoothDevice bc : mBluetoothAdapter) {
if (bc.getName().indexOf("name_of_bluetoothdevide") != -1)
{
UUID uuid = UUID
.fromString("00001101-0000-1000-8000-00805F9B34FB"); // Standard
// SerialPortService
|
Bluetooth Low Energy as an iOS device requirement? |
You'll need to add the bluetooth-le option to your
UIRequiredDeviceCapabilities key in your info.plist file.
|
How to check if a bluetooth device is paired |
Here is a complete description of the problem, with the correct answer to
solve it:
Action to know if there is any bluetooth paired device
|
Action to know if there is any bluetooth paired device |
If someone is interested, the way that I get solved this, is this:
To check if there is any device conected to perform an action, I've used
methods based on the BluetoothChat example app.
public class Transmission {
....
/**
* Return the current connection state.
*/
public synchronized int getState() {
return GlobalVar.mState;
}
In this class, I only declared some variables:
public class GlobalVar {
....
public static int mState;
// Constants that indicate the current connection state
public static final int STATE_NONE = 0; // we're doing nothing
public static final int STATE_LISTEN = 1; // now listening for
incoming connections
public static final int STATE_CONNECTING = 2; // now initiating an
outgoing connection
|
playing a song on another device using bluetooth |
GameKit is meant for inter-device games. For this, you'd probably want to
look at CBPeripheralManager or CBCentralManager depending on the device
you're interacting with. It's lower level, so you'll have to do more work
to set up the connection, but there's tons of tutorials and sample code to
help you out.
|
Scan a 4.0 Bluetooth device it's not working |
Bluetooth 4.0 (or BLE) is not supported in Android at the moment. It will
be supported in Android 4.3 (API level 18). Among other places, you can
read more about it here and here. Several Android devices has already been
certified with Bluetooth 4.0 support, but it won't work before the update
is released.
That said, according to this post some devices does support it, but they
need custom BLE libraries that the companies have developed.
|
iOS: Detect when bluetooth device disconnects when app is not running |
You might want to take a look here for background modes. Will any of those
work for you? There are more in ios 7. Some background modes may be
compatible with ios 6 as well though. Are you using Core Bluetooth? Theres
a background mode for that
|
Is it possible to get notified in the application when bluetooth connects to my device? |
Yes you can get notified when a new device is connected using Broadcast
receiver.
Please refer to the code below.
BroadcastReceiver btReceive=new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
BluetoothDevice device =
intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
if (BluetoothDevice.ACTION_FOUND.equals(action)) {
//the device is found
}
}
};
|
iOS How can I get the battery level of the connected bluetooth device |
As I know, For classic BT, only devices contain headset profile can.
check this
https://developer.apple.com/hardwaredrivers/BluetoothDesignGuidelines.pdf
|
how to set up a bluetooth connection between windows pc and android device |
Visit these links. Hope these help
http://www.forward.com.au/pfod/serialBluetoothConnections/index.html
http://blackmarketserver.com/blog/2010/11/23/bluetooth-file-transfer-between-android-2-2-and-windows-7
It is a possible duplicate of this question.
Please have a look
access of files on windows pc from android device, bluetooth?
|
connect to device with Bluetooth address on String |
First you will have to findout what profile the bluetooth device supports,
For instance it could be a medical device that could use HDP profile or it
could be using a simple RS232 over bluetooth. It is important to understand
how the bluetooth connection is established for various profiles before you
start writing code.
Here is a good link to start with. Android SDK also comes withe some basic
examples that you can start with.
http://developer.android.com/guide/topics/connectivity/bluetooth.html
EDIT:
If your device is paired successfully,you will see the MAC address in the
list of paired devices. For instance, you can do this to find the device
that matches your device's MAC address :
Set<BluetoothDevice> pairedDevices = mBluetoothAdapter
.getBondedDevices
|
Pairing two Android devices to a third device using Bluetooth |
try calling cancelDiscovery() on your BluetoothAdapter before creating the
socket connection. This might solve your problem on the
java.io.IOException: Service discovery failed that you are getting.
|
Connect to a bluetooth device programmatically objective c |
Yes if you use Core Bluetooth to discover all devices that are
discoverable. Then if it matches a name etc then connect to it.
I made a wrapper around Apple's Core Bluetooth framework to make it easier
to do these things.
https://github.com/steprescott/SCPCoreBluetoothManager
|
auto connect bluetooth to last connected device |
Wrote this using gEdit since, I don't have eclipse atm. So if there is some
coding error please don't hesitate to edit this. For ease of explanation I
haven't used SharedPreferences here, if you want to use don't hesitate it.
//Assuming that you have device address and is connected
private String partnerDevAdd="00:11:22:AA:BB:CC";
private boolean isConnected=true;
IntentFilter filter = new IntentFilter();
filter.addAction(BluetoothDevice.ACTION_FOUND);
filter.addAction(BluetoothDevice.ACTION_ACL_CONNECTED);
filter.addAction(BluetoothDevice.ACTION_ACL_DISCONNECTED);
registerReceiver(mReceiver, filter);
// Create a BroadcastReceiver for bluetooth related checks
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent)
|
How to pair Bluetooth device programmatically Android |
How can I avoid or dismiss Android's Bluetooth pairing notification
when I am doing programmatic pairing?
This seems to give you the answer, with the pin entering and all. It
involves sending .setPin() whenever you get the message.
|
Video live streaming from Windows to iOS device using bluetooth |
You won't be able to stream your video via CoreBluetooth. Even tough Apple
officially allows larger MTUs in IOS 7, the bandwidth is still much too
small.
With classic bluetooth (3.0) an IOS device can only connect to MFi
compliant devices, which I'm sure your Windows PC is not.
I think the way you should go is to use some
WiFi-streaming-server-solution. First google result brought up
http://www.wikihow.com/Stream-Your-Webcam which uses VLC for that. You
should be able to grab this stream via WiFi in IOS as explained here:
Writing an app to stream video to iPhone
|
iOS connect/reconnect to Bluetooth device when using external-accessory and MFi |
Most of the information you are asking for is available on the Apple MFi
Website. Most questions cannot be answered because we have to sign an NDA.
However i can tell you that once you pair your device with an Apple MFI
Bluetooth module, it is up to the Bluetooth Module to keep the connection
alive, if you switch your device off and back on the bluetooth module
initialises the connection,
If you have a loss of connection the module will reconnect. Once connected
you can then open the SSP connection from the EAAccessory Framework.
Jamie
|
android ui hangs while writting to a bluetooth device from an activity |
ConnectedThread is instantiated, however we have skipped the part which
starts the thread, fancy calling start() on it? connectedThread.start()
which will keep it listening on a socket for any data written.
ConnectedThread connectedThread = new
ConnectedThread((BluetoothSocket)msg.obj);
//add this line
connectedThread.start()
//Toast.makeText(getApplicationContext(), "CONNECT", 0).show();
String s = "successfully connected";
connectedThread.write(s.getBytes());
|
Automatically connecting to a previous Bluetooth device through Objective C |
retrievePeripherals: uses the core bluetooth internal database to return a
CBPeripheral. Once you connected to a peripheral, it will be persisted in
the database and you can retrieve it. It is not not checked whether the
peripheral is turned on or not.
Unfortunately, there is no way to determine for what reason a device is not
available but you can create your own heuristics:
try to connect for a specific time and if you don't receive the
didConnectPeripheral: callback in a reasonable time (usually a few
seconds), then that peripheral is considered off range and you can go on
with the next peripheral. Note that the connectPeripheral will keep on
running (even in the background) as long as it does not succeed or not
cancelled/terminated.
if the peripheral is advertising, then you can try
|
IOS received notification when not connected bluetooth device is no longer available |
I assume the reason your wondering is because you would like to refresh
your foundPeripherals array and update UI correct? Well since you have no
current bond with the device there is no way to know when the device has
moved away or come closer. Your solution is this: start an NSTimer that
clears your foundPeripherals and begin discovering again when it fires. If
you see it in the new discovery, it's still there and you should re-add to
foundPeripherals. Otherwise it's gone.
|
access of files on windows pc from android device, bluetooth? |
If you are going to use bluetooth, from personal experience you need to
interact on both the computer and tablet. As a confirmation window for a
file transfer appears on either the computer or the tablet.
Wireless can be a better method of transferring files as I believe you can
get a file manager app for android so you can easily manage files between
desktop and tablet.
Some recommended file managers are available here -
http://android.appstorm.net/roundups/utilities-roundups/top-10-file-managers-for-android/
Hope this helps.
|
Inter-device communication via Bluetooth using Phonegap on Android? |
Check the following two links hope it will answer your question:
https://github.com/don/BluetoothSerial/blob/e1f1b330747c7c656e567bbd51a568067337e756/README.md
https://github.com/don/BluetoothSerial
If its work don't forget to vote.
Have fun.
|
What usb device is connected to a usb port |
The primary issue in C++ is that there is no standard functions for
detecting USB ports.
USB Port identification and implementation is a platform specific issue.
For example, Linux handles USB ports quite differently than Windows and
many embedded systems don't have USB ports.
So you'll have to look for a 3rd party library or find some OS API to use
for your platform.
|
Connect to bluetooth device (iPhone) via command line on MacOSX |
As far as I know you can only turn on/off bluetooth and check the status in
command line (using blueutil or manipulating with launchctl). But you can
use your applescript routines via osascript in shell.
|
Open remote Device file manager using bluetooth [Android] |
You can use FTP profile(file transfer profile) which uses OBEX, can find
code at here. Thanks to QCOM for open-source code, check if you need to
have RFCOMM channel registration and other details
|
How do I program a bluetooth module to broadcast a text string to an iOS device? |
One way would be to create a custom GATT service with a characteristic
containing your string. Then the iOS device could connect and read it.
There is also the standard Device Information service which contains
various string characteristics such as manufacturer name, serial no.,
device id etc. Maybe you could use that if it is suitable for your
application. Your BGSript code among other things could set the value of
the characteristic at run time if it is not constant. You can create the
service using Bluegiga's Profile Development Kit. Documentation can be
found here BLE112 Documentation and Software.
|
How to discover another device without using Gamekit, EAaccessory and core Bluetooth framework in iOS? |
You will need to be in control of your device, otherwise there is no way.
If you're controlling your other device, you can setup Bonjour on it.
Beware this is not an easy walk - neither on the device's side nor on the
iOS side.
The Apple docs (https://developer.apple.com/bonjour) don't help too much,
but https://github.com/tolo/HHServices might help you get started with the
iOS side. (It's designed for iOS to iOS over Bluetooth, but the code should
also work with WiFi with minor modifications. It will not work with Non-MFI
Bluetooth devices.) For the device side, you might want to have a look at
http://jmdns.sourceforge.net.
|
How to make the Bluetooth connection after device detected by swing application |
Take a look:
Connect to bluetooth device with Android/Java
http://www.aviyehuda.com/blog/2010/01/08/connecting-to-bluetooth-devices-with-java/
|
How to turn off Bluetooth when the paired device not there in area limits in android |
You can use following code to turn off an active Bluetooth
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (mBluetoothAdapter.isEnabled())
{
mBluetoothAdapter.disable();
}
|
How can I get Python to watch a USB port for any device? |
What about polling? Create a Python app that enumerates a list of attached
USB devices every couple of seconds or so.
Keep a list/dictionary of your initially detected devices, and compare to
that to determine what was attached/detached since your last polling
iteration.
This isn't the best approach, and enumerating all the devices takes a short
while, so not too sure this would be the most CPU efficient method.
|