2021-11-19 16:30:17 +00:00
|
|
|
const path = require('path')
|
|
|
|
const {
|
|
|
|
ipcRenderer
|
|
|
|
} = require('electron')
|
|
|
|
const sock = require('./sock.js');
|
|
|
|
|
|
|
|
|
|
|
|
// https://stackoverflow.com/a/26227660
|
|
|
|
var appDataFolder = process.env.APPDATA || (process.platform == 'darwin' ? process.env.HOME + '/Library/Application Support' : process.env.HOME + "/.config")
|
|
|
|
var configFolder = path.join(appDataFolder, "FreeDATA");
|
|
|
|
var configPath = path.join(configFolder, 'config.json')
|
|
|
|
const config = require(configPath);
|
|
|
|
|
|
|
|
var chatDB = path.join(configFolder, 'chatDB.json')
|
|
|
|
|
|
|
|
|
|
|
|
// WINDOW LISTENER
|
|
|
|
window.addEventListener('DOMContentLoaded', () => {
|
|
|
|
// SEND MSG
|
|
|
|
document.getElementById("sendMessage").addEventListener("click", () => {
|
2021-11-19 16:47:25 +00:00
|
|
|
dxcallsign = document.getElementById('chatModuledxCall').value
|
2021-11-19 16:30:17 +00:00
|
|
|
let Data = {
|
|
|
|
command: "sendMessage",
|
|
|
|
dxcallsign : dxcallsign.toUpperCase(),
|
|
|
|
mode : 10,
|
|
|
|
frames : 1,
|
|
|
|
data : 'hallo welt',
|
|
|
|
checksum : '123'
|
|
|
|
};
|
|
|
|
ipcRenderer.send('run-tnc-command', Data);
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
ipcRenderer.on('action-update-rx-buffer', (event, arg) => {
|
|
|
|
|
|
|
|
alert(arg)
|
|
|
|
|
|
|
|
|
|
|
|
})
|