-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.js
More file actions
25 lines (25 loc) · 1 KB
/
Copy pathmain.js
File metadata and controls
25 lines (25 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const communication_1 = require("./communication");
const Logging_1 = require("./lib/spectoda-js/Logging");
const functions_1 = require("./lib/spectoda-js/functions");
require("./server");
const fs_1 = __importDefault(require("fs"));
async function main() {
await (0, functions_1.sleep)(1000);
if (fs_1.default.existsSync("assets/mac.txt")) {
const mac = fs_1.default.readFileSync("assets/mac.txt").toString();
Logging_1.logging.info("Connecting to remembered device with MAC: " + mac);
try {
// @ts-ignore
await communication_1.spectodaDevice.connect([{ mac: mac }], true, null, null, false, "", true);
}
catch {
Logging_1.logging.error("Failed to connect to remembered device with MAC: " + mac);
}
}
}
main();