Commit graph

103 commits

Author SHA1 Message Date
eddy
3e880c9635 feat: bump firmware to v2, update bundled firmware asset 2026-07-30 17:09:09 +02:00
eddy
a1b0daee37 feat: add BLE OTA characteristic with esp_ota integration 2026-07-30 17:08:48 +02:00
eddy
d34dfec1ce feat: add firmware version BLE characteristic (VERSION_UUID) 2026-07-30 17:07:26 +02:00
eddy
5ed27a9b42 docs: BLE OTA firmware update implementation plan 2026-07-30 07:04:28 +02:00
eddy
6df65d9adf docs: add version check on BLE connect to OTA spec 2026-07-30 06:56:04 +02:00
eddy
5524f173ac docs: BLE OTA firmware update design spec 2026-07-30 06:30:56 +02:00
eddy
e069149fb4 docs: vibecoded notice boven README 2026-07-29 23:57:56 +02:00
eddy
15498d025a chore: remove research docs from git tracking, add to .gitignore 2026-07-29 23:53:26 +02:00
eddy
0833327cea fix: code review fixes — SharedPreferences docs, Log.e, dead notify code 2026-07-29 23:51:16 +02:00
eddy
36a20899be docs: README volledig bijgewerkt — hardware, BLE, combined flow, serial output, NL vertalingen, ESP→module 2026-07-29 23:31:51 +02:00
eddy
7497019f0c Update README title: Sylvia Touch Relay -> Project SylDa 2026-07-29 23:25:03 +02:00
eddy
df5154732c Remove intro text from settings, fix button text color in dark mode
- Removed 'Sluit de ESP aan op USB en kies een actie.' from settings screen
- Button text now black on light gray background (readable in dark mode)
2026-07-29 23:16:53 +02:00
eddy
4c022b8259 Rename package com.eddy.atomrelay -> nl.eddydevink.sylda, Dutch translations, UI cleanup
- Package renamed to nl.eddydevink.sylda (matches eddydevink.nl domain + Sylda app name)
- All status texts translated to Dutch (Niet verbonden, Verbonden, Zoeken, etc.)
- Removed exchange key button, build number, and success toasts
- Button text: Firmware bijwerken, instruction text shortened
- App title changed to Sylda, 'instellingen' label next to settings gear
- ON/HOLD changed to AAN/VAST
2026-07-29 23:09:43 +02:00
eddy
d6d6f6674a Combined flash + key exchange flow with version check and USB permission persistence
- Firmware: add VERSION? command returning BUILD_NR for version check
- Android: flash button checks firmware version first, skips flash if current
- After flash: auto key exchange via reboot detection (expectingReboot flag)
- device_filter.xml + intent-filter: USB permission 'always allow' checkbox
- singleTop + onNewIntent prevents unwanted SettingsActivity launch on USB connect
- platformio.ini: upload_port updated to /dev/ttyACM1
2026-07-29 22:56:40 +02:00
eddy
96162a16be Fix BLE scan: add neverForLocation to BLUETOOTH_SCAN (results suppressed without it on API 31+) 2026-07-29 22:26:43 +02:00
eddy
3ce2610bc8 Fix hasPermissions: remove ACCESS_FINE_LOCATION from API>=S check (maxSdkVersion=30 excludes it) 2026-07-29 22:10:15 +02:00
eddy
a025e66b61 Simplify permission flow: standard ActivityCompat pattern with one-shot guard 2026-07-29 22:04:46 +02:00
eddy
ecdd693ffa Reset permissionsRequested flag after deny and on return from settings 2026-07-29 22:01:07 +02:00
eddy
ac2767c2b6 Fix permission dialog flash loop in onResume 2026-07-29 21:58:44 +02:00
eddy
d005fef3f6 Remove manual download-mode instructions, library auto-resets ESP 2026-07-29 21:55:06 +02:00
eddy
106bd25e41 Replace magic numbers with named constants, move remaining hardcoded strings to strings.xml 2026-07-29 20:56:00 +02:00
eddy
c46db32cc7 Move all user-facing strings to strings.xml, add user-facing-text.md reference 2026-07-29 20:48:20 +02:00
eddy
5fb67fdcf0 Button color: gray default, green pressed via setBackgroundColor 2026-07-29 20:42:03 +02:00
eddy
5a1f1da329 Button color: GradientDrawable swap (teal/green), no tint magic 2026-07-29 20:34:58 +02:00
eddy
817f9a0602 Fix button background restore: save/restore original Drawable instead of tint list null -> gray -> teal → grijs blijft grijs na loslaten 2026-07-29 20:29:30 +02:00
eddy
a3142ea85b Add user-defined button labels with color change on press
- PrefsHelper: PREF_LABEL1, PREF_LABEL2 constants
- SettingsActivity: EditText fields with Done-keyboard action to save labels
- MainActivity: buttons show user label, colorAccent on press, textAllCaps disabled
- activity_main.xml: textAllCaps=false for case-sensitive labels
2026-07-29 20:25:27 +02:00
eddy
a6e5df0052 fix: thread safety, GATT cleanup, onResume guard, relay2 docs 2026-07-29 20:05:26 +02:00
eddy
404f46acf8 refactor: extract BLE logic from MainActivity to BleRelayManager 2026-07-29 19:58:44 +02:00
eddy
0f3b695140 feat: add BleRelayManager sendRelayCommand and disconnect 2026-07-29 19:56:40 +02:00
eddy
a60f6cdc1c feat: add BleRelayManager GATT callback (connect, UUID verify, notifications) 2026-07-29 19:54:31 +02:00
eddy
92585455c8 feat: add BleRelayManager scan logic with permissions 2026-07-29 19:51:11 +02:00
eddy
82852e086e feat: add BleRelayManager key/HMAC helpers and loadState 2026-07-29 19:49:00 +02:00
eddy
f41f1c3380 feat: add BleRelayManager class skeleton 2026-07-29 19:47:20 +02:00
eddy
61c5c1de32 feat: add BleStatus enum and BleCallbacks interface 2026-07-29 19:45:11 +02:00
eddy
cd89604c9b docs: add BLE refactor implementation plan (8 tasks) 2026-07-29 19:44:17 +02:00
eddy
459dc5f201 docs: add BLE refactor design spec (BleRelayManager extraction) 2026-07-29 19:40:30 +02:00
eddy
d6e37322f3 fix: NimBLE 128-bit UUID scan response + Android key/UUID loading
- Firmware: add explicit setScanResponseData with setCompleteServices for
  128-bit service UUID so Android ScanFilter finds the device
