CoreBluetooth (bluetooth 4.0) を使用して iPhone 経由で Raspberry Pi に接続しようとしています。デバイスを検出し、次のコードを使用して接続要求を送信します。
if (peripheral != self.foundPeripheral) {
NSLog(@"Try to connect to %@", peripheral.name);
self.foundPeripheral = peripheral;
[self.centralManager stopScan];
[self.centralManager connectPeripheral:peripheral options:nil];
}
didConnectPeripheral も didFailedToConnectPeripheral も呼び出されません。また、Bluetooth Low Energy を使用してアドバタイズするように RPi を設定するようにしました。
sudo hciconfig hci0 leadv
しかし、アクティブな接続を確認すると
hcitool con
アクティブな接続はありません。RPi のセットアップが不足していますか? また、ペリフェラルの name 変数が空白になっていますが、これはまだ接続していないためですか?