简体   繁体   中英

Blutooth Peer To Peer Connection on iOS 7 using NSNetService

I'm trying to get the Objective C++ distributed object model working between iOS and OSX devices. Using WiFi, almost everything is fine; however, with iOS 7 Apple introduced the "includesPeerToPeer" property which should publish an NSNetService over Bonjour using Blutooth. I set the property like this:

self.netService.includesPeerToPeer = YES;

before calling

[self.netService publish];

This works fine wetween a MAC and any iOS Device running iOS 7 (given, the MAC and the device are paired before). However, the devices don't discover themselves over Blutooth.

I'm wondering, whether I missed something or anyboldy has a glue, why this is not working.

Well, got it. NSNetServiceBrowser now also has a new property called "includesPeerToPeer". When setting this to TRUE immediately after initialisation and before starting the search, devices find themselves.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM