是否可以在Mac OS X上提供BLE服务?
从这里找到的CoreBluetooth文档http://developer.apple.com/library/mac/#documentation/CoreBluetooth/Reference/CBCentralManager_Class/translated_content/CBCentralManager.html看起来你可以扫描并连接到外围设备.我希望扮演一个perisperhal.
我有一个使用BTLE连接到设备(arduino)的iOS应用程序.我的iPad iOS 7上的一切正常.升级到iOS 8后,CBCentralManager找不到任何外围设备.
- (void)startScanningForSupportedUUIDs
{
[self.centralManager scanForPeripheralsWithServices:nil options:nil];
}
Run Code Online (Sandbox Code Playgroud)
我不知道会出现什么问题.
我希望继续扫描蓝牙设备,我希望应用程序在后台运行.可能吗?好像我有一个连接的蓝牙设备,如果有数据传输,那么该应用程序在后台保持清醒状态.但是,如果我只是在后台扫描,似乎即使我已经Uses Bluetooth LE accessories检查(bluetooth-central在plist中),应用程序最终也没有运行.
有没有办法让应用程序保持活动状态并在设备处于后台时连续扫描设备?
我99%确定我按照说明CoreBluetooth正确设置.无论我做什么,当我在我的iPad mini上运行这个应用程序时,蓝牙正在说它.它说它正在扫描设备,但绝对没有找到任何设备.如果我转到设备上的蓝牙菜单,我会看到其他设备被发现.我初始化了CBCentralManager.我安装好了centralManagerDidUpdateState.当确定蓝牙准备就绪时它就会打电话centralManager.scanForPeripheralsWithServices.所有这一切都正确发生.但我的代理功能centralManager(central: CBCentralManager!, didDiscoverPeripheral peripheral: CBPeripheral!, advertisementData: [NSObject : AnyObject]!, RSSI: NSNumber!)永远不会被调用.我的代码非常简单.也许我错过了一些东西,但我能够确认我的Macbook是BTLE设备而我的ipad mini也是BTLE设备.这是我的代码.
import UIKit
import CoreBluetooth
class ViewController: UIViewController, CBCentralManagerDelegate {
var centralManager:CBCentralManager!
var blueToothReady = false
override func viewDidLoad() {
super.viewDidLoad()
startUpCentralManager()
}
func startUpCentralManager() {
println("Initializing central manager")
centralManager = CBCentralManager(delegate: self, queue: nil)
}
func discoverDevices() {
println("discovering devices")
centralManager.scanForPeripheralsWithServices(nil, options: nil)
}
func centralManager(central: CBCentralManager!, didDiscoverPeripheral peripheral: CBPeripheral!, advertisementData: [NSObject : AnyObject]!, RSSI: NSNumber!) { …Run Code Online (Sandbox Code Playgroud) 我目前正在玩用于Android 4.3的蓝牙低功耗,目前还没有BLE信标,所以我的想法是用一个Android 4.3作为BLE服务器.但是如何创建客户端应用程序有很好的解释
http://developer.android.com/guide/topics/connectivity/bluetooth-le.html#close
几乎没有任何关于服务器,除了这个链接http://developer.android.com/reference/android/bluetooth/BluetoothGattServer.html
是否有一些教程或示例?
我正在为"蓝牙找我档案"的Android应用程序工作.我需要在'bluetooth find me profile'中获得与即时警报服务相关的所有android API.在"蓝牙找到我的配置文件"的情况下,服务器将提醒客户端.因此,为了开发配置文件,我需要获得与警报客户端相关的API.
我是使用BlueZ编程蓝牙低功耗的新手.
我想开发一个本机代码c,使用适用于Android 4.0.3的蓝牙低功耗BlueZ API扫描附近的设备.
有谁知道我应该使用哪种BlueZ方法?
使用scanForPeripheralsWithServices:选项时,我可以在使用时发现服务
// Scanning with nil services will return all devices.
NSLog(@"Looking for any service.");
[self.centralManager scanForPeripheralsWithServices:nil options:nil];
Run Code Online (Sandbox Code Playgroud)
但是,当使用通过以下代码从蓝牙设备获得的服务标识符预先指定服务时,我无法发现该设备.
#define DEVICE_INFO_SERVICE_UUID @"180a"
NSArray *services = [NSArray arrayWithObjects:[CBUUID UUIDWithString:DEVICE_INFO_SERVICE_UUID], nil];
[self.centralManager scanForPeripheralsWithServices:services options:nil];
Run Code Online (Sandbox Code Playgroud)
怎么了?
嗨,我最近开始研究信标.我正在为我的目的使用estimote信标.但我怀疑我们是否可以将我们的设备变成信标.如果没有原因.
谢谢.
我发现一个问题,从 iOS 15 升级到 iOS 16 后,iPhone/iOS 的 MTU 大小似乎有所减小。在升级到 iOS 16 之前,手机大小的 MTU 大小始终为 185 字节,这与大多数链接声称的相符iPhone 的最大 MTU 为(示例 1、示例 2和示例 3)。
不过,升级到 iOS 16 后,iPhone 发送的 MTU 减少至 77 字节。这对 iOS 应用程序使用相同的手机和完全相同的代码。我正在连接一个包含 nRF52 芯片组的可穿戴设备(即 iPhone 是中央设备,可穿戴设备是外围设备),并且始终发送 247 字节的 MTU 请求。
我成功捕获了嗅探器日志,显示 iPhone在使用iOS 15时以185 的 MTU进行回复(这是预期的):-
下面的嗅探器日志显示了 iPhone在使用iOS 16时如何发送减少了77 字节的 MTU:-
值得注意的一件事是,重新启动手机似乎暂时解决了问题,iPhone 的 MTU 响应恢复为 185 字节,但在几次连接后,iPhone 又开始发送 77 字节。重新启动 iPhone 上的蓝牙并不能解决问题,暂时解决此问题的唯一方法是重新启动手机。
我们成功地在 iPhone 11、iPhone 13 Pro …