Multipeer Connectivity Framework 可能基于专有协议,因为我在任何地方都没有看到它实现了 PAN。它只是和它相似。正如您所提到的,支持的配置文件列表还包含 PAN 以及以下注释:
根据蓝牙配件的不同,您可能会遇到配置文件功能的细微变化。这些变体由配件制造商而非 iOS 设备管理。
所以理论上 PAN 按原样支持,您应该能够连接支持此配置文件的任意设备。我使用 iPhone 上的个人热点将我的 Android 手机连接到我的 iPhone,Android 可以毫无问题地使用共享的互联网连接。
我找到了Raspberry Pi Bluetooth iPhone Tethering教程,该教程似乎准确地描述了您正在尝试做的事情。为了将来参考,我在此处复制步骤:
安装蓝牙包
sudo aptitude install bluetooth bluez-utils bluez-compat
配对设备,这是棘手的部分
pi@raspberrypi ~ $ hcitool scan
Scanning ...
18:34:51:55:B0:D8 Fanboy ][
pi@raspberrypi ~ $
pi@raspberrypi ~ $ grep KeyboardDisplay /usr/bin/bluez-simple-agent
capability = "KeyboardDisplay"
pi@raspberrypi ~ $ sudo perl -i -pe 's/KeyboardDisplay/DisplayYesNo/' /usr/bin/bluez-simple-agent
pi@raspberrypi ~ $ grep DisplayYesNo /usr/bin/bluez-simple-agent
capability = "DisplayYesNo"
pi@raspberrypi ~ $
pi@raspberrypi ~ $ sudo bluez-simple-agent hci0 18:34:51:55:B0:D8
RequestConfirmation (/org/bluez/18868/hci0/dev_18_34_51_55_B0_D8, 160178)
Confirm passkey (yes/no): yes
Release
New device (/org/bluez/18868/hci0/dev_18_34_51_55_B0_D8)
pi@raspberrypi ~ $
pi@raspberrypi ~ $ sudo bluez-test-device trusted 18:34:51:55:B0:D8 yes
打开个人热点
pi@raspberrypi ~ $ echo "echo 'iface bnep0 inet dhcp' >> /etc/network/interfaces" | sudo sh
pi@raspberrypi ~
$ sudo pand -c 18:34:51:55:B0:D8 -role PANU --persist 30
享受
pi@raspberrypi ~ $ ifconfig bnep0
bnep0 Link encap:Ethernet HWaddr e0:91:53:61:0f:74
inet addr:172.20.10.10 Bcast:172.20.10.15 Mask:255.255.255.240
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:14 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4426 (4.3 KiB) TX bytes:802 (802.0 B)
所有学分都转到http://www.wolfteck.com/以提供这些详细说明。