meshtastic/docs/software/js/connecting.md
2022-03-09 18:10:41 +11:00

28 lines
480 B
Markdown

---
id: connecting
title: Connecting to a device
sidebar_label: Connecting
---
```tsx
import type React from 'React';
import { IHTTPConnection } from '@meshtastic/meshtasticjs';
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>;
};
```