我在事件后台模式下使用我的 ble 设备。所以我没有为此在 info.plist 中指定任何特殊内容。
我在这里有两个麻烦:
1) 在 iOS 5.1.1 中,事件出现时没有附件名称。因此,当应用程序在后台时来自 ble 的事件发生时,我会看到“”附件想要打开“MyAppName”
但在
- (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI
我在peripheral.name属性中看到了名称,并且 AdvertisementData 还包含键kCBAdvDataLocalName @"MyDeviceName"
2) 在 iOS 6.0.1 及更高版本中,事件并非来自后台,绝不...
我使用 ti cc2540 堆栈,这是我的广告结构:
// GAP - SCAN RSP data (max size = 31 bytes)
static const uint8 scanRspData[] =
{
// complete name
0x05, // length of this data
GAP_ADTYPE_LOCAL_NAME_COMPLETE,
'O',
'b',
'd',
'2',
// connection interval range
0x05, // length of this data
GAP_ADTYPE_SLAVE_CONN_INTERVAL_RANGE,
LO_UINT16( DEFAULT_DESIRED_MIN_CONN_INTERVAL ), // 100ms
HI_UINT16( DEFAULT_DESIRED_MIN_CONN_INTERVAL ),
LO_UINT16( DEFAULT_DESIRED_MAX_CONN_INTERVAL ), // 1s
HI_UINT16( DEFAULT_DESIRED_MAX_CONN_INTERVAL ),
// Tx power level
0x02, // length of this data
GAP_ADTYPE_POWER_LEVEL,
0 // 0dBm
};
static const uint8 advertData[] =
{
0x02, // length of this data
GAP_ADTYPE_FLAGS,
DEFAULT_DISCOVERABLE_MODE | GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED,
// service UUID, to notify central devices what services are included
// in this peripheral
0x03, // length of this data
GAP_ADTYPE_16BIT_MORE, // some of the UUID's, but not all
LO_UINT16( RPC_SERVICE_UUID ),
HI_UINT16( RPC_SERVICE_UUID ),
0x05, // length of this data
GAP_ADTYPE_LOCAL_NAME_COMPLETE,
'O', // 'O'
'b', // 'b'
'd', // 'd'
'2' //2
};
怎么了?请帮忙