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):
Uses Bluetooth LE Accessories
Additionally, the following entries must be added to your project's Info.plist
:
Key: Privacy - Bluetooth Always Usage Description
Key: Privacy - Bluetooth Peripheral Usage Description
The following classes provide key functionality to apps incorporating this framework.
DeviceManager
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 a String
BLE UUID identifier, value is the Probe
object)getProbes()
- Function that returns array representation of the Probe
objects in the probes
dictionary.Probe
(subclass of Device
)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, where values[0]
is temperature sensor T1, and values[7]
is temperature sensor T8.
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 the Probe
, as directed by the connect()
and disconnect()
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), or false
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 the status
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.
temperatureLog.dataPoints
array. These are instances of the struct LoggedProbeDataPoint
, which contains the point's sequence number and corresponding ProbeTemperatures
struct as explained above.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")
}
}
}
link |
Stars: 11 |
Last commit: Yesterday |
Full Changelog: https://github.com/combustion-inc/combustion-ios-ble/compare/0.11.0...1.0.0
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics