This package enables communication with Combustion Inc. Predictive Thermometers. It uses Apple's Combine framework, subclassing ObservableObject
to enable reactive UI development in SwiftUI (and is compatible with Storyboard approaches as well).
Discovered probes show up as instances of the Probe
class in the DeviceManager.shared.probes
dictionary, and their temperatures and other data are continually updated by incoming BLE advertising messages. Additionally, calling connect()
on an individual Probe
object will cause the framework to maintain a connection to that device, and will automatically download all logged temperature records on the device.
We build nice things that make cooking more enjoyable. Like a thermometer that's wireless, oven-safe, and uses machine learning to do what no other thermometer can: predict your food’s cooking and resting times with uncanny accuracy.
Our Predictive Thermometer's eight temperature sensors measure the temp outside and inside the food, in the center and at the surface, and nearly everywhere in between. So you know what’s really happening in and around your food. There's a display Timer that's big and bold—legible even through tears of joy and chopped onions—and a mobile app.
Or you can create your own mobile app to work with the Predictive Thermometer using this open source library.
Visit www.combustion.inc to purchase or learn more about the Predictive Thermometer.
Head on over to our FAQ for more product details.
Ask us a quick question on Twitter.
Email [email protected] for OEM partnership information.
An example iOS app illustrating the use of this framework is available in the combustion-ios-example repository.
Simply add this Github repository to your project via Swift Package Manager.
The following Capabilities need to be added to your Target (Signing & Capabilities tab in Target settings):
- Background BLE services
- Enable
Uses Bluetooth LE Accessories
- Enable
Additionally, the following entries must be added to your project's Info.plist
:
-
Key:
Privacy - Bluetooth Always Usage Description
- Value: Description of reason for Bluetooth access, e.g. "Bluetooth is used to communicate with hardware products."
-
Key:
Privacy - Bluetooth Peripheral Usage Description
- Value: Description of reason for Bluetooth access, e.g. "Bluetooth is used to communicate with hardware products."
The following classes provide key functionality to apps incorporating this framework.
DeviceManager
is an observable singleton class that maintains a dictionary of Probe
objects that have been discovered over BLE.
initBluetooth()
- Initialize Bluetooth and begin scanning for thermometersprobes
- Observable dictionary of probes (key is aString
BLE UUID identifier, value is theProbe
object)getProbes()
- Function that returns array representation of theProbe
objects in theprobes
dictionary.
An instance of the Probe
class representes an individual temperature probe that has been discovered via its advertising data. These are retrieved from the DeviceManager.shared.probes
dictionary.
-
serialNumber
- The Probe's unique serial number -
name
- String format of probe serial number -
macAddress
- Probe's MAC address -
macAddressString
- String representation of Probe's MAC address -
id
- Probe's numeric ID (1-8) -
color
- Probe's silicone ring color -
batteryStatus
- Battery status (OK or low) as reported by probe -
currentTemperatures
-ProbeTemperatures
struct containing the most recent temperatures read by the Probe.currentTemperatures.values
- Array of these temperatures, in celsius, wherevalues[0]
is temperature sensor T1, andvalues[7]
is temperature sensor T8.- T1 - High-precision temperature sensor in tip of probe
- T2 - High-precision temperature sensor
- T3 - MCU temperature sensor
- T4 - High-precision temperature sensor
- T5 - High-temperature thermistor
- T6 - High-temperature thermistor
- T7 - High-temperature thermistor
- T8 - High-temperature thermistor on handle tip measuring ambient
-
identifier
- iOS-provided UUID for the device -
rssi
- Signal strength between Probe and iOS device -
maintainingConnection
- Whether the app is currently attempting to maintain a connection with theProbe
, as directed by theconnect()
anddisconnect()
methods. -
connect()
- Attempts to connect to device, and instructs framework to attempt to maintain a connection to this probe if it is lost. -
disconnect()
- Instruct framework to disconnect from this probe, and to no longer attempt to maintain a connection to it. -
stale
-true
if no advertising data or notifications have been received from the Probe within the "staleness timeout" (15 seconds), orfalse
if recent data has been received. -
minSequenceNumber
- Minimum sequence number of log records stored on the probe -
maxSequenceNumber
- Maximum sequence number of log records stored on the probe -
percentOfLogsSynced
- Percent of all log sequence numbers contained in the probe (determined by thestatus
sequence number range) that have been successfully retrieved and stored in the app's memory. -
temperatureLog
-ProbeTemperatureLog
class instance containing all logged temperatures that have been retrieved from the device, and logic that coordinates automatically retrieving all past records when connected to a Probe.- Individual logged temperatures are provided in the
temperatureLog.dataPoints
array. These are instances of the structLoggedProbeDataPoint
, which contains the point's sequence number and correspondingProbeTemperatures
struct as explained above.
- Individual logged temperatures are provided in the
-
predictionInfo
-PredictionInfo
struct containing current prediction information -
virtualTemperatures
-VirtualTemperatures
struct containing current temperature for Virutal sensors (core, suface, ambient)
The framework also provides celsius()
and fahrenheit()
functions that convert temperatures between these two formats.
To use the Combustion BLE framework in your own Swift file, import it:
import CombustionBLE
In SwiftUI, a list of probes can be rendered like so:
struct EngineeringProbeList: View {
@ObservedObject var deviceManager = DeviceManager.shared
var body: some View {
NavigationView {
List {
ForEach(deviceManager.probes.keys.sorted(), id: \.self) { key in
if let probe = deviceManager.probes[key] {
NavigationLink(destination: EngineeringProbeDetails(probe: probe)) {
EngineeringProbeRow(probe: probe)
}
}
}
}
.navigationTitle("Probes")
}
}
}