update echo bot example

This commit is contained in:
liamcottle 2025-04-08 14:28:43 +12:00
parent 14ede85af3
commit 073f6576d9

View file

@ -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();