Apple & iOS
AuraScore 81/100

Medical Peripheral CoreBluetooth Integration Specification

Architect reliable CoreBluetooth background streaming and packet parsing for Class II medical hardware.

Use this template when building an iOS connectivity driver for Bluetooth LE pulse oximeters, ECG monitors, or continuous glucose sensors. It details state restoration, characteristic parsing, and secure local buffering.

Template

Role: Lead iOS Firmware & CoreBluetooth Systems Engineer specializing in regulated medical peripheral connectivity and BLE drivers.

Context

  • Medical hardware device: {{medical_device_model}}
  • Target BLE Service and Characteristic UUIDs: {{ble_service_uuids}}
  • Continuous vital metric definitions: {{vital_metric_definitions}}
  • Disconnect recovery policy: {{connection_retry_policy}}
  • Proprietary packet binary encoding: {{hardware_packet_encoding}}
  • Local enclave storage destination: {{hipaa_enclave_storage_target}}

Task

Author an end-to-end technical engineering specification for integrating {{medical_device_model}} via CoreBluetooth, ensuring uninterrupted vital sign streaming, state restoration, and encrypted packet ingestion.

Method

  1. Specify CBCentralManager instantiation including CBCentralManagerOptionRestoreIdentifierKey configuration.
  2. Define peripheral discovery, RSSI filtering, and secure bonding flows targeting {{ble_service_uuids}}.
  3. Architect the CBPeripheralDelegate packet parsing engine decoding {{hardware_packet_encoding}} into {{vital_metric_definitions}}.
  4. Design the reconnection state machine implementing {{connection_retry_policy}} to handle out-of-range events.
  5. Detail the background execution preservation strategy to process vital telemetry when the app is suspended or terminated.
  6. Specify the buffering pipeline streaming decoded metrics into {{hipaa_enclave_storage_target}}.
  7. Establish hardware telemetry diagnostics to detect packet drops, checksum failures, and peripheral battery degradation.

Constraints

  • MUST implement CBCentralManager state restoration to guarantee background reconnection across app reboots.
  • MUST NOT process unvalidated raw binary packets without cyclic redundancy checks (CRC).
  • Bluetooth read/write latency MUST NOT exceed 250 milliseconds during active vital streaming.
  • Memory allocations inside peripheral(_:didUpdateValueFor:error:) MUST remain strictly zero-allocation on the main thread.
  • Output length MUST remain bounded between 650 and 950 words.

Output format

Provide the specification formatted under these standard section titles:

  1. CBCentralManager Architecture & State Restoration
  2. GATT Service Discovery & Security Pairing
  3. Binary Packet Parsing & CRC Verification Engine
  4. Reconnection Lifecycle & Fault Tolerance
  5. Local Enclave Ingestion & Metric Storage

Self-review

  • Verify that all Service UUIDs in {{ble_service_uuids}} are mapped to distinct characteristic handlers.
  • Ensure the background restoration logic explicitly addresses iOS memory termination scenarios.
  • Confirm that payload conversion from {{hardware_packet_encoding}} to {{vital_metric_definitions}} has defined validation bounds.
AuraScore breakdown
81/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering12/12 · Strong

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness3/5 · Adequate

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

developers
developers-apple
healthcare-life-sciences
corebluetooth
ios
medical-devices