问题标签 [iobluetooth]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
4626 浏览

c - l2cap 服务器/客户端使用 IOBluetooth(osx 蓝牙堆栈)

我无法理解用于设置在 OSX 上运行的 l2cap(或 RFCOMM)客户端/服务器的 API,就像在 Linux 上使用 BlueZ 一样。

在 Linux 上,我只需打开一个套接字,绑定,侦听然后接受服务器,然后套接字,绑定,连接客户端(使用绑定获取我要使用的设备的 BT 地址)。此外,没有完成配对。

我不知道如何配置我的应用程序以开始侦听特定设备上的连接(或者如果 OSX 一次仅支持 1 个 BT 适配器,那么如何侦听任何传入连接)。

我也无法弄清楚如何配置我的应用程序以使用特定设备发送到一个 BT 设备(如果 OSX 一次只支持 1 个,这无关紧要)。

此外,OSX 堆栈是否需要在通过 l2cap 之前在 2 个设备之间进行配对?

任何语言示例都将受到赞赏,尽管 C/C++ 将是首选。

谢谢

0 投票
1 回答
1980 浏览

macos - Mac OS X/蓝牙:以编程方式禁用简单配对?

开发工具 (/Developer/Applications/Utilities/Bluetooth/) 中的蓝牙资源管理器应用程序允许您关闭设备上的简单配对。(运行应用程序,选择菜单项:“实用程序>获取本地设备信息”,然后单击“简单配对”选项卡)。

第三方应用程序将如何做到这一点?

0 投票
1 回答
12213 浏览

objective-c - Mac OS X 蓝牙编程示例?

我正在尝试在我的 Mac mini 中使用蓝牙开发应用程序。然而,在网上搜索后,我只能找到苹果的“蓝牙设备访问指南”,而不是一个示例程序!

任何人都可以为此提供任何示例代码吗?

我想在我的程序中做的事情:

我想通过 PAN 配置文件以编程方式将我的 iPhone 与我的 Mac 配对,然后双向发送数据(流)。我手动配对它们,我成功地能够传输数据。我只想以编程方式做到这一点!

0 投票
7 回答
56336 浏览

ios - 如何以编程方式获取 iphone 中的蓝牙状态(开/关)

我试图以编程方式获取 iPhone/iPod 蓝牙的状态,无论它是打开还是关闭。是否可以使用一些 Apple API 或第三方 API。

0 投票
1 回答
1060 浏览

cocoa - IOBluetooth Synchronous Reads

Right now I'm working on a program using IOBluetooth and I need to have synchronous reads, i.e. I call a method, it writes a given number of bytes to the port, then reads a given number and returns them. I currently have a complex system of NSThreads, NSLocks, and NSConditions that, while it sort of works, is very slow. Also, after certain calls, I need to make sure there's no extra data, so I'd normally flush the buffer, but with IOBluetooth's asynchronous callback that's not possible - any thoughts on how to make sure that no matter what, all data received after a specific point is data that's received after that point?

I really haven't dealt at all with synchronization and multithreading of this type, since all the work I've done so far is using synchronous calls, so I'd appreciate any thoughts on the matter.

Here's the callback for incoming data (the "incomingData" object is NSMutableData):

And here's the method that waits until the given number of bytes has been received before returning the data object (this gets called from an alternate thread).

0 投票
1 回答
1136 浏览

objective-c - 如何在 Cocoa 中关闭蓝牙设备和声音设备?

我知道机场可以被 CoreWLAN 框架关闭。

所以,我认为可能有与蓝牙设备和声音设备相关的功能或框架。

我怎样才能关闭这些设备?

0 投票
2 回答
2230 浏览

iphone - 如何在 iPhone 编程中通过蓝牙发送图像?

我是一些 NSString,我只是加入他们并制作一个 NSString,然后我将那个 NSString 转换为 NSData 并通过蓝牙发送到其他 iPhone

但现在我必须发送带有上述数据的图像,

我怎样才能实现这样的概念?

但我想发送单个 NSData (UIImage+NSString),我怎么能????

0 投票
1 回答
1130 浏览

iphone - 如何使用 NSCoder 通过蓝牙传输图像和字符串?

我想使用 NSCoder 并通过蓝牙传输带有单个 NSData 的 NSString 和 UIImage

你可以简单地说,“我想通过蓝牙发送包含 UIImage 和 NSString 的 NSData”

帮帮我,,,

这是一个非常复杂的问题,两天以来我一直被困在这里:-(

0 投票
1 回答
2119 浏览

java - 蓝牙 Socket 连接如何在 Android 上工作?

我是蓝牙新手。我了解在 Android 上,我可以通过 BluetoothSocket 连接作为客户端连接到另一个蓝牙设备。如何处理收到的数据?数据以什么格式从服务器发送到客户端?

0 投票
1 回答
798 浏览

iphone - 什么 GKSession 每次尝试都没有连接?

在应用程序中,invitationDidFail 被调用,有时它连接正确,但有时它没有......

拒绝连接的可能原因是什么?

即使它不调用此方法,也可以确定该设备未与任何其他设备配对,那么有时它确实接受并调用didReceivedInvitation 方法,或者有时它通过调用invitationDidFail 拒绝的原因是什么。