简体   繁体   中英

iOS Advertising Interval (iPhone as Peripheral)

I'm using my iPhone as a Bluetooth peripheral device to share data with a raspberry pi. When I looked to set the appropriate scan length to ensure I discover the iPhone quickly, I realised I couldn't find any information on what advertising interval my iPhone will use. Does anyone know the value for this, whether it is a set value or whether it can be changed?

Apparently there's no way given by Apple to change the advertising interval.

What you can do is start and stop advertising based on a timer implementation. You can make use of an NSTimer in periodic configuration and turn advertising ON and OFF based on the period you wish using APIs startAdvertising and stopAdvertising.

For the matter of fact, in my tests I observed the advertising interval to be around 30ms which seems to be the default non-editable value.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM