mirror of
https://github.com/meshcore-dev/meshcore.js.git
synced 2026-04-20 22:13:49 +00:00
update echo bot example
This commit is contained in:
parent
14ede85af3
commit
073f6576d9
1 changed files with 6 additions and 4 deletions
|
|
@ -1,14 +1,16 @@
|
|||
import TCPConnection from "../src/connection/tcp_connection.js";
|
||||
import Constants from "../src/constants.js";
|
||||
import TCPConnection from "../src/connection/tcp_connection.js";
|
||||
import NodeJSSerialConnection from "../src/connection/nodejs_serial_connection.js";
|
||||
|
||||
// create tcp connection
|
||||
const connection = new TCPConnection("10.1.0.226", 5000);
|
||||
// create connection
|
||||
// const connection = new TCPConnection("10.1.0.226", 5000);
|
||||
const connection = new NodeJSSerialConnection("/dev/cu.usbmodem14401");
|
||||
|
||||
// wait until connected
|
||||
connection.on("connected", async () => {
|
||||
|
||||
// we are now connected
|
||||
console.log(`Connected to: [${connection.host}:${connection.port}]`);
|
||||
console.log("Connected");
|
||||
|
||||
// send flood advert when connected
|
||||
await connection.sendFloodAdvert();
|
||||
Loading…
Add table
Add a link
Reference in a new issue