1

Sorry for bad english :-(

I am starting with CoreBluetooth framework. i using write code like below for CoreBluetooth

[centralManager scanForPeripheralsWithServices:nil options:nil];

I took a look into apple reference, I do not understand that what's that serviceUUIDs?

- (void)scanForPeripheralsWithServices:(NSArray *)serviceUUIDs options:(NSDictionary *)options;

Please explain me.

user2864740
  • 60,010
  • 15
  • 145
  • 220
Taj rajan
  • 601
  • 1
  • 6
  • 20

1 Answers1

2

The NSUUID class creates UUID strings that are to uniquely identify types, interfaces, and other items.

UUIDs (Universally Unique Identifiers), also known as GUIDs (Globally Unique Identifiers) or IIDs (Interface Identifiers), are 128-bit values. UUIDs created by NSUUID conform to RFC 4122 version 4 and are created with random bytes.

more apple doc

Note:

It is Available from iOS 6

updated:

UUID

The Bluetooth-specific UUID of the service. (read-only)

@property(readonly, nonatomic) CBUUID *UUID

Discussion

This property is a 128-bit UUID that identifies the service.

Note:

Available in iOS 5.0 and later.

codercat
  • 22,873
  • 9
  • 61
  • 85
  • This is what a *UUID* is, but what is a *Service UUID*? Bluetooth UUIDs are *not* simply random opaque identifiers. – user2864740 Feb 15 '14 at 08:17
  • @iDev How to find UUDID when start app first time? – Taj rajan Feb 15 '14 at 08:19
  • I cant find UUID in CBCentralManager class. How to get list of bluetooth device? – Taj rajan Feb 15 '14 at 08:28
  • retrievePeripheralsWithIdentifiers and retrieveConnectedPeripheralsWithServices @Tajrajan – codercat Feb 15 '14 at 08:37
  • @iDev i dnt understand it. Please see url below http://stackoverflow.com/questions/21749580/never-seen-anything-in-corebluetooth-framework-about-keeping-the-connection-aliv – Taj rajan Feb 15 '14 at 08:47
  • @iDev never call didDiscoverPeripheral while app background mode. Some bodies told me that problem of scanForPeripheralsWithServices methods. How do get to call didDiscoverPeripheral while background mode. Do u know that? Please help me. – Taj rajan Feb 15 '14 at 08:57
  • refer this http://code.tutsplus.com/tutorials/ios-7-sdk-core-bluetooth-practical-lesson--mobile-20741 – codercat Feb 15 '14 at 09:06
  • @iDev Yes, I know that, but it is only for foreground. Never working Background mode. I can send u project. Can u check it? Please. – Taj rajan Feb 15 '14 at 09:44
  • where you sent i never get till – codercat Feb 15 '14 at 09:45
  • rajapitchai.p@gmail.com – codercat Feb 15 '14 at 09:54
  • @iDev sorry, u can download my simple project. Can u check it please. what i should do next coding. link below https://www.dropbox.com/s/cndj5tgdiw3svw6/EYSensorTagEx.zip plz download – Taj rajan Feb 15 '14 at 09:55
  • @iDev if u get any problem. Plz mail me tajrajaniosdeveloper@gmail.com – Taj rajan Feb 15 '14 at 10:10
  • Are you sure you're working with Bluetooth Low-Energy? Because if you don't understand an UUID, that's quite troublesome. – Larme Feb 16 '14 at 17:48