- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在编写一个 C++ 应用程序来管理嵌入式设备的蓝牙连接。我在 Linux 下通过 D-Bus 与 BlueZ5 对话。
作为实现入站配对的第一步,我执行了以下操作:
现在我需要一个事件来告诉我新设备已配对,这样我就可以信任它并接受 SPP 连接。但是我在规范中找不到这样的事件 ( https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc )。
有这样的事件吗?似乎 bluetoothctl 发出一条消息,如
[NEW] Device 44:55:66:11:22:33 Foo Bar
一旦设备配对...
有人能告诉我必须监听哪个事件吗?
还是我必须投票?我认为 bluetoothctl 不会进行轮询,因为它的 react 非常快。
最佳答案
来自 here
boolean Connected [readonly]
Indicates if the remote device is currently connected. A PropertiesChanged signal indicate changes to this status.
当添加新设备时,InterfaceAdded 信号在 interface=org.freedesktop.DBus.ObjectManager 上广播。请参阅以下使用 dbus-monitor 捕获的信号。检查属性 Connected。
signal time=1558128293.155096 sender=:1.2 -> destination=(null destination) serial=65 path=/; interface=org.freedesktop.DBus.ObjectManager; member=InterfacesAdded
object path "/org/bluez/hci0/dev_F0_D7_AA_AA_0C_41"
array [
dict entry(
string "org.freedesktop.DBus.Introspectable"
array [
]
)
dict entry(
string "org.bluez.Device1"
array [
dict entry(
string "Address"
variant string "F0:D7:AA:AA:0C:41"
)
dict entry(
string "Name"
variant string "Moto"
)
dict entry(
string "Alias"
variant string "Moto"
)
dict entry(
string "Class"
variant uint32 5898764
)
dict entry(
string "Icon"
variant string "phone"
)
dict entry(
string "Paired"
variant boolean false
)
dict entry(
string "Trusted"
variant boolean false
)
dict entry(
string "Blocked"
variant boolean false
)
dict entry(
string "LegacyPairing"
variant boolean false
)
dict entry(
string "Connected"
variant boolean true
)
dict entry(
string "UUIDs"
variant array [
]
)
dict entry(
string "Adapter"
variant object path "/org/bluez/hci0"
)
]
)
dict entry(
string "org.freedesktop.DBus.Properties"
array [
]
)
]
如果设备已经添加,那么您会在 interface=org.freedesktop.DBus.Properties 上收到 PropertiesChanged 信号。请参阅下面的捕获,它是断开连接时的登录,但上面的捕获可以帮助您在设备连接时接收信号。
signal time=1558128303.204016 sender=:1.2 -> destination=(null destination) serial=71 path=/org/bluez/hci0/dev_F0_D7_AA_AA_0C_41; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
string "org.bluez.Device1"
array [
dict entry(
string "Connected"
variant boolean false
)
]
array [
]
关于c++ - BlueZ5 : Event when inbound pairing is complete,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56186562/
我一直在试图找出一种计算以下内容的方法: 带宽、延迟、当前上传和下载速度 . 并且对我为 INBOUND-RTP、OUTBOUND-RTP 和 REMOTE-INBOUND-RTP 获得的值感到困惑。
我相信我可能不太了解 Twilio 调用的流程。我有两种情况 - 一种情况是我从浏览器调用电话(传出),第二种情况是我从手机调用电话到浏览器(客户端)(传入)。 对于这两个调用,当请求到达我的 Twi
Creative World Quartz Scheduler.
目前我有一个简单的 war ,其中包含一些 Spring 集成配置,并且使用以下代码将该 war 部署到 jetty 容器中: protected void createWac(File file,
我有一个带有 spring 集成的以下设置。 我在网关上收到 2 种不同类型的 POST 请求,它们都被传递到 service-activator 进行处理。在一种类型的 POST 请求中,我
我正在使用 Spring Integration 将 xml 文件从 SFTP 传输到本地。我使用了Spring社区提供的代码。 主类文件 public class SFTPMain { publ
我有一个从标准数据库查询开始的集成,它会更新数据库中的状态以表明集成工作正常。有用。 但是如果无法处理数据并引发异常,则状态不会按预期更新,但我想用“KO”状态更新我的数据库行,这样同一行就不会一遍又
我正在编写一个 C++ 应用程序来管理嵌入式设备的蓝牙连接。我在 Linux 下通过 D-Bus 与 BlueZ5 对话。 作为实现入站配对的第一步,我执行了以下操作: 通过AgentManager1
我们有以下基于 int-jpa 的简单工作流: [入站 channel 适配器] -> [服务激活器] 配置是这样的:
使用 GRPC 传输大量数据的最佳实践是什么?我正在向 GRPC 服务器发送请求,该服务器将流回数据。发回的数据可以是大约 100 个 protobuf 消息,也可以是几个 100.000 个 pro
下面是我的 Spring Integration 配置的一部分: 如您所见,我想定义 2 个不同的过滤器: 在 recursiveScanner 中跳过临时文
我尝试使用多个 jpa:inbound-channel-adapter。但是我有一个问题。当我添加两个入站 channel 适配器时,只有最后一个起作用。例如,有两个入站 channel ,我们现在将
我遇到这个问题,第一次处理此代码时,它运行良好,但第二次(第一次和第二次运行基于设置的 cron),它在失败文件夹中查找文件,然后删除成功文件夹并将其复制到失败文件夹中。我不知道为什么会发生这种情况?
我正在使用 URL fetch service 将请求从一个模块发送到同一应用中的另一个模块,它表示如果将 follow_redirects 参数设置为 False,则 X-Appengine-Inb
我正在用 MySQL 编写一个简单的 JDBC 代码。一切正常,我可以通过 select 语句打印表中的记录。但是当我使用 Connection.close() 关闭连接时,出现以下异常。感谢您的帮助
我目前正在使用 Spring Integration 4.1.0 和 Spring 4.1.2。我需要能够逐行读取文件并将读取的每一行用作消息。基本上我想允许“重播”我们的消息源之一,但消息不会保存在
Spring 集成 tcp 网关可以设置如下: 注意设置为 10 秒的回复超时。 是不是意味着TCP服务器会调用服务,最多可以等待10秒?如果服务在 10 秒内没有回复,TCP 服务器
我是 Spring Integration 的新手,我正在尝试设置一个简单的用例: 轮询远程 REST 端点,将返回的有效负载拆分为多行并将其发送到 Kafka 出站适配器。我成功地做了一些类似的事情
我实现了一个 sftp-inbound-channel-adapter,当处理异常时,我应该显示一条自定义消息。 我试过 : 但是一个元素 不被接受。你能解释另一种解决方
Tensorflow 版本:1.11.0 我正在尝试将 TensorBoard 与 Tensorflow keras 模型一起用于投影仪可视化。 我收到 AttributeError: Layer f
我是一名优秀的程序员,十分优秀!