fix: retry char discovery when FFE2 missing after disconnect #14

Merged
schwifty merged 1 commit from schwifty/fix-ffe2-missing-after-disconnect into main 2026-03-22 03:12:29 +00:00
Collaborator

Problem

After 2 disconnects during provisioning, the beacon's BLE stack can return incomplete characteristic discovery results. The code hard-fails with DX-Smart command characteristic (FFE2) not found instead of recovering.

Fix

  • When FFE2 is missing in dxSmartSendNextCommand(), re-trigger characteristic discovery (up to 2 attempts) instead of hard-failing
  • After re-discovery completes, resume writing from the saved command index (already authenticated, no need to re-auth)
  • Reset rediscovery counter on successful characteristic access and in cleanup

Test Plan

  • Provision a beacon that's prone to disconnects
  • Verify it recovers from FFE2 miss after disconnect instead of failing
  • Verify normal provisioning (no disconnects) still works unchanged
## Problem After 2 disconnects during provisioning, the beacon's BLE stack can return incomplete characteristic discovery results. The code hard-fails with `DX-Smart command characteristic (FFE2) not found` instead of recovering. ## Fix - When FFE2 is missing in `dxSmartSendNextCommand()`, re-trigger characteristic discovery (up to 2 attempts) instead of hard-failing - After re-discovery completes, resume writing from the saved command index (already authenticated, no need to re-auth) - Reset rediscovery counter on successful characteristic access and in cleanup ## Test Plan - [ ] Provision a beacon that's prone to disconnects - [ ] Verify it recovers from FFE2 miss after disconnect instead of failing - [ ] Verify normal provisioning (no disconnects) still works unchanged
schwifty added 1 commit 2026-03-22 03:03:20 +00:00
After 2+ disconnects during provisioning, the beacon's BLE stack can
return incomplete characteristic discovery results. Instead of hard-
failing with "DX-Smart command characteristic (FFE2) not found", we
now re-trigger characteristic discovery (up to 2 attempts) and resume
writing from the saved position once FFE2 is found.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
schwifty merged commit 057a215a50 into main 2026-03-22 03:12:29 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: payfrit/payfrit-beacon-ios#14
No description provided.