linux - 向 rfcomm 终端发送消息?

标签 linux bluetooth

我通过蓝牙在使用gumstix的客户端和Linux上的服务器之间创建了连接。 这就是我对服务器所做的:

ftph-user@ftph-9818:~$ hcitool dev
Devices:
hci0    B0:10:41:BA:BF:26
ftph-user@ftph-9818:~$ rfcomm watch /dev/rfcomm0 3 /sbin/agetty rfcomm0 115200 linux

Waiting for connection on channel 3
Connection from 00:03:19:50:2A:FB to /dev/rfcomm0
Press CTRL-C for hangup

在客户端:

root@ftph-9817-gbt:~$ rfcomm connect /dev/rfcomm0 B0:10:41:BA:BF:26 3
Connected /dev/rfcomm0 to B0:10:41:BA:BF:26 on channel 3
Press CTRL-C for hangup

>

我想要的是能够在客户端上输入并在服务器上读取,也执行一些脚本,而不是我所拥有的只是一个空白屏幕。

有什么想法吗?

最诚挚的问候, 狮子座

最佳答案

我尝试使用虚拟(蓝牙)COM 端口从 Windows 连接到 Linux,并将数据从 Windows 计算机发送到 Linux 计算机。为此,我在 Linux 上配对/连接到蓝牙适配器后,在 Windows 上设置了一个虚拟 COM 端口。然后,我使用了以下命令:

    sudo rfcomm watch /dev/rfcomm0 <chan> screen /dev/rfcomm0 115200

在你的例子中,chan 是 3。

您可以使用apt-get install screen来安装screen。

然后在 Windows 上,我连接到与 Linux 计算机绑定(bind)的传出虚拟 COM 端口。这将在 Linux 计算机上启动屏幕串行端口控制台。然后,我可以在 Windows 串行端口程序上键入内容,并看到 Linux 屏幕控制台上反射(reflect)的字符。

关于linux - 向 rfcomm 终端发送消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26377691/

相关文章:

c# - Android 到 PC/PC 到 android 蓝牙/wifi 实时音频流

ios - 如何触发Core Bluetooth状态保存和恢复

linux - MATE 菜单不可配置

linux - ubuntu 14.04.4 LTS 中的 vncserver bash 脚本错误

linux - 在 Ubuntu 上使用 X11 覆盖窗口和根窗口

linux - 以非 root 用户身份访问 Bluez 库

android - iBeacon(Kontakt Beacon) android 区域监控

bluetooth - Pulseaudio 未检测到蓝牙耳机

php - Linux 和 Php : server with MySQL database with terminal

php - Virtphp 和 phpbrew : setting up two different applications with different PHP versions on one server