diff --git a/index.html b/index.html index 3af68df..16c6e93 100644 --- a/index.html +++ b/index.html @@ -59,10 +59,10 @@ AppStart - + Advert (ZeroHop) - + Advert (Flood) @@ -216,8 +216,11 @@ const selfInfo = await this.connection.getSelfInfo(); console.log(selfInfo); }, - async sendSendSelfAdvert(type) { - await this.connection.sendCommandSendSelfAdvert(type); + async sendZeroHopAdvert() { + await this.connection.sendZeroHopAdvert(); + }, + async sendFloodAdvert() { + await this.connection.sendFloodAdvert(); }, async sendCommandGetContacts() { this.contacts = await this.connection.getContacts(); diff --git a/src/connection/connection.js b/src/connection/connection.js index 759c414..2c5c5a7 100644 --- a/src/connection/connection.js +++ b/src/connection/connection.js @@ -287,6 +287,14 @@ class Connection extends EventEmitter { }); } + async sendFloodAdvert() { + await this.sendCommandSendSelfAdvert(Constants.SelfAdvertTypes.Flood); + } + + async sendZeroHopAdvert() { + await this.sendCommandSendSelfAdvert(Constants.SelfAdvertTypes.ZeroHop); + } + getContacts() { return new Promise(async (resolve, reject) => {