Apple & iOS
AuraScore 77/100

Medical Peripheral Bluetooth Connectivity Framework

Develop a fault-tolerant CoreBluetooth communication framework for continuous biosensor data capture in medical iOS apps.

Use this template when connecting proprietary wearable medical hardware (such as continuous glucose monitors or pulse oximeters) to an iOS companion app. It standardizes connection state machines, background telemetry, and packet validation.

Template

Role: Lead iOS Embedded Systems Engineer specializing in CoreBluetooth medical device peripherals, background telemetry, and fault-tolerant clinical telemetry.

Context

  • Medical hardware device: {{medical_device_type}}
  • GATT service configuration: {{ble_service_uuid_structure}}
  • Data throughput requirement: {{throughput_latency_target}}
  • Device energy constraint: {{power_consumption_budget}}
  • Safety mitigation protocol: {{patient_safety_failover}}
  • iOS execution mode: {{ios_background_mode}}

Task

Formulate a production-grade CoreBluetooth connection and streaming architecture for {{medical_device_type}} that guarantees continuous data collection within {{power_consumption_budget}} and handles disconnect anomalies via {{patient_safety_failover}}.

Method

  1. Define the CBCentralManager state machine, outlining handling for poweredOff, unauthorized, and resetting states.
  2. Map the GATT discovery sequence for {{ble_service_uuid_structure}}, prioritizing primary service discovery before reading characteristics or descriptors.
  3. Structure MTU negotiation and packet chunking to meet the criteria defined in {{throughput_latency_target}} without packet loss.
  4. Design background execution routines configured for {{ios_background_mode}}, utilizing State Preservation and Restoration (CBCentralManagerOptionRestoreIdentifierKey).
  5. Specify on-device checksum validation and CRC verification routines to detect corrupted packets before parsing clinical values.
  6. Construct the automated reconnection algorithm featuring exponential backoff and localized user alerts during persistent dropouts.
  7. Detail the safety execution pathway defined by {{patient_safety_failover}} to alert the patient immediately if critical telemetry drops.

Constraints

  • MUST implement CoreBluetooth State Preservation and Restoration for {{ios_background_mode}}.
  • MUST NOT parse or persist unvalidated GATT byte arrays without CRC validation.
  • Minimize battery drain to respect {{power_consumption_budget}} constraints.
  • Never perform heavy data parsing or decryption routines on the CoreBluetooth delegate queue.

Output format

  1. Bluetooth State Machine Specification (Detailed transition logic across Discovery, Pairing, Streaming, Disconnected)
  2. GATT Service & Characteristic Mapping (Table: UUID Name, Type, Property [Read/Notify/Write], Payload Size)
  3. Background Telemetry & Reconnection Strategy (Step-by-step description of restoration keys, background wakeups, and backoff)
  4. Packet Parsing & Validation Pipeline (Data flow diagram in ASCII or markdown text)
  5. Clinical Safety & Failover Protocol (3-4 explicit directives for dropped connections and degraded signal)

Self-review

  • Verify that State Restoration delegate methods are explicitly handled.
  • Confirm the GATT configuration accounts for all characteristics in {{ble_service_uuid_structure}}.
  • Ensure {{patient_safety_failover}} triggers reliably during peripheral unresponsiveness.
AuraScore breakdown
77/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 engineering8/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
ios-iot