From 95821129652cd14e1dbda3547b9eabf76572f3b4 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Tue, 8 Apr 2025 14:30:08 +1200 Subject: [PATCH] update command bot example --- examples/{tcp_command_bot.js => command_bot.js} | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) rename examples/{tcp_command_bot.js => command_bot.js} (90%) diff --git a/examples/tcp_command_bot.js b/examples/command_bot.js similarity index 90% rename from examples/tcp_command_bot.js rename to examples/command_bot.js index 824f4e2..d2f36fa 100644 --- a/examples/tcp_command_bot.js +++ b/examples/command_bot.js @@ -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); +// 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"); // set device time await setDeviceTime();