Bluetooth Logo

Writing an SDK With Core Bluetooth

This entry is part 1 of 24 in the series Writing an SDK With Core Bluetooth

INTRODUCTION

In the next series of posts, I will walk through designing and implementing a very simple SDK (Software Development Kit), using Apple’s Core Bluetooth API.

Core Bluetooth is Apple’s method for interacting with Bluetooth devices; in particular, with devices that use Bluetooth Low Energy (BLE).

In the latest versions of Apple’s operating systems, Core Bluetooth will also support “Bluetooth Classic.”

SUPPORTED ON ALL APPLE DEVICES

Every Apple device, including Macs, Watches, iPhones, iPads, iPods, and TVs, will support your code, if you use Core Bluetooth.

It’s possible that the new support for Bluetooth Classic in Core Bluetooth will allow you also use “classic” Bluetooth on your devices.

In this initial series, I’ll just cover BLE, but I also want to explore BT Classic, using Core Bluetooth, in future series.

Read moreWriting an SDK With Core Bluetooth

Writing an SDK With Core Bluetooth – 00 – Prerequisites

This entry is part 2 of 24 in the series Writing an SDK With Core Bluetooth

BEFORE WE BEGIN

In order to proceed, we have to assume that we are all on the same page.

This is actually a fairly advanced-level tutorial, aimed at Apple-platform developers with some experience writing release-level applications.

There is no requirement to be an expert, or for particular expertise on any Apple platform (the tutorial is “platform-agnostic.” We can have experience writing iOS, MacOS, WatchOS or TVOS native apps, in Swift).

With this in mind, I will make some assumptions about the folks that want to use the tutorial:

Read moreWriting an SDK With Core Bluetooth – 00 – Prerequisites

Part One -You Can Skip All This, If You Want

This entry is part 4 of 24 in the series Writing an SDK With Core Bluetooth

At this point, I will take a few entries to run through the basic design and setup of our Core Bluetooth lesson.

I’ll discuss the application example that we’ll use (a “Magic 8-Ball” app), and the general design of the sample apps that I’ll provide.

Read morePart One -You Can Skip All This, If You Want

Writing an SDK With Core Bluetooth – 03 – Wireframes

This entry is part 6 of 24 in the series Writing an SDK With Core Bluetooth

USER INTERFACE WIREFRAMES

Remember that I will be providing the code to do all this. The lesson is on Bluetooth; not app development. I just wanted to make sure that we all understand the user experience for the apps.

Read moreWriting an SDK With Core Bluetooth – 03 – Wireframes

Writing an SDK With Core Bluetooth – 04 – Let’s SDK!

This entry is part 7 of 24 in the series Writing an SDK With Core Bluetooth

THIS REFLECTS MY PERSONAL PHILOSOPHY

I just wanted to make it clear that the approach, and the resulting structure that we will develop, is based upon my own personal experience and viewpoint. There are definitely other ways to do this; some, a bit simpler.

But I have been writing SDKs since the 1980s, and I think that my point of view “has legs,” so to speak.

Read moreWriting an SDK With Core Bluetooth – 04 – Let’s SDK!

Writing an SDK With Core Bluetooth – 05 – What’s Happening?

This entry is part 8 of 24 in the series Writing an SDK With Core Bluetooth

MAPPING OUT THE INTERACTION

At this point, we should review the behavior of the apps, determine what we think will be going on between the devices (in Bluetooth), and decide the structure of our exposed API.

We should start by mapping out a transaction diagram of messages and data.

Read moreWriting an SDK With Core Bluetooth – 05 – What’s Happening?

Writing an SDK With Core Bluetooth – 06 – One Lump, Or Two?

This entry is part 9 of 24 in the series Writing an SDK With Core Bluetooth

RUBBER, MEET ROAD. ROAD, MEET RUBBER

Now, it’s time for us to make some fundamental decisions about the SDK we’ll be designing.

STATE-HEAVY VS. STATE-LITE

For example, the app will have two distinct states: Peripheral and Central. Should these be reflected as a single API, with a set state, or should we actually provide two APIs, with the app loading the appropriate one for the state?

Read moreWriting an SDK With Core Bluetooth – 06 – One Lump, Or Two?

Writing an SDK With Core Bluetooth – 07 – Properties

This entry is part 10 of 24 in the series Writing an SDK With Core Bluetooth

WHAT DOES THE USER NEED?

One of the biggest issues that I have with many SDKs, is that they slavishly model the system they are representing. This is often not the most optimal way to present functionality to the user.

Bluetooth is a highly flexible system. It is used by millions of devices that each may have a very different dynamic from other devices, and Bluetooth needs to serve them all, so it is rather complex and flexible. Core Bluetooth does a relatively good job of simplifying the standard, but it is still fairly byzantine.

I like to start with the user; ask them what they want, and then make the SDK an interpreter between them and the interface. Hide that Bluetooth complexity, and boil it down to the basics for the user.

Read moreWriting an SDK With Core Bluetooth – 07 – Properties