python - Twisted 和 PyBluez 一起工作?

标签 python bluetooth twisted

我想同时使用双绞线和蓝牙。目前,我正在使用在扭曲线程中运行的 PyBluez 执行此操作。

PyBluez 只是创建一些套接字(或类套接字?它有一个像普通套接字一样的文件描述符)对象,基本上你这样做:

sock=bluetooth.BluetoothSocket( bluetooth.RFCOMM )
sock.connect((device_id,1))

我不能以某种方式将那个 socket 插入扭曲的 react 器并用协议(protocol)连接它吗?

最佳答案

您可以编写一个实现 IReadDescriptor(或 IWriteDescriptor)的类并将其连接到 react 器,如 this example .

关于python - Twisted 和 PyBluez 一起工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6793831/

相关文章:

python - 有没有办法在 App Engine 中实现长时间运行的事务?

Android 2.1 检测蓝牙音频连接/断开

ios - 是否有 iOS PWA 与蓝牙设备通信的解决方法?

python - 在 twisted.web.client 中使用 cookie

mysql - 使用带有扭曲的 adbapi 和 scrapy 的 mysql 进行异常处理

python - Ubuntu 中的 "failed building wheel for twisted"

python - 两个日期时间之间的 15 分钟间隔数

python - 打印语句未出现在 GAE 中

python - 使用 Ansible 从一行文本中提取两个字符串

android - 如何更改 Android 中的蓝牙存储位置?