[英]Connect to BLE device and send/read data via NSNetService on iOS 7
I have an iPhone app which communicates with external device via NSNetService
. 我有一个iPhone应用程序,可通过
NSNetService
与外部设备进行NSNetService
。 Now I want to add support for bluetooth. 现在,我想添加对蓝牙的支持。 So I would like to discover and connect to device via bluetooth (BLE) and when connected I would like to send/receive data via
NSNetService
, so I reuse existing code... 所以我想通过蓝牙(BLE)发现并连接到设备,连接后我想通过
NSNetService
发送/接收数据,所以我可以重用现有代码...
Is this possible on iOS7+? 在iOS7 +上可以吗? Any example/hint would be much appreciated.
任何示例/提示将不胜感激。
NSNetService uses TCP/IP and multicast DNS. NSNetService使用TCP / IP和多播DNS。 Bluetooth Low Energy does not implement a TCP/IP network and so NSNetService cannot be applied to BLE connections.
低功耗蓝牙不实现TCP / IP网络,因此NSNetService无法应用于BLE连接。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.