mirror of
https://github.com/meshtastic/meshtastic.git
synced 2024-11-17 11:04:13 -08:00
25 lines
463 B
Plaintext
25 lines
463 B
Plaintext
---
|
|
id: connecting
|
|
title: Connecting to a device
|
|
sidebar_label: Connecting
|
|
---
|
|
|
|
```tsx
|
|
import type React from "React";
|
|
|
|
import { IHTTPConnection } from "@meshtastic/js";
|
|
|
|
export const Connection = (): JSX.Element => {
|
|
const connection = new IHTTPConnection();
|
|
|
|
const connect = (): void => {
|
|
void connection.connect({
|
|
address: "10.0.0.10",
|
|
fetchInterval: 3000
|
|
});
|
|
};
|
|
|
|
return <button onClick={connect}>Connect Bluetooth</button>;
|
|
};
|
|
```
|