scientific linux下 用Python for S60的Bluetooth Console编写手机程序

参考文章:http://www.handaoliang.com/article_63.html

                   http://sidrit.wordpress.com/2009/01/23/ubuntu-serial-port-bluetooth-console-nokia-e61i-python/

 

首先,再scientific linux下安装Putty.

如果在编译的时候,出现错误,试着修改Makefile文件。去掉 -Werror选项。

 

 

First we need to know if the BT dongle is up and running. Open a shell window and type:


hcitool dev

 

If everything is running properly, the output should be something similar to this:
sid@dev:~$ hcitool dev
Devices:
hci0 00:02:72:XX:XX:XX

The next two steps are quite a logical following :


1. Create a serial port on the pc


sdptool add --channel=3 SP

that should output:
Serial Port service registered

 

2. Start listening for connections on that port:


rfcomm listen rfcomm0 3

that should output:
Waiting for connection on channel 3

 

Now on the phone, enable bluetooth, start up the python shell the choose:
Options -> Bluetooth console and select from the devices list the BT device of the computer

Done this, on the phone screen’s python shell you should see something similar:


Connecting to ('00:02:72:XX:XX:XX', 3)... OK.
telling that the connection with our device succeeded.

Meanwhile on the command line, where we are listening for connections on the serial port 3, the output should be:

 

rfcomm listen rfcomm0 3
Waiting for connection on channel 3
Connection from 00:17:E5:XX:XX:XX to /dev/rfcomm0
Press CTRL-C for hangup

 

If you’ve gotten this far with these results, we’re all good and we have one more step left.

 

由于貌似scientific linux下没有 cu 命令,所以要用Putty来解决

 

 

首先,connect type选择Serial,然后在Serial line中填入地址,Save一下,然后Open,就可以连接到手机Python控制台了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值