---
id: TASK-130
title: Pico firmware — BLE transport (Pico W)
status: Done
assignee: []
created_date: '2026-03-29 20:51'
labels:
  - firmware
  - ble
milestone: m-2
dependencies: []
priority: high
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
Write transport_ble.py (BLE GATT Nordic UART Service) and main.py (auto-detect transport, cooperative poll loop). BLE advertises as 'GaiaAR', chunks notifications to 20-byte MTU.
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [ ] #1 NUS service with correct UUIDs registered
- [ ] #2 IRQ handler queues to pending list, no heavy work in interrupt
- [ ] #3 MTU chunking for notifications
- [ ] #4 Auto-reconnect advertising on disconnect
- [ ] #5 main.py soft-imports bluetooth for Pico/Pico W compat
<!-- AC:END -->

## Final Summary

<!-- SECTION:FINAL_SUMMARY:BEGIN -->
transport_ble.py: GATT NUS with chunked notify, per-connection line buffers, auto-readvertise. main.py: soft BLE import, cooperative dual-transport loop, error-resilient.
<!-- SECTION:FINAL_SUMMARY:END -->
