为什么期望'obexctl'的shell脚本无法按预期工作

时间:2019-01-23 11:31:46

标签: shell bluetooth expect obex obexftp

我想使用蓝牙将文件从一台设备发送到另一台设备。为此,我正在使用obex,它的命令名为“ obexctl”。它作为 Please Take a look into this Doc

enter image description here

enter image description here

这是发送文件的工作方式。为了使这一过程自动化,我使用Expect编写了一个shell脚本。如下。

#!/usr/bin/expect -f
   set address [lindex $argv 0]
   set prompt "#"
   spawn obexctl
   sleep 2
   expect -re $prompt
   send "connect $address\r"
   sleep 5
   send "quit\r"

但是没有用。它没有完全执行该connect命令。并退出代码。请让我知道您是否知道解决方案。

0 个答案:

没有答案