add export and import contact frame builders in meshcore_protocol.dart and implement contact export functionality in contacts_screen.dart

This commit is contained in:
Winston Lowe
2026-01-26 11:56:42 -08:00
parent 8b0bdd9a46
commit c37abb63e3
2 changed files with 96 additions and 11 deletions
+18
View File
@@ -708,3 +708,21 @@ Uint8List buildSendBinaryReq(Uint8List repeaterPubKey, {Uint8List? payload}) {
}
return writer.toBytes();
}
// Build a export contact frame
// [cmd][pub_key x32 / if empty exports your contact info]
Uint8List buildExportContactFrame(Uint8List pubKey) {
final writer = BufferWriter();
writer.writeByte(cmdExportContact);
writer.writeBytes(pubKey);
return writer.toBytes();
}
// Build a import contact frame
// [cmd][contact_frame x148]
Uint8List buildImportContactFrame(Uint8List contactFrame) {
final writer = BufferWriter();
writer.writeByte(cmdImportContact);
writer.writeBytes(contactFrame);
return writer.toBytes();
}