core-bluetooth

Scan, connect, and exchange data with Bluetooth Low Energy devices using iOS native APIs.

Updated May 10, 2026
One-click install
npx skills add https://github.com/FelixRauch/medat-figuren --skill core-bluetooth-felixrauch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: core-bluetooth
Source: https://github.com/FelixRauch/medat-figuren/tree/main/.agents/skills/core-bluetooth
Command: npx skills add https://github.com/FelixRauch/medat-figuren --skill core-bluetooth-felixrauch

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Core Bluetooth implementation problems—like scanning too early, losing peripheral references, mishandling characteristic properties, or failing to support background and restoration—make BLE integrations brittle and hard to debug.

Core Features & Use Cases

  • Central role workflows: scan for peripherals, connect, discover services/characteristics, and manage delegate callbacks.
  • Data exchange: read characteristic values, write with the correct write type, and subscribe to notifications for streaming updates.
  • Peripheral role workflows: advertise local services and characteristics via CBPeripheralManager.
  • Production-ready behaviors: background BLE modes and state restoration to survive app relaunches and BLE events.

Quick Start

Use this skill to implement a BLE central or peripheral in Swift by following the setup, scanning/connecting, characteristic discovery, and read/write/notify sections for your target UUIDs.

Frequently Asked Questions about core-bluetooth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scan for BLE peripherals and connect using CoreBluetooth in Swift?

To scan for BLE peripherals using CoreBluetooth in Swift, initialize a CBCentralManager, wait for the powered-on state, then use delegate callbacks to discover, connect, and manage CBPeripheral objects.

Why does my CoreBluetooth central manager fail to scan or connect?

CoreBluetooth central manager scanning or connection fails when CBCentralManager is used before receiving the powered-on state gate, requiring delegate-driven initialization to ensure the BLE hardware is ready.

How do I handle BLE background modes and state restoration in iOS?

Handle BLE background modes and state restoration in iOS by configuring background BLE modes and implementing CBCentralManager state restoration to survive app relaunches and background BLE events.

How do I read, write, and subscribe to BLE characteristic values safely?

Read, write, and subscribe to BLE characteristic values safely by checking characteristic properties before performing read, write with the correct write type, or notify operations via delegate callbacks.

Can I use CoreBluetooth to advertise my iOS device as a BLE peripheral?

Yes, you can advertise your iOS device as a BLE peripheral using CoreBluetooth by initializing a CBPeripheralManager and publishing local services and characteristics for other centrals to discover.

What is the best way to avoid losing BLE peripheral references during discovery?

The best way to avoid losing BLE peripheral references during discovery is maintaining strong references to CBPeripheral objects and following the delegate-driven service and characteristic discovery flow.