bluetooth

Problem in Bluetooth connection over SPP in Android 2.3.3 in Nexus One?

天涯浪子 提交于 2020-03-05 05:42:25
问题 I just updated Nexus One with Android 2.3.3 and it seems that the bluetooth connection over SPP have stopped working in my app. The same app works alright in HTC Desrire with Android 2.2 and the same app use to work properly on Nexus One too. The problem started after upgrading to Android 2.3.3. Can anyone let me know what may be the issue? 回答1: I was able to solve this issue by using createInSecureRfcommSocket API and also there is a way of connecting through reflection for insecure

How to implement bluetooth for all device in react native

寵の児 提交于 2020-03-05 04:55:09
问题 I want to scan and connect devices using Bluetooth in React-Native. I tried react-native-ble-manager and react-native-ble-plx plugins. But I have a problem these plugins connected to special devices that have peripheral mode enabled. Look this answer. Question: How can I implement Bluetooth for all (at least all smartphones) devices in REACT-NATIVE? 来源: https://stackoverflow.com/questions/48790170/how-to-implement-bluetooth-for-all-device-in-react-native

Randomize Mac Address in BLE

会有一股神秘感。 提交于 2020-03-04 05:04:10
问题 I have made one app which turns iOS device to beacon. Now when I scan BLE devices from android device I got that iOS device in scan list but issue is every time I got random Mac address. So, my question is: Is this default behaviour means getting random mac address? I have checked all question on stack overflow and got same answer but still I want to confirm it? Also, if changing mac address is default behaviour then can we get when mac address changed? Same for android as well, If my android

android 蓝牙源码分析

强颜欢笑 提交于 2020-03-01 10:45:44
BluetoothService类中定义的Native方法都在android_server_BluetoothServer.cpp里建立jni调用 一、开启(BT Turn on Turn off) (蓝牙的打开关闭由类BluetoothEnabler控制。) 1.由BluetoothEnabler控制界面操作,在其构造函数里会先调用 LocalBluetoothManager.getInstance(context)。 2.然后在LocalBluetoothManager类的getInstance函数里会调用当前类下的init()函数,该init()函数中通过BluetoothAdapter.getDefaultAdapter()获得蓝牙设备的句柄,如果当前没有蓝牙设备则返回null。 3.初始化完毕会监听checkbox的状态,当触发点击checkbox会响应onPreferenceChange方法,其中将调用 LocalBluetoothManager.setBluetoothEnabled(enable)方法。 而LocalBluetoothManager.setBluetoothEnabled(enable)方法,会调用mAdapter.enable()方法,enable()方法又会调用 BluetoothService.enable()方法。其中, (1)打开(关闭

How to check if bluetooth is enabled on a device

▼魔方 西西 提交于 2020-02-28 05:53:47
问题 I want to check if Bluetooth is enabled on a device (so that an app could use it without user interaction). Is there any way to do that? Can I also check Bluetooth and Bluetooth Low Energy separately? 回答1: I accomplished this using the Radio class. To check if Bluetooth is enabled: public static async Task<bool> GetBluetoothIsEnabledAsync() { var radios = await Radio.GetRadiosAsync(); var bluetoothRadio = radios.FirstOrDefault(radio => radio.Kind == RadioKind.Bluetooth); return bluetoothRadio

how to trim unknown first characters of string in code vision

青春壹個敷衍的年華 提交于 2020-02-23 06:56:05
问题 I set a mega16 (16bit AVR microcontroller) to receive data from the serial port which is connected to Bluetooth module HC-05 for attaining an acceptable number sent by my android app and an android application sends a number in the form of a string array whose maximum length is equal to 10 digits. The problem arrives while receiving data such that one or two unknown characters(?) exist at the beginning of the received string. I have to remove these unknown characters from the beginning of the

Android Bluetooth - How to initiate Pairing

余生长醉 提交于 2020-02-20 09:09:37
问题 I want to initiate a pairing request (not connection at this point of time) to a non android device. This can be found working on Settings Application > Network > Bluetooth Settings > Click on a device after scan. A pop up appears on both the devices with a 6 digit pin. As per Android's documentation this should have popped up in my application as well, if I do something like this device.createRfcommSocketToServiceRecord(MY_UUID); As per Android's API documentation "Once a connection is made

Bring Bluetooth pairing request notification dialog on front to ask for PIN

爱⌒轻易说出口 提交于 2020-02-20 06:07:11
问题 What I'm trying to do is to brin the dialog to input the PIN for a pairing process. After I connect to a device, I receive a notification but the pairing dialog does not show up. I have to open it manually. So far I tried the following methods which are called in the broadcast receiver when I get the PAIRING_REQUEST action: public void pairDevice(BluetoothDevice device) { String ACTION_PAIRING_REQUEST = "android.bluetooth.device.action.PAIRING_REQUEST"; Intent intent = new Intent(ACTION

Bring Bluetooth pairing request notification dialog on front to ask for PIN

社会主义新天地 提交于 2020-02-20 06:05:06
问题 What I'm trying to do is to brin the dialog to input the PIN for a pairing process. After I connect to a device, I receive a notification but the pairing dialog does not show up. I have to open it manually. So far I tried the following methods which are called in the broadcast receiver when I get the PAIRING_REQUEST action: public void pairDevice(BluetoothDevice device) { String ACTION_PAIRING_REQUEST = "android.bluetooth.device.action.PAIRING_REQUEST"; Intent intent = new Intent(ACTION

linux Bluetooth programming in c

余生颓废 提交于 2020-02-18 05:24:10
问题 I am trying to run a basic code of c in linux[ubuntu] to search bluetooth device, but i am facing some problem. By using command sudo apt-get install bluez , to install required blueZ library it is saying that bluez is already newest version. But error comes that not able to find bluetooth.h and other files in compiling C source code, with gcc -o simplescan simplescan.c -lbluetooth Is there a complete library package, or do I have to download these header files?. I am following this link 回答1: