<html>
<head>
<meta charset="utf-8">
<script src="../../site.js"></script>
<script>
var mesUart0 = "";
var mesUart1 = "";
var mesUart2 = "";
var uartString0 = [];
var uartString1 = [];
var uartString2 = [];
function senddata(i){
if(i == 1){
newAJAXCommand('../../web.cgi?sys_ram0x60000000=0x3d&sys_ram0x60000000=0x26&sys_ram0x60000000=0x31&sys_ram0x60000000=0x2d&sys_ram0x60000000=0x6f&sys_ram0x60000000=0x6e&sys_ram0x60000000=0xa');
}
if(i == 2){
newAJAXCommand('../../web.cgi?sys_ram0x60000000=0x3d&sys_ram0x60000000=0x26&sys_ram0x60000000=0x31&sys_ram0x60000000=0x2d&sys_ram0x60000000=0x6f&sys_ram0x60000000=0x66&sys_ram0x60000000=0x66&sys_ram0x60000000=0xa');
}
}
function readUart(){
newAJAXCommand('test.xml', updateStatus, true);
}
function updateStatus(xmlData) {
//-----------------Date-----------------------------------
mesUart0 = "";
for(i=0;i<11;i++){
var hex0 = getXMLValue(xmlData, 'date' + i);
uartString0[i] = hex0.substr(8, 9);
mesUart0 += String.fromCharCode(parseInt(uartString0[i],16));
}
if(mesUart0 != "00000000000"){
document.getElementById('xmlDate').innerHTML = mesUart0;
}
//-----------------Time-----------------------------------
mesUart1 = "";
for(l=0;l<8;l++){
var hex1 = getXMLValue(xmlData, 'time' + l);
uartString1[l] = hex1.substr(8, 9);
mesUart1 += String.fromCharCode(parseInt(uartString1[l],16));
}
if(mesUart1 != "00000000"){
document.getElementById('xmlTime').innerHTML = mesUart1;
}
//-----------------Pin 5-----------------------------------
mesUart2 = "";
for(k=0;k<11;k++){
var hex2 = getXMLValue(xmlData, 'pn' + k);
uartString2[k] = hex2.substr(8, 9);
mesUart2 += String.fromCharCode(parseInt(uartString2[k],16));
}
if(mesUart2 == " SW05_0001 "){
document.getElementById('xmlPin5').innerHTML = "ON"
}
if(mesUart2 == " SW05_0000 "){
document.getElementById('xmlPin5').innerHTML = "OFF"
}
}
</script>
<style>
body{
background-color: white; /* Цвет фона веб-страницы */
}
</style>
</head>
<body onload="readUart()">
<!--<div style="width:100%">
<img src="img/mega3.png" width="100%" style="margin: 0 0 0 0"></img>
</div>
-->
RTC Date:
<div id="xmlDate">...</div><br><br>
RTC Time:
<div id="xmlTime">...</div><br><br>
Switch Digital Pin 5
<button onclick="senddata(1)">ON</button>
<button onclick="senddata(2)">OFF</button>
<br>
Digital Pin#5 Status:
<div id="xmlPin5">...</div><br>
</body>
</html>