meshtastic/docs/software/js/connecting.md

25 lines
474 B
Markdown
Raw Normal View History

2021-04-01 17:34:44 -07:00
---
id: connecting
title: Connecting to a device
sidebar_label: Connecting
---
```tsx
2022-03-08 23:51:46 -08:00
import type React from "React";
2021-04-01 17:34:44 -07:00
2022-03-08 23:51:46 -08:00
import { IHTTPConnection } from "@meshtastic/meshtasticjs";
export const Connection = (): JSX.Element => {
const connection = new IHTTPConnection();
const connect = (): void => {
void connection.connect({
2022-03-08 23:51:46 -08:00
address: "10.0.0.10",
fetchInterval: 3000,
});
2022-03-08 23:51:46 -08:00
};
return <button onClick={connect}>Connect Bluetooth</button>;
};
2021-04-01 17:34:44 -07:00
```