jjzjj

characteristic

全部标签

Android 蓝牙 LE - 读取特性不适用于三星

我正在尝试连续读取BLE设备的特性。我在我的服务类中创建了一个Runnable:privateclassBackgroundRunnableForReadimplementsRunnable{privatevolatilebooleanisRunning=true;@Overridepublicvoidrun(){try{BluetoothLeService.this.backgroundRunID=Thread.currentThread().getId();while(isRunning){ListgattServices=BluetoothLeService.this.getSu

Android BLE onCharacteristicRead 和 onCharacteristicChanged 从未调用过

我正在尝试连接蓝牙LE温度计。连接到设备工作正常。唯一让我挂断的部分是gattCallBack和onCharacteristicChanged/Read。'setNotification'和描述符'setValue'和'writeDescriptor'都返回true。永远不会调用onCharacteristicChanged来返回值。我使用了Play商店中名为BLEScanner的一个非常方便的小程序来帮助我提供有关该设备及其服务和特性的更多信息。这就是为什么我简单地硬编码服务2,特征0。我似乎无法弄清楚为什么在我写描述符之后,我再也看不到任何东西回来了。有趣的是,我可以使用其他一些特

android - 获得蓝牙低功耗 (BLE) 设备通知的步骤是什么?

我正在开发低功耗蓝牙(BLE)应用程序。我有一个测量重量的BLE设备(秤)。我可以连接这个设备。但我不知道如何从中读取数据(重量值)。我想知道我的应用程序是否已连接到任何BLE设备,那么获得设备通知以获取更新数据的步骤是什么。好的,下面是我正在使用的Activity..publicclassBlogBLEActivityextendsActivityimplementsOnItemClickListener{privatefinalstaticStringTAG=BlogBLEActivity.class.getSimpleName();privateBluetoothAdapterb

android - 如何在Android中为BLE快速稳定地写入连续特征?

我在Android中开发BLE,我可以扫描、连接和写入特性到BLE设备。我调用以下函数来传递BluetoothGatt和characteristic至AsyncTask当点击Button.write_btn.setOnClickListener(newView.OnClickListener(){@OverridepublicvoidonClick(Viewv){newWriteCharacteristic(mBluetoothGatt,HueCharacteristic).execute();}});写入特性的代码如下:privateclassWriteCharacteristice

android - BLE 中的 "reliable write"是什么?

在Android的BLEAPI(BluetoothGatt)中有处理可靠写入的方法:publicbooleanbeginReliableWrite()publicvoidabortReliableWrite(BluetoothDevicemDevice)publicbooleanexecuteReliableWrite()它还有一个回调(在BluetoothGattCallback中):publicvoidonReliableWriteCompleted(BluetoothGattgatt,intstatus)我找不到任何相关文档。它是什么?它与“正常”(不可靠?)写法有何不同?

android - 在 Android 上订阅 ANCS

基于列出的服务here,我正在尝试从Android设备订阅服务,但无法使请求部分正常工作。尝试使用7905F431-B5CE-4E99-A40F-4B1E122D00D0做广告,但外围设备未显示在iPhone的蓝牙设备列表中。还玩了(LE)扫描和过滤器来发现ANCS服务器,但运气不佳。有什么提示吗?编辑:代码BleService.javapublicvoidsetCharacteristicNotification(BluetoothGattCharacteristiccharacteristic,booleanenabled){Log.d(TAG,"setCharacteristic

swift - 扫描 BLE 设备并将它们呈现在 UITableView 中

我试图找到一种方法来扫描BLE设备并将它们显示在UITableView中。BLE设备的扫描、连接、读取和写入功能清晰且有效!所以我的问题集中在“ScanTableView”和“BletoothManager”类之间的交互上。这是我的两个类://ScanTableView.swiftimportUIKitclassScanTableView:UITableViewController{@IBOutletvarscanTableView:UITableView!varbluetoothManager=BluetoothManager?()vartableViewScanTime=5vart

IOS 应用程序在连接后未从蓝牙设备接收到触发事件

我有一个蓝牙设备。当我触发设备时,IOS应用程序在funccentralManager(_central:CBCentralManager,didDiscoverperipheral:CBPeripheral,advertisementData:[String:Any],rssiRSSI:NSNumber)方法中接收触发事件advertisementData["kCBAdvDataLocalName"]但是当我通过centralManager.connect(heartRatePeripheral)方法将BLE蓝牙设备连接到我的应用程序时,它没有在任何CBPeripheralDeleg

ios - Swift 3 中的不安全指针

我知道这个问题被问过好几次了,但我真的不明白。我想从蓝牙设备(miband)中提取一个值。在swift2中,它是这样工作的:funcperipheral(_peripheral:CBPeripheral,didUpdateValueForcharacteristic:CBCharacteristic,error:Error?){ifcharacteristic.uuid.uuidString=="FF06"{letvalue=UnsafePointer(characteristic.value!.bytes).memoryprint("Steps:\(value)")}}但在swift

ios - 从 Swift 写入 BLE 外设

我正在构建一个连接到BLEdevice(RedbearLabsDuo)的iOSSwift应用程序.什么有效?我能够启动设备扫描连接到设备收集BLE设备的服务和特征-一切正常问题出在哪里?BLE设备(RedbearLabsDuo)也有一个板载WifiController,能够扫描可用网络。Thedocumentation声明要扫描Wifi必须使用UUID3EC61400-89CD-49C3-A0D9-7A85669E901E连接到主要服务找到UUID为3EC61401-89CD-49C3-A0D9-7A85669E901E的命令特征发送一个2字节的命令[0x20,0xA0]到命令特征还设