LGBluetooth alternatives and similar libraries
Based on the "Bluetooth" category.
Alternatively, view LGBluetooth alternatives based on common mentions on social networks and blogs.
-
BabyBluetooth
:baby: The easiest way to use Bluetooth (BLE )in ios/os ,even bady can use . 一个非常容易使用的蓝牙库,适用于ios和os -
PeerKit
An open-source Swift framework for building event-driven, zero-config Multipeer Connectivity apps -
Discovery
A very simple library to discover and retrieve data from nearby devices (even if the peer app works at background). -
CocoaMultipeer
This repository is a peer to peer framework for OS X, iOS and watchOS 2 that presents a similar interface to the MultipeerConnectivity framework (which is iOS only) that lets you connect any 2 devices from any platform. This framework works with peer to peer networks like bluetooth and ad hoc wifi networks when available it also falls back onto using a wifi router when necessary. It is built on top of CFNetwork and NSNetService -
ExtendaBLE
Blocks Based Bluetooth LE Connectivity framework for iOS/watchOS/tvOS/OSX. Quickly configure centrals & peripherals, perform read/write operations, and respond characteristic updates. -
AZPeerToPeerConnection
AZPeerToPeerConnectivity is a wrapper on top of Apple iOS Multipeer Connectivity framework. It provides an easier way to create and manage sessions. Easy to integrate
CodeRabbit: AI Code Reviews for Developers

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of LGBluetooth or a related project?
README
LGBluetooth
Simple, block-based, lightweight library over CoreBluetooth.
Steps to start using
Drag and Drop it into your project
Import "LGBluetooth.h"
You are ready to go!
Usage
For example we have a peripheral which has "5ec0" service, with 3 characteristics
- "cef9" characteristic is writable
- "f045" characteristic is readable
- "8fdb" characteristic is readable
(IBAction)testPressed:(UIButton *)sender { [[LGCentralManager sharedInstance] scanForPeripheralsByInterval:4 completion:NSArray *peripherals { if (peripherals.count) { [self testPeripheral:peripherals[0]]; } }]; }
(void)testPeripheral:(LGPeripheral *)peripheral {
// First of all, opening connection [peripheral connectWithCompletion:NSError *error { // Discovering services of peripheral [peripheral discoverServicesWithCompletion:NSArray *services, NSError *error { // Searching in all services, our - 5ec0 service for (LGService *service in services) { if ([service.UUIDString isEqualToString:@"5ec0"]) { // Discovering characteristics of 5ec0 service [service discoverCharacteristicsWithCompletion:NSArray *characteristics, NSError *error { __block int i = 0; // Searching writable characteristic - cef9 for (LGCharacteristic *charact in characteristics) { if ([charact.UUIDString isEqualToString:@"cef9"]) { [charact writeByte:0xFF completion:NSError *error { if (++i == 3) { [peripheral disconnectWithCompletion:nil]; } }]; } else { // Otherwise reading value [charact readValueWithBlock:NSData *data, NSError *error { if (++i == 3) { [peripheral disconnectWithCompletion:nil]; } }]; } } }]; } } }]; }]; }
After running code we can see the result.
In this example I'm scanning peripherals for 4 seconds. After which I am passing first peripheral to test method.
Test method connects to peripheral, discoveres services, discoveres characteristics of "5ec0" service. After which reads "f045", "8fdb", and writes 0xFF to "cef9" and disconnects from peripheral.
Here is the log from console Connection with error - (null) Service discovered - Battery Service discovered - Current Time Service discovered - Unknown (5ec0) Characteristic discovered - Unknown (cef9) Characteristic discovered - Unknown (f045) Characteristic discovered - Unknown (8fdb) Characteristic - Unknown (cef9) wrote with error - (null) Characteristic - Unknown (f045) value - 1234567890 error - Characteristic - Unknown (8fdb) value - 11111111111 error - (null) Disconnect with error - (null)
Alternative use
You can make basic read/write via LGUtils class. Note : This methods do NOT need active connection to peripheral, they will open a connection if it doesn't exists.
Read example [LGUtils readDataFromCharactUUID:@"f045" serviceUUID:@"5ec0" peripheral:peripheral completion:NSData *data, NSError *error { NSLog(@"Data : %s Error : %@", (char *)[data bytes], error); }];
Write example int8_t dataToWrite = 0xFF; [LGUtils writeData:[NSData dataWithBytes:&dataToWrite length:sizeof(dataToWrite)] charactUUID:@"cef9" serviceUUID:@"5ec0" peripheral:peripheral completion:NSError *error { NSLog(@"Error : %@", error); }];
Reasons of using LGBluetooth As we know CoreBluetooth is very hard to use - The methods of objects in Core bluetooth are messy
For example connectPeripheral:options: is written in CBCentralManager, discoverCharacteristics:forService is written in Peripheral, writeValue:forCharacteristic:type, readValueForCharacteristic are also in Peripheral
This messy code makes CoreBluetooth development really painfull. For example if you need to read characteristic value, you need to call "connect" on central object, wait for Central delegate callback, After that call "discover services", wait peripheral delegate callback, "discover characteristic" which you planned and wait for delegate callback, "readValue" and again wait for delegate callback. What will happen if your program will make 2 connections at once? Handling such cases makes messy code, and raises hundred of bugs.
Don't worry, now you can forgot about that hell - LGBluetooth uses blocks for callbacks, you can start using modern code and hierarchical calls.
Installation with CocoaPods
CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries installation in your projects.
Podfile
pod "LGBluetooth", "~> 1.1.5"
LICENSE LGBluetooth is under MIT License (see LICENSE file)
*Note that all licence references and agreements mentioned in the LGBluetooth README section above
are relevant to that project's source code only.