mirror of
https://github.com/meshtastic/meshtastic.git
synced 2024-12-30 07:59:54 -08:00
9dc879235f
* initial devices.json * initial hardware components * testing page at /docs/hardware/supported/template * WIP Changes * Home page work & updates * Fix build * Fix external link button * Setup linting * rename, cleanup & lint * seperate lint cmd for now Co-authored-by: Foster Irwin <foster@jfirwin.com> Co-authored-by: Sacha Weatherstone <sachaw100@hotmail..om>
25 lines
474 B
Plaintext
25 lines
474 B
Plaintext
---
|
|
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>;
|
|
};
|
|
```
|