mirror of
https://github.com/meshcore-dev/meshcore.js.git
synced 2026-04-20 22:13:49 +00:00
update readme example
This commit is contained in:
parent
91dd4c5afd
commit
a781834bc7
1 changed files with 6 additions and 4 deletions
10
README.md
10
README.md
|
|
@ -24,11 +24,13 @@ npm install @liamcottle/meshcore.js
|
|||
## Simple Example
|
||||
|
||||
```
|
||||
import { TCPConnection } from "@liamcottle/meshcore.js";
|
||||
import { TCPConnection, NodeJSSerialConnection } from "@liamcottle/meshcore.js";
|
||||
|
||||
// create tcp connection
|
||||
// tcp connections are supported by "Heltec_v3_companion_radio_wifi"
|
||||
const connection = new TCPConnection("10.1.0.226", 5000);
|
||||
// serial connection are supported by "companion_radio_usb" firmware
|
||||
const connection = new NodeJSSerialConnection("/dev/cu.usbmodem14401");
|
||||
|
||||
// tcp connections are supported by "companion_radio_wifi" firmware
|
||||
// const connection = new TCPConnection("10.1.0.226", 5000);
|
||||
|
||||
// wait until connected
|
||||
connection.on("connected", async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue