meshtastic/docs/development/js/connecting.mdx

25 lines
463 B
Plaintext
Raw Normal View History

2021-04-01 17:34:44 -07:00
---
id: connecting
title: Connecting to a device
sidebar_label: Connecting
---
```tsx
2023-01-19 05:01:57 -08:00
import type React from "React";
2021-04-01 17:34:44 -07:00
2023-12-26 04:17:57 -08:00
import { IHTTPConnection } from "@meshtastic/js";
export const Connection = (): JSX.Element => {
const connection = new IHTTPConnection();
const connect = (): void => {
void connection.connect({
2023-01-19 05:01:57 -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
```