• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Background advertising and Peripheral detection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Background advertising and Peripheral detection


  • Subject: Background advertising and Peripheral detection
  • From: Frederic Visticot <email@hidden>
  • Date: Wed, 26 Sep 2012 09:41:47 +0200

What I try to do:

1. iPhone5 is making advertising for a service (1804) (in background or foreground)
--> it works

2.iPhone4S is  scanning peripherals with "scanForPeripheralsWithServices"

Different use cases:

a) iPhone5 is advertising in foreground and iPhone4S is scanning in foreground for all services with duplicateKey = YES
---> it works

b) iPhone5 is advertising in background and iPhone4S is scanning in foreground for all services with duplicateKey = YES
---> it works

c)iPhone5 is advertising in foreground and iPhone4S is scanning in foreground for a dedicated service (1804) with duplicateKey = YES or duplicateKey = NO
--> Does not work

d)iPhone5 is advertising in background and iPhone4S is scanning in background for a dedicated service (1804) with duplicateKey = YES or duplicateKey = NO
--> Does not work

e) iPhone5 is advertising in background and iPhone4S is scanning in foreground for a dedicated service (1804) with duplicateKey = YES or duplicateKey = NO
--> Does not work


I would like to have the cases c &  d working  and more especialy d (both peripheral and central in background)

Can someone help me on that ?


I have made several BLE tests with external USB tags and I can correctly detect tags when app is in background. 
To scan in background I'm using the following parameters for the scanForPeripheralsWithServices method:
DuplicateKey: NO in option
The service I want to scan


I'have made a "packet sniffer" for the Iphone5 advertising:
a) in foreground: 32ms + serviceID in advertising packet
b) in background 180ms but no serviceId in advertising packet

b) helps me to understand why iPhone4S can not detect the iPhone5 when background mode (case e)


PS: of course my plist file includes the 2 "magic flags" for background more (central & peripheral)

Code to start the scan in different conditions:

 NSArray *services = [NSArray arrayWithObject:[CBUUID UUIDWithString:@"1804"]];

            NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool: <YES or NO>],

                                     CBCentralManagerScanOptionAllowDuplicatesKey, nil];

                        [_centralManager scanForPeripheralsWithServices: <nil, or services> options:options];

 _______________________________________________
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

  • Follow-Ups:
    • Re: Background advertising and Peripheral detection
      • From: Andras Kovi <email@hidden>
  • Prev by Date: Re: Null UUID Returned for CBPeripheral
  • Next by Date: Re: Background advertising and Peripheral detection
  • Previous by thread: Re: AVDTP Stream endpoint config in iOS (bug?)
  • Next by thread: Re: Background advertising and Peripheral detection
  • Index(es):
    • Date
    • Thread