feat: Match official app's advert import and discovery flow

- pushAdvert (0x80): import advert into firmware via cmdGetAdvertPath
  before fetching contact, so name/type/location are available
- pushNewAdvert (0x8A): fire-and-forget importReceivedAdvert to store
  contact in firmware (data already in push payload)
- controlData (0x8E) discovery: no firmware import (matches official app),
  just lookup existing contacts and show generic labels for unknown nodes
- Update meshcore_client git ref to bcbeff0 (burst sync + advert import)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Janez T
2026-03-16 21:19:40 +01:00
parent d3d53995a6
commit 1fe260b95e
3 changed files with 77 additions and 41 deletions

View File

@@ -864,6 +864,23 @@ class ConnectionProvider with ChangeNotifier {
}
}
/// Import a received advert by public key, then fetch the full contact.
///
/// This tells the firmware to store the advert it received, making the
/// contact available for [getContact]/[previewContact] with full details
/// (name, type, location, etc.).
Future<void> importReceivedAdvert(Uint8List publicKey) async {
if (!_activeService.isConnected) return;
try {
await _activeService.importReceivedAdvert(publicKey);
} catch (e) {
debugPrint(
'⚠️ [Provider] importReceivedAdvert failed for ${_publicKeyToHex(publicKey)}: $e',
);
}
}
Future<void> previewContact(Uint8List publicKey) async {
if (!_activeService.isConnected) {
return;