是否可以在我的移动电话和传感器之间建立连接而不进行同步?
我扫描设备,发现我的传感器(出现在没有同步的列表中),但是当我尝试与它同步时,传感器从列表设备(最近发现)中消失,没有理由,所以我不能同步它们.
我正在使用摩托罗拉Razr中的Bluetooh Low Energy开发并使用摩托罗拉提供的蓝牙LE API:http://developer.motorola.com/docs/bluetooth-low-energy-api/
提前致谢!
编辑:只是为了澄清我的问题,这个问题(最后一段)是在内部应用程序中管理Android操作系统中的BT连接,而不是在我的应用程序中.
我只是想知道是否可以连接没有配对的设备并使用蓝牙低功耗(重要提示).
我正在为"蓝牙找我档案"的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)
怎么了?
我目前正在使用BEACONinside的BLE信标开发一个展示应用程序.我已将我的应用程序设置为我的两个信标范围(因此有2 Region
秒).这工作正常,我收到所有的回调和我需要的所有信标信息.
我正在监控报告的距离并注意到它不会立即更新距离值,而是逐渐更新.每次回调都会让我看到报告的距离缓慢下降,即使我跑向信标.这意味着,即使有一个(用于测试)非常低的扫描间隔,我到达了信标,仍然需要等待十秒钟才能报告距离以反映接近度.
这是否有原因,我可以调整设置以立即更新吗?
我的场景只是放置在不同点的两个信标,我想在接近它们时触发一个动作.因此,使用范围而不是监控将是方法,对吗?目前我比较了最后三次测量,看看我是否更接近灯塔.
谢谢!
android bluetooth-lowenergy ibeacon-android android-ibeacon altbeacon
传感器宣传这些蓝牙LE套餐:
> 04 3E 26 02 01 03 01 B8 AB C0 5D 4C D9 1A 02 01 04 09 09 38
42 42 41 43 34 39 44 07 16 09 18 47 08 00 FE 04 16 0F 18 5B
B3
> 04 3E 26 02 01 03 01 B8 AB C0 5D 4C D9 1A 02 01 04 09 09 38
42 42 41 43 34 39 44 07 16 09 18 45 08 00 FE 04 …
Run Code Online (Sandbox Code Playgroud) 我已将通知设置为android,它不是调用方法onCharacteristicRead()
???? 它不会进入该功能.为什么会这样?
任何帮助表示赞赏
请求解决方案.
这是我的代码:
private final BluetoothGattCallback mGattCallback = new BluetoothGattCallback() {
@Override
public void onConnectionStateChange(BluetoothGatt gatt, int status,
int newState) {
if (newState == BluetoothProfile.STATE_CONNECTED) {
Log.i(TAG, "Connected to GATT server.");
// Attempts to discover services after successful connection.
Log.i(TAG, "Attempting to start service discovery:"
+ mBluetoothGatt.discoverServices());
} else if (newState == BluetoothProfile.STATE_DISCONNECTED) {
Log.i(TAG, "Disconnected from GATT server.");
}
}
@Override
public void onServicesDiscovered(BluetoothGatt gatt, int status) {
if (status == BluetoothGatt.GATT_SUCCESS) {
gattServices = …
Run Code Online (Sandbox Code Playgroud) java android bluetooth android-notifications bluetooth-lowenergy
我怎样才能重建bluez?可能吗?让我们说我想在avctp.c中改变一些东西.我从他们的网站下载最新的bluez版本并进行我需要做的更改.现在,我如何让变更有效; 即我需要做什么才能重建bluetoothd?
注意:我使用的是Ubuntu 12.04
我正在尝试使用以下代码读取特征并获取其值
private byte[] val;
mBluetoothLeService.readCharacteristic(characteristic);// reads it
val=characteristic.getValue();
String s=new String(val);
Run Code Online (Sandbox Code Playgroud)
我的应用程序崩溃给出错误"应用程序可能在其主线程上做了太多工作."
我也试过了
private String s;
mBluetoothLeService.readCharacteristic(characteristic);// reads it
s=characteristic.getStringValue(0);
Run Code Online (Sandbox Code Playgroud)
但错误是一样的
我调试了我的代码以检查它是否获得了值
private String s;
mBluetoothLeService.readCharacteristic(characteristic);// reads it
s=characteristic.getStringValue(0);
system.out.println(s);
Run Code Online (Sandbox Code Playgroud)
它显示正确的值,但在运行代码为Android App时.我犯了同样的错误.
当我读到有关数据交易的书时,
它提到一旦建立连接,两个设备都可以在事务之间进入深度睡眠状态.
我不太明白在交易过程中会发生这种情况.有谁能解释一下?
谢谢
我正在尝试显示所有可用的BLE信标.我有一些Estimote和Kontakt.io信标,由于某种原因,下面的BLE扫描代码找不到任何一个.
我经历了与BLE发现有关的所有可能的SO问题,并且代码与其他地方完全一样.
- (void)viewDidLoad {
[super viewDidLoad];
self.manager = [[CBCentralManager alloc] initWithDelegate:self queue:nil];
}
/*
Request CBCentralManager to scan for all available services
*/
- (void) startScan
{
NSLog(@"Start scanning");
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], CBCentralManagerScanOptionAllowDuplicatesKey, nil];
[self.manager scanForPeripheralsWithServices:nil options:options];
}
Run Code Online (Sandbox Code Playgroud)
永远不会调用此委托方法
/*
Invoked when the central discovers bt peripheral while scanning.
*/
- (void) centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)aPeripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI
{
NSLog(@"THIS NEVER GETS CALLED");
}
Run Code Online (Sandbox Code Playgroud) 我已经实现了一个应用程序来检查蓝牙是否使用CoreBluetooth.framework进行开/关,但是当我在我的iphone 3GS设备上运行该应用程序时,它显示该设备不支持蓝牙低功耗.请任何人帮我这个或只是暗示支持iphone 3GS的任何其他蓝牙API也很明显.
谢谢