bluetooth

Transfer NSString between two devices via bluetooth in iOS

旧巷老猫 提交于 2020-01-22 06:53:46
问题 I want to transfer NSString between two iOS device, via bluetooth. Can anybody please help how to do transfer NSString via bluetooth? I searched for specific answer and for sample code, but couldn't find it. Please guide me. Thanks in Advance.!! 回答1: I'm going to comment more extensively on how you can use MCSession for this sort of simple case since when I was first familiarizing myself with MCSession , I was amazed at how little information was available on how to utilize a simple MCSession

How to fix the Android error “Background execution not allowed: receiving Intent {…}”

笑着哭i 提交于 2020-01-22 02:52:05
问题 So I'm programming an Android app that uses Bluetooth discovery of devices. Here is the code I use to start discovery. try { myBluetoothAdapter.startDiscovery(); Log.d("Bluetooth Started successfully","yes"); } catch (Error e) { Log.d("FAILED","Ya failed mate"); e.printStackTrace(); } I then register a BroadcastReceiver to watch for when devices are found. Here is my code for that IntentFilter intentFilter = new IntentFilter(BluetoothDevice.ACTION_FOUND); final ArrayList<String>

Android Bluetooth: Software Caused Connection Abort

时光怂恿深爱的人放手 提交于 2020-01-21 13:37:53
问题 I am getting exception whenever I am trying to connect with android device to bluettoth enabled device, it is connecting and withina couple of a minute it is getting exception. To connect using BLuettoth device(Spp profile), I am using Method m; m = mmDevice.getClass().getMethod("createRfcommSocket", new Class[] { int.class }); tmp = (BluetoothSocket) m.invoke(mmDevice, 1); Using this code, I am able to to connect to the device. But at this line bytes = mmInStream.read(buffer), I am getting

Bluetooth communication from PC to mobile phone, use laptop speaker and mic during voice call

独自空忆成欢 提交于 2020-01-21 06:48:26
问题 I am using 32feet.net library for connecting with Bluetooth mobile phone. I have successfully discovered devices, successfully paired with device. I have successfully made a call using AT command with the help of Bluetooth dial with 32feet.net and c# I want to use the speaker and mic of laptop during the voice call going on the mobile phone. My C# code for dialing a call is BluetoothEndPoint bep = new BluetoothEndPoint(phone.DeviceAddress,BluetoothService.Handsfree); cli = new BluetoothClient

Send Command to Bluetooth from Android device

百般思念 提交于 2020-01-21 06:13:47
问题 I am getting a issue to send Commands from my android device to Bluetooth device. Bluetooth is associated with a micro-controller. My effort is below: public class MainActivity extends AppCompatActivity { private static final int REQUEST_ENABLE_BT = 2; private BluetoothAdapter mBluetoothAdapter; public static final String TAG = "CustomPOC BLEEEEEEE"; private Button btn_send; private BluetoothDevice mdevice; private Handler mHandler; private ConnectThread mConnectThread; private

Raspberry iBeacon not detecting

半城伤御伤魂 提交于 2020-01-20 19:55:09
问题 I recently was trying to configure ibeacon on a BLE dongle (cambridge silicon radio) on a raspberry pi. Reference: http://developer.radiusnetworks.com/2013/10/09/how-to-make-an-ibeacon-out-of-a-raspberry-pi.html I get this message : HCI Command: ogf 0x08, ocf 0x0008, plen 44 1E 02 01 1A 1A FF 4C 00 02 15 E2 C5 6D B5 DF FB 48 D2 B0 60 D0 F5 A7 10 96 E0 00 00 00 00 C9 00 00 00 00 00 00 00 00 00 00 00 00 00 > HCI Event: 0x0e plen 4 01 08 20 12 And the app does not even locate the beacon. Though

How to make Android phone as a bluetooth headset?

半腔热情 提交于 2020-01-20 14:21:23
问题 Yes, I know Android has already implemented the Bluetooth Headset Profile, but it is in Audio Gateway Role, not in HeadSet Role. What I want to do is develop an application on Android phone which will act as a bluetooth headset, so it can connect to my laptop by bluetooth. When I try to call somebody, I can use my phone to dial him, and my application will forward the voice through bluetooth to my laptop, and one other application running on laptop will get the voice data and forward them to

BluetoothSocket - connection timeout

青春壹個敷衍的年華 提交于 2020-01-17 07:30:12
问题 It's there any way to set connection timeout to BluetoothSocket? If my device is offline, connection process takes a few seconds and then returns an error. I need to set the timeout to 1 second. It is possible? BluetoothSocket socket = device.createRfcommSocketToServiceRecord(APP_UUID); // socket.setProxyConnectionTimeout(1000); <- some like this socket.connect(); BluetoothSocket class have PROXY_CONNECTION_TIMEOUT, but never used... Thanks for answers. BTW: I try some like this: socket

Bluetooth Printer Connection Failed in Android

你说的曾经没有我的故事 提交于 2020-01-17 06:29:30
问题 I want to make a POS app. In this app, I need to print a receipt, but I have a problem with the bluetooth connection. In this code, I want to set the printer device that I use in my fragment. I want the bluetooth to stay connected even though I move to another fragment. I put the code in my MainActivity, but the problem is every time I move to another fragment, mService is always null. So I couldn't connect to the device. Please help me. Thanks in advance. MainActivity.Java public class

Zebra printer connection failed “read failed, socket might closed or timeout, read ret: -1”

二次信任 提交于 2020-01-17 04:58:08
问题 “java.io.IOException: read failed, socket might closed or timeout, read ret: -1” exception appears while i'm trying to connect my android device with Zebra ZD410 printer through bluetooth. try { mmSocket.connect(); } catch (IOException e1) { android.util.Log.e(TAG, e1.toString()); try { android.util.Log.i(TAG, "Trying fallback..."); mmSocket =(BluetoothSocket) mmDevice.getClass().getMethod("createRfcommSocket", new Class[] {int.class}).invoke(mmDevice,1); mmSocket.connect(); android.util.Log