mirror of
https://github.com/dz0ny/meshcore-sar.git
synced 2026-08-11 08:20:36 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user