bluetooth-lowenergy

Java convert string hex values to byte[], recreating this obj-c functionality

☆樱花仙子☆ 提交于 2019-12-13 07:29:31
问题 I am making an app that communicates with a specific Bluetooth Low Energy device. It requires a specific handshake and this is all working perfectly in Objective-C for iOS , however, I am having trouble recreating this functionality in Java Any thoughts greatly appreciated! WORKING Objective-C code: uint8_t bytes[] = {0x04,0x08,0x0F,0x66,0x99,0x41,0x52,0x43,0x55,0xAA}; NSData *data = [NSData dataWithBytes:bytes length:sizeof(bytes)]; [_btDevice writeValue:data forCharacteristic:

Blutooth LE Scan

我们两清 提交于 2019-12-13 07:12:04
问题 I am developing a demo app to scan Blutooth Le devices. But startLeScan() returns null. and I am not getting any device name. I have tried using normal scan it shows up fine. I am adding my snippet here private void scanLeDevice(final boolean enable) { if (enable) { // Stops scanning after a pre-defined scan period. new Handler().postDelayed(new Runnable() { @Override public void run() { mScanning = false; mTxtInfo.setText("Stopped Scanning."); mBluetoothAdapter.stopLeScan(mLeScanCallback); }

Listening iBeacons even if the app is closed

送分小仙女□ 提交于 2019-12-13 05:43:14
问题 I was wondering if it is possible to listen ibeacons even if the app that have the implementation (code to interact over BLE - ibeacons) is closed. Is it possible? Can i write a code that 'tells' to the device to listen ibeacons all the time and if found any, need to do some action based on code from specific app? Or i need that my app still running all the time to listen the ibeacons? Thank in advance. 回答1: Yes, the Android Beacon Library is designed to do exactly this. It automatically

Interpret Characteristic Properties (iOS and BLE)

家住魔仙堡 提交于 2019-12-13 04:36:49
问题 I am reading characteristic properties from a BLE device from my iPhone. However, some of the properties I am seeing (like 0xA, 0x22) are not in the enumerated list that Apple provides. Are these properties a combination of 2 or more enumerated values? Or are these custom properties from the manufacturer? Need guidance on this. 回答1: As you can read in the documentation: Values representing the possible properties of a characteristic. Since characteristic properties can be combined, a

Using BLE between devices with React Native

梦想与她 提交于 2019-12-13 03:49:52
问题 I am trying to make an app that uses Bluetooth Low Energy between two smartphones in proximity using React Native. I am looking at react-native-ble-manager but i don't understand how to create the "server" (or in this case peripheral) part. I understood the methods to discover and connect to a peripheral but I don't understand how to make a smartphone (with enabled bluetooth) listening incoming connections. How can I listen incoming connections with BLE? Thank you in advance for your answers

Read multiple characteristics from an Android device using library RxAndroidBle

。_饼干妹妹 提交于 2019-12-13 03:48:10
问题 I am using the library RxAndroidBle in order to scan devices and then connect to one specific device and read 4 GATT characteristics. I can read one characteristic (Battery Level) ith this code : scanSubscription = rxBleClient.scanBleDevices( new ScanSettings.Builder() .build() ) .observeOn(AndroidSchedulers.mainThread()) .doOnNext( scanResult -> { if(scanResult.getBleDevice().getName() != null){ if(scanResult.getBleDevice().getName().equals("NODE 1")){ Log.e("BLE SCAN", "SUCCESS"); Log.e(

Web bluetooth with promises

﹥>﹥吖頭↗ 提交于 2019-12-13 03:48:08
问题 I'm working on a project where a want to use web bluetooth to connect to a BLE device. I looked trough multiple tutorials and tried to make those work. In the code below i get the characteristic of the device. The code works but I don't know why. I want my promise to activate when a device is found and connected to. But when I put the connect .then in the promise the other .then already activates when I launch the application. function read() { let prom = new Promise(function (resolve, reject

Objective C- BLE device Manufacturers data comparison

六眼飞鱼酱① 提交于 2019-12-13 03:44:48
问题 I have a task of comparing Manufacturers data to a string to display the BLE devices . -(void)centralManager:(CBCentralManager *):didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI { NSString *manufac=[advertisementData objectForKey:CBAdvertisementDataManufacturerDataKey]; NSString *string=@"57394423 4334445 55"; if([string isEqualToString:manufac]) NSLog(@"yes it is the device"); else NSLog(@"sorry not a device"); }

Android BLE handling disconnect timeout

我只是一个虾纸丫 提交于 2019-12-13 03:39:27
问题 Referencing blog posts like this one, and SO questions like this one. I am going to assume that this is a general behavior (and not a bug on my side). The common answer seems to be something to the effect of: "Change the BLE firmware so it actively disconnects." The question which is not well addressed is how Android apps handle what must be a very common occurrence? Connection is lost unexpectedly due to "range", I.E. radio signal strength. Is there a way for an app to be notified

Scanning for beacons using universal beacon library

柔情痞子 提交于 2019-12-13 03:21:29
问题 I am trying to implement a mobile app (on iPhone) that just scans for beacons and displays a notification for each one. I am a noob with beacons/bluetooth. I implemented it using the universal beacon library (https://github.com/andijakl/universal-beacon) and i've attached my ios bluetooth implementation. my problem is that i receive about 12 beacon added events even though i only have two (I assume it is picking up all my other bluetooth devices). I also only receive the local name in the