Latest 0.1.1
Homepage https://github.com/manGoweb/BLE
License MIT
Platforms ios 9.0, requires ARC
Authors

Version
License
Platform

Swift wrapper around CoreBluetooth. Library allows you to connect to BLE devices, read and write data to them

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

private let ble: BLE = BLE()

// Enable debug mode
self.ble.debugMode = true

// Set delegate
self.ble.delegate = self

// Scan for all devices
self.ble.startScanning(10) // Scan for 10 seconds

// Scan for some UUIDs only
self.ble.startScanning(10, serviceUUIDs: ["713D0000-503E-4C75-BA94-3148F18D941E"]) // Scan for 10 seconds

// Write three values to one service
var buffer: [UInt8] = [1, 0, 100]
let data: NSData = NSData(bytes: buffer, length: 3)
try! self.ble?.write(data, characteristicsUUID: "713D0003-503E-4C75-BA94-3148F18D941E")

Example application

Screenshot 1

Requirements

Needs to run on a device, not simulator

Installation

BLE is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "BLE"

Author

Ondrej Rafaj, [email protected]

License

BLE is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "BLE",
    "version": "0.1.1",
    "summary": "Simple BLE (Bluetooth Low Energy) wrapper library in Swift",
    "description": "Swift wrapper around CoreBluetooth. Library allows you to connect to BLE devices, read and write data to them",
    "homepage": "https://github.com/manGoweb/BLE",
    "screenshots": "https://raw.githubusercontent.com/manGoweb/BLE/master/_orig/home.png",
    "license": "MIT",
    "authors": {
        "Ondrej Rafaj": "[email protected]"
    },
    "source": {
        "git": "https://github.com/manGoweb/BLE.git",
        "tag": "0.1.1"
    },
    "social_media_url": "https://twitter.com/rafiki270",
    "platforms": {
        "ios": "9.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*"
}

Pin It on Pinterest

Share This