问题标签 [characteristics]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
107 浏览

ios - 获取 Thread1: EXC_BAD_ACCESS(code = 1, address = 0x1a1090010) 在核心蓝牙框架中访问特性.UUID.UUIDString?

我正在尝试将本地特征 uuid 字符串与代表回调特征 uuid 字符串进行比较,如下所示:

有人可以帮助我如何进一步进行吗?

0 投票
2 回答
2902 浏览

xamarin - 如何在 Xamarin/Android 上启用多个 BLE 特征通知?

我正在尝试使用 Xamarin/Android 为多个 BLE 特性启用通知,但似乎无法这样做。如果我尝试一次启用多个事件,该应用程序似乎停止接收任何 BLE 事件。

任何人都可以使用 Tamarin/Android 确认这是否可行。我们有一个原生 iOS 应用程序,它可以在启用多个通知的情况下正常工作。我们使用的基本步骤如下:

  1. 扫描设备
  2. 连接到设备
  3. 发现服务
  4. 对于每个发现的服务,遍历特征并启用所需的特征
  5. 处理BLE回调中的每个异步回调事件

每当我们尝试启用多个特征的通知时,我们都不会再收到任何事件。

我也找不到任何启用多个特性的示例。

我希望我只是错过了一些关于在这里使用 Xamarin/Android API 的基本知识。

谁能解释以下几行的用途

0 投票
0 回答
106 浏览

swift - 将 Int 转换为 NSData

大家好,我需要将我的 iPhone 中的值写入 BLE 外围设备。

发现了服务和特征,并且连接也在那里。

问题:我需要将值 2 写入特征。为此我打电话

数据应该是 2 但它应该来自 NSData 类型。我从 int 到 NSData 的转换的结果是02000000而不是2,特征需要 2。

这种转换有什么问题?如何获得值为2的 NSData

以下代码是我需要 NSData 中的值 2 的上下文

十分感谢。

0 投票
0 回答
1205 浏览

ios - 如何在 ios swift 中定期从 ble 设备读取数据?

我能够在 ios(swift) 中从 ble 设备读取数据。如何以时间间隔从 ble 外围设备定期读取数据?我尝试使用 NSTimer,如下面的代码所示。但是我在 Appdelegate 中得到了 thead1:SIGABRT ERROR。

0 投票
1 回答
1402 浏览

python - 蓝牙 Bluepy 未找到所有特征

我正在使用bluepy 库与蓝牙设备进行通信,但它没有向我展示所有特征。

当我使用 gatttool 运行以下命令时,我得到:

但是当我使用 Bluepy 运行以下命令时,我得到:

我需要能够将 '\x01\x00' 写入特征:

然后将 '\x01\x04' 写入特征:

但我不能,因为 Bluepy 没有找到特征:

为什么是这样?

当 Bluepy 找不到该特征时,如何写入该特征?

为什么 Bluepy 返回的句柄与 gatttool 返回的句柄不匹配?

谢谢

0 投票
2 回答
1638 浏览

android - 如何使用 Android 订阅多个 BluetoothLE 特性

我正在开发一个应该订阅多个 BLE 特性的 Android 应用程序。

但无论我做什么,我只收到一个特征的更新值。

这是代码:

无论我做什么,我只得到速度数据。如果我改变两个块的顺序,我只会得到加速度,但没有更多的速度数据。

为了一次订阅许多特征,我该怎么做?

提前致谢

雷托

0 投票
1 回答
11981 浏览

bluetooth-lowenergy - BLE 特性的长度限制是多少?

我正在阅读蓝牙核心规范。v 4.2 文档,但我找不到有关特征长度限制的任何信息。

  • BLE 服务的特征长度限制是多少?
0 投票
1 回答
1966 浏览

android - Android BLE - read custom service

I try to communicate with an µ-controller through an android device via BLE. I am able to write my custom characteristic (toggle an LED on my Dev-Kit) but can't read the value of the LED status ('0x00' for off, '0x01' for on).

I want to read it when i click on the ExpandableListView when i click on an item. For the moment i implemented it within the onChildClickListener. If a characteristic-permission "PROPERTY_WRITE" > 0 then it should write the value.

But it always fails to read the characteristic. The LED value is written and the LED switches to 'ON' but it doesn't read the value of the LED. I want to read the value for switching the LED on/off with clicking on the characteristic in my list.

I can't figure out what i'm doing wrong. It should be reading the characteristic, write it in a textfield. On my BLE-Device i have enabled reading. I can read the value with my ubuntu-terminal using gatttool -> char-read-hnd [hnd] [val].

This is my implementation of the readCustomCharacteristic() in mBluetoothLeService

0 投票
1 回答
2192 浏览

android - 无法从蓝牙设备中发现所需的服务

我制作了允许我连接到蓝牙设备并列出所有服务和特征的应用程序。然而,唯一认可的服务是“设备信息服务”,还有“未知服务”,但它似乎没有传递我正在寻找的数据。我确信该设备工作正常,因为附加到设备的官方应用程序工作正常。可能是什么问题呢?我正在寻找的信息是否有可能在未知服务中传递并以某种方式加密?

0 投票
1 回答
757 浏览

android - BLE:写入特征时,在 onCharacteristicWrite 中获取状态为 133

我正在尝试在 android 设备上设置 BLE 客户端-服务器通信。从服务器端,我可以成功发布广告并查看连接更新。在客户端,我可以连接到服务器,发现它的服务和特征。但是,当我尝试编写特征时,我收到状态 133 onCharacteristicWrite()

我不知道为什么会这样.. !! 需要一些帮助..

我尝试执行以下操作,但它们没有产生任何影响:-> 添加setWriteType -> 将 UUID 更改为私有 UUID

在客户端写入之前我必须获得权限吗?