Apple & iOS
AuraScore 79/100

Medical Peripheral CoreBluetooth Connectivity and Telemetry Framework

Architect a fault-tolerant CoreBluetooth integration framework for continuous medical device telemetry on iOS.

Use this template when building iOS companion applications for wearable medical devices, monitors, or biosensors. It defines connection lifecycle states, background telemetry handling, and automatic recovery protocols.

Template

Role: Senior iOS Embedded Systems Engineer specializing in CoreBluetooth medical device integration.

Context

  • Medical Hardware Category: {{medical_device_type}}
  • Primary GATT Service UUID: {{ble_service_uuid}}
  • Background Execution Strategy: {{background_mode_requirement}}
  • Target Data Throughput: {{data_throughput_target}}
  • Reconnection SLA: {{reconnection_sla}}
  • Power Consumption Profile: {{battery_profile}}

Task

Produce an operational CoreBluetooth state management framework that ensures continuous, lossless data transfer from {{medical_device_type}} to an iOS client under {{background_mode_requirement}} constraints.

Method

  1. Specify the CBCentralManager initialization sequence with explicit state-preservation keys for app suspension.
  2. Map GATT service discovery routines targeting {{ble_service_uuid}} to minimize peripheral connection latency.
  3. Define MTU negotiation and packet fragmentation rules tailored to {{data_throughput_target}}.
  4. Design a peripheral reconnection state machine capable of meeting the {{reconnection_sla}} target.
  5. Structure characteristic notification subscription and backpressure handling to preserve {{battery_profile}}.
  6. Formulate background wake-up data parsing and buffer management routines without dropping sensor packets.
  7. Detail CoreBluetooth error handling strategies for RSSI drop, hardware resets, and unexpected disconnections.

Constraints

  • MUST implement CBCentralManagerOptionRestoreIdentifierKey for state restoration across process termination.
  • MUST NOT execute continuous peripheral scanning without service UUID filters.
  • MUST rate-limit peripheral writes to prevent UI thread blocking and BLE queue overflow.
  • Keep all architectural recommendations compliant with Apple Bluetooth Accessory Design Guidelines.

Output format

Deliver the connectivity framework organized as follows:

  1. State Machine Architecture (Listing states: Disconnected, Scanning, Connecting, Discovered, Streaming, Reconnecting)
  2. Telemetry Ingestion Contract (Packet structure, MTU sizing, and buffer limits)
  3. Power & Background Lifecycle Map (Handling app active, background, suspended, and killed states)
  4. Bluetooth Error Resolution Guide (Specific actions for CBError codes)

Self-review

  • Ensure the reconnection state machine explicitly addresses the {{reconnection_sla}} constraint.
  • Verify background preservation keys are properly integrated in the architecture steps.
  • Confirm the throughput calculations respect {{data_throughput_target}} limitations.
AuraScore breakdown
79/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 engineering10/12 · Adequate

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
medical-devices
ble