mirror of
https://github.com/meshcore-dev/meshcore.js.git
synced 2026-04-20 22:13:49 +00:00
add share contact command
This commit is contained in:
parent
28c7f14e74
commit
cf4e1ccd83
3 changed files with 18 additions and 6 deletions
|
|
@ -147,6 +147,13 @@ class Connection extends EventEmitter {
|
|||
await this.sendToRadioFrame(data.toBytes());
|
||||
}
|
||||
|
||||
async sendCommandShareContact(pubKey) {
|
||||
const data = new BufferWriter();
|
||||
data.writeByte(Constants.CommandCodes.ShareContact);
|
||||
data.writeBytes(pubKey); // 32 bytes
|
||||
await this.sendToRadioFrame(data.toBytes());
|
||||
}
|
||||
|
||||
onFrameReceived(frame) {
|
||||
|
||||
// emit received frame
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ class Constants {
|
|||
ResetPath: 13,
|
||||
SetAdvertLatLon: 14,
|
||||
RemoveContact: 15,
|
||||
ShareContact: 16,
|
||||
}
|
||||
|
||||
static ResponseCodes = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue