CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.
TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Sep 2015 |
Maintained by Fernando Arellano.
A simple bluetooth manager block based to interact with peripherals for iOS
Just use cocoapods pod 'FABluetoothManager'
See Cocoapods
FABluetoothManager *manager = [FABluetoothManager manager];
To start searching for peripherals use the function bellow:
Note : We're using nil as a value for services to find all the peripherals but this is something you won't do on a real enviroment. See Apple Bluetooth
[manager startSearchingForPeriphetals:^(NSArray *peripherals, NSError *error) {
NSLog(@"%@",peripherals);
} services:nil];
Before do any kind of comunication we need to connect to it.
ConnetPeripheralBlock completionBlock = ^(CBPeripheralState state, NSError* error){
if (state == CBPeripheralStateConnected) {
// Optional you can look for services
// [self discoverServices:nil
// peripheral:peripheral
// completion:servicesBlock];
} else {
block(nil, error);
}
};
[manager connectToPeripheral:peripheral completion:completionBlock];
Notifications Finish the README. Fix typos
Fernando Arellano ([email protected])