Cocoa 的蓝牙示例代码 (Objective-C)

发布于 2024-12-11 12:51:46 字数 378 浏览 0 评论 0原文

我正在寻找使用 Cocoa 中的蓝牙 API 建立与蓝牙设备的连接的示例代码。 Apple 过去将此类示例代码包含在 /Developer/Examples/Bluetooth 文件夹下的 XCode 工具包中,但在下载最新版本的 XCode (3.2.1) 后,这些蓝牙示例已从该目录中删除。

现在有一个位于 /Developer/Examples/ReadMe.rtf 的自述文件,其中解释了所有示例代码都位于 ADC 网站上。但是,ADC 网站似乎不包含蓝牙示例代码。

我尝试过谷歌搜索,但我似乎找不到任何关于如何使用 Cocoa 在 Mac OS X 上使用蓝牙的好例子。有人可以帮我吗?我希望在更新到 XCode 3.2.1 之前已将这些示例复制到备份位置!诅咒吧,苹果!你为什么把它们从我身边夺走?

I'm looking for example code for setting up a connection to a bluetooth device using the Bluetooth API in Cocoa. Apple used to include this type of example code in the XCode tools package under the /Developer/Examples/Bluetooth folder, but upon downloading the latest version of XCode (3.2.1), these bluetooth examples have been removed from that directory.

There is now a readme file located at /Developer/Examples/ReadMe.rtf that explains that all example code is on the ADC website. However, it seems that the ADC website does NOT include bluetooth sample code.

I've tried googling, but I can't seem to find any good examples for how to get bluetooth going on Mac OS X with Cocoa. Can anybody help me out? I wish I had copied those examples to a backup location before updating to XCode 3.2.1! Curses, Apple! Why have you taken them from me?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

月牙弯弯 2024-12-18 12:51:46

我最近检查了我的备份来查看这段代码,并将其发布以防有人想查看它。

http://cs.dal.ca/~mcormier/Bluetooth.zip

请注意如果您计划在 iOS 设备上使用蓝牙,那么您需要使用 Game Kit 点对点连接 API,而不是此代码。

I recently went through my backups to look at this code and have posted it in case anyone wants to look at it.

http://cs.dal.ca/~mcormier/Bluetooth.zip

Please note that if you plan on working with Bluetooth for iOS devices then you want to use the Game Kit Peer-to-Peer Connectivity API and not this code.

浪漫之都 2024-12-18 12:51:46

Let Apple know you need these by filing a bug report (enhancement request) at https://bugreport.apple.com.

々眼睛长脚气 2024-12-18 12:51:46

您可以执行我所做的操作:下载 XCode 的旧副本并使用 Pacifist 提取您需要的内容。

You can do what I've done: download an old copy of XCode and use Pacifist to extract what you need.

风筝有风,海豚有海 2024-12-18 12:51:46

这个(http://www.devx.com/wireless/Article/43502 /0/page/1)显示了 GameKit 蓝牙与 ipad、iphone 和 ipod 的连接,我相信。我让代码可以工作和运行,但无法与另一个打开蓝牙的设备连接,但只有我的手机正在运行使用此代码构建的应用程序。那么也许两者都需要运行它?无论如何,希望它能有所帮助,我还在研究一个更好的教程,在其中我可以实际连接到蓝牙设备,而不仅仅是 ipad、iphone 或 ipod。如果我写的东西有效,我会确保在这里写博客:博客

This (http://www.devx.com/wireless/Article/43502/0/page/1) shows the GameKit bluetooth to connect with ipads, iphones and ipods I believe. I got the code to work and run but couldn't connect with another device whoose bluetooth was on but only my phone was running the application built with this code. So maybe both need to run it? Anyways, hope it helps a bit, I'm also researching a better tutorial where I can actually connect to bluetooth devices and not just ipad, iphone or ipods. If I write something that works, i'll make sure to blog about it here: blog.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文