- Android: hexStringToBytes accepts any even-length hex (fixes UUID=32chars
  failing the hardcoded 64-char check)
- Android: onActivityResult matches SettingsActivity.RESULT_SCAN instead of
  Activity.RESULT_OK
2026-07-29 19:30:46 +02:00
eddy
96d3620535 feat: migrate BLE to NimBLE — 45% flash, 33% RAM reduction
- Replaced ESP32 BLE Arduino with h2zero/NimBLE-Arduino@^2
- -DCONFIG_BT_NIMBLE_ENABLED to disable built-in Bluedroid
- NIMBLE_PROPERTY::* replaces BLECharacteristic::PROPERTY_* + setAccessPermissions
- BLE2902 descriptor removed (NimBLE auto-creates it)
- pService->start() removed (NimBLE starts services with server)
- setMinPreferred → setMinInterval/setMaxInterval
- onConnect/onDisconnect/onWrite get extra NimBLEConnInfo& param
- Re-advertise: BLEDevice → NimBLEDevice::startAdvertising()
- Firmware: 533KB flash (was 964KB), 29KB RAM (was 44KB)
2026-07-29 18:58:49 +02:00
eddy
42b8092807 fix: replace EncryptedSharedPreferences with plain MODE_PRIVATE for update survival 2026-07-29 18:51:35 +02:00
eddy
348c55d830 feat: add device UUID pairing — unique identity per ESP-phone pair
- Firmware: auto-generate 16-byte UUID on first boot (NVS), new READ characteristic
- BLE name: AtomS3R-Relay → SylDa_Server
- KEY? now returns DEVICE_ID + HMAC_KEY, SET_ID command for UUID provisioning
- App: UUID+HMAC loaded from prefs, scan by service UUID, verify UUID after connect
- UUID mismatch → disconnect + skip address + rescan
- Key conflict dialog: keep ESP keys, overwrite ESP (with checkbox confirm), or cancel
- NO_KEY with existing app keys: send existing pair instead of generating new
- Added design spec doc
2026-07-29 18:12:13 +02:00
eddy
73b3c0eaa0 docs: add device UUID pairing design spec 2026-07-29 17:56:48 +02:00
eddy
804a728550 docs: mark 5.3 empty catch blocks as resolved 2026-07-27 17:16:29 +02:00
eddy
f88b17cae5 Merge branch 'fix/magic-numbers': extract magic numbers to named constants (review 4.3) 2026-07-27 13:12:31 +02:00
eddy
f676eb259d Extract magic numbers to named constants (review 4.3)
- MainActivity: RECONNECT_DELAY_MS, POST_SETTINGS_RESCAN_MS, ON_RESUME_SCAN_DELAY_MS
- SettingsActivity: FLUSH_TIMEOUT_MS, READ_CHUNK_TIMEOUT_MS, CDC_CONTROL_TIMEOUT_MS
- UsbSerialTransport: CONTROL_LINE_TIMEOUT_MS
- UsbUtils: shared CDC request constants (REQUEST_TYPE, SET_LINE_CODING, SET_CONTROL_LINE_STATE, DTR, RTS)

Pure refactor — no behavior change. All literals replaced by named private const val in companion objects or shared via UsbUtils.
2026-07-27 12:39:41 +02:00
eddy
9c520f57c2 Add .worktrees/ to .gitignore 2026-07-27 12:32:40 +02:00
eddy
c977dc25a2 Voeg thema-selector toe (DayNight, Radiogroep, teal accent) 2026-07-27 00:22:43 +02:00
eddy
5a0dee77b3 Update README with scan retry feature 2026-07-26 23:37:20 +02:00
eddy
7c054a7021 Add scan retry button on timeout 2026-07-26 23:37:02 +02:00
eddy
954264fe37 Add proguard rules for esp32-flash-lib 2026-07-26 23:31:14 +02:00
eddy
05036a5060 Move user-facing strings to strings.xml 2026-07-26 23:21:25 +02:00