Re: Peripheral for advertising static data
Re: Peripheral for advertising static data
- Subject: Re: Peripheral for advertising static data
- From: Andras Kovi <email@hidden>
- Date: Tue, 19 Feb 2013 23:18:26 +0100
Yeah, the overflow area is read by OS X. I tested it with a simulated heart rate monitor on an iPhone and used the sample app provided by Apple on the OS X side. But the device name was definitely not transmitted while the iPhone app was in background.
Andras On 2013.02.19., at 23:11, Etan Kissling < email@hidden> wrote:
Amin,
in addition to the explanations by Andras, please note that the overflow area is only
readable from iDevices and maybe OS X. You will run into issues
as soon as you want to create clients based on a different platform.
Also note, that iOS devices can manage multiple connections even in peripheral
role although this violates the Bluetooth Core Spec. Maybe you can work with
short connections to read the name; however, depending on your concurrency,
this may not match the timing requirements of your use case.
Etan
wrote:
Hi,
the name is not advertised in background. Quote from the documentation in the CBPeripheralManager.h file:
While an application is in the background, the local name will not be used and all service UUIDs will be placed in the "overflow" area.
You need to provide a characteristic to be able to transmit your static id and connection has to be established between the peers. This is not very good for many developers and induces a lot of discussion on this list. Maybe this will be changed in the
future, just like the disconnect timeout was reduced recently.
Regards,
Andras
Hi,
I'm developing two separate applications. One is dedicated for advertising a single static Id which does not need to get updated and the other app is just for scanning these advertisements to extract the id.
Since it's just a static ID to advertise, I have put my id as the name of the peripheral. So centrals without any need to make connection to peripheral, would be able to get advertisement packets and extract the id out of that. I put the the id in advertising
packet of peripheral as follow:
[self.peripheralManager
startAdvertising:@{
CBAdvertisementDataLocalNameKey : idToAdvertise,
CBAdvertisementDataServiceUUIDsKey : @[[CBUUID
UUIDWithString:kServiceUUID]]
}]; and I get idToAdvertise value in centrals as follow:
- (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData
RSSI:(NSNumber *)RSSI { self.peripheralStaticId = peripheral.name;
} Everything works great and as expected but only if the peripheral app remains in foreground. Once I put the peripheral in the background, it still advertises but instead of advertising the whole array (idToAdvertise and serviceUUID), it only advertises
serviceUUID. So in peripheral background mode, my centrals only know which serviceUUID is getting advertises but they couldn't know what's the name of the peripheral.
Could you please guide me how to advertise a static ID without making connection. SInce I want to have one to many functionality. A lot of devices need to get advertisements at the same time.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden