mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-13 22:32:27 +00:00
Remove docs, moved to main repo
This commit is contained in:
@@ -1,43 +0,0 @@
|
||||
var meshtasticClient;
|
||||
var connectionOne;
|
||||
|
||||
|
||||
// Important: the connect action must be called from a user interaction (e.g. button press), otherwise the browsers won't allow the connect
|
||||
function connect() {
|
||||
|
||||
// Create new connection
|
||||
var httpconn = new meshtasticjs.IHTTPConnection();
|
||||
|
||||
// Set connection params
|
||||
let sslActive;
|
||||
if (window.location.protocol === 'https:') {
|
||||
sslActive = true;
|
||||
} else {
|
||||
sslActive = false;
|
||||
}
|
||||
let deviceIp = window.location.hostname; // Your devices IP here
|
||||
|
||||
|
||||
// Add event listeners that get called when a new packet is received / state of device changes
|
||||
httpconn.addEventListener('fromRadio', function (packet) { console.log(packet) });
|
||||
|
||||
// Connect to the device async, then send a text message
|
||||
httpconn.connect(deviceIp, sslActive)
|
||||
.then(result => {
|
||||
|
||||
alert('device has been configured')
|
||||
// This gets called when the connection has been established
|
||||
// -> send a message over the mesh network. If no recipient node is provided, it gets sent as a broadcast
|
||||
return httpconn.sendText('meshtastic is awesome');
|
||||
|
||||
})
|
||||
.then(result => {
|
||||
|
||||
// This gets called when the message has been sucessfully sent
|
||||
console.log('Message sent!');
|
||||
})
|
||||
|
||||
.catch(error => { console.log(error); });
|
||||
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
<!doctype html>
|
||||
<html class="no-js" lang="">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title></title>
|
||||
|
||||
<script src="/static/meshtastic.js"></script>
|
||||
<script src="/static/basic.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<button id="connect_button" onclick="connect()">Connect to Meshtastic device</button>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Binary file not shown.
Reference in New Issue
Block a user