Linux中让智能手机使用蓝牙连接PC并利用PC网络上(3)

6. 启动bluetooth服务..
 插上蓝牙适配器,然后运行
 /etc/init.d/bluetooth start
 注意可以使用 ps aux | grep bluetooth 观察是否有一个
 /usr/bin/pand --listen --role=NAP --devup /etc/bluetooth/pan/dev-up的进程.
7. 打开手机中的蓝牙,然后连接PC端的蓝牙适配器.. 设置信任找到的PC适配器,同时PC端也
 信任手机端.可运行bluetooth-applet & ,然后在状态栏的蓝牙图标上观察蓝牙属性,
 看是否 连接正常..
 注意:  如果手机找不到蓝牙适配器可以在蓝牙属性中的mode of operation中点上
  Visible and connectable for other devices. PC端也
  可以使用hcitools scan命令,观察是否可以找到手机.
8. 在手机中添加蓝牙上网账号..
    a. 在控制面板的"连接"中选择"互联网账号",然后在"更多"中新建Bluetooth(蓝牙)互联网账号",,
 最后填入名称(名称随便取), 在"设备"选项中添加PC蓝牙适配器. 然后保存... 然后同样方法
 新建一个"组群",填入名称(如"使用蓝牙上网"等,之后将刚刚新建的蓝牙互联网账号加入
 到组群中. 将该组群设置为默认上网组群.
9. 运行'移动梦网", 随后在弹出的对话框中选择"使用蓝牙上网"组群, 点击"连接"并填入相应网址...
 一段时间后可就可以登录网站了..
 注意: 由于是使用PC端网络,因此PC能上手机也能上,PC不能上手机也不能上. 第一次连接的时候
 会比较慢, 因为要获得IP地址与PC建立连接等.
Troubleshooting
1. See if your bnep0 device is going up when a connection is requested and the interface is asked to come up.
You can watch this with the following command as root:
watch -n1 “ifconfig”
You should see bnep0 coming up when you fire up your bluetooth client device to try and access the PAN network.
2. See that the script /etc/bluetooth/pan/dev-up is being executed.
3.Watch the output of syslog to see if the dhcp server is asinign an IP to your device.
tail -f /var/log/syslog
tail -f /var/log/messages
4. Once you see the IP, try to ping your device with the ping command.如果有什么写得不清楚了,可以看看下一页中的英文文章.
我的这边就是使用他的方法...当然有一小部分修改.

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/faf2773c016aad5bbe3ce724332b0472.html