By Miguel Acosta Del Vecchio
Portfolio Website: https://miguelacostadelvecchio.github.io/MiguelAcostaPortfolio/
Linkedin: https://www.linkedin.com/in/miguel-acosta7
Youtube: https://www.youtube.com/@miguelacosta808
Instagram: https://www.instagram.com/miguelacostadel
Demonstration
https://www.youtube.com/watch?v=K2aWxgQEayY
General Information
The objective of this article is to create an iOS app in which the user has the ability to scan for Bluetooth peripherals, connect/disconnect to those devices, and if the device is a Raspberry Pi 4 then the user can choose to toggle any of the togglable GPIO pins.
What even is a Bluetooth device?
- A Bluetooth device can be either a central or peripheral:
- Central: the object that receives data from a Bluetooth device → iPhone
- Peripheral: the Bluetooth device that publishes data to be consumed by other devices → Raspberry Pi or Whoop
- If you can connect to it via BLE (Bluetooth Low Energy) wireless technology, the Core Bluetooth framework can connect to it.
Advertising Packets
- Bluetooth peripherals broadcast some of the data they have in the form of advertising packets
- These packets can contain information such as the peripheral’s name, main functionality, and extra information such as what kind of data the peripheral can provide.
- The job of the central is to scan for these advertising packets, identify any peripherals it finds relevant, and connect to individual devices for more information.
Services & Characteristics
- Advertising packets are very small and cannot contain a great deal of information. To share more data, a central needs to connect to a peripheral.