100
procentric/application/referece/test.html
Executable file
100
procentric/application/referece/test.html
Executable file
@@ -0,0 +1,100 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CENTIRM LG-PROCENTRIC HOTEL SERVICE</title>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
<!-- Standard & 3rd party Library -->
|
||||
<!--<script src="./lib/jquery-2.2.4.js"></script>-->
|
||||
<script src="../lib/jquery-3.6.0.min.js"></script>
|
||||
|
||||
<!-- MQTT Library -->
|
||||
<!-- <script src="./lib/mqtt-4.0.0.dev.js"></script> -->
|
||||
<script src="../lib/mqtt.min.js"></script>
|
||||
|
||||
|
||||
<script>
|
||||
window.addEventListener('cached', function() {
|
||||
|
||||
});
|
||||
|
||||
window.addEventListener('load', function() {
|
||||
|
||||
// var client = mqtt.connect({
|
||||
// servers: [{
|
||||
// host: '10.16.17.200',
|
||||
// port: 9001,
|
||||
// }],
|
||||
// clean: true, // retain session
|
||||
// protocolId: 'MQTT',
|
||||
// connectTimeout: 4000, // Timeout period
|
||||
// username: 'root',
|
||||
// password: 'pass'
|
||||
// });
|
||||
|
||||
var client = mqtt.connect(
|
||||
'ws://10.16.17.200:9001', {
|
||||
clean: true, // retain session
|
||||
connectTimeout: 4000, // Timeout period
|
||||
username: 'root',
|
||||
password: 'pass'
|
||||
}
|
||||
);
|
||||
|
||||
client.on('connect', function() {
|
||||
client.subscribe('ctlxb0_009INZY36165/topic', function(err) {
|
||||
if (err) {
|
||||
console.log("Error::> Fail to connect mqtt server")
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
client.on('message', function(topic, message) {
|
||||
// message is Buffer
|
||||
console.log(message.toString())
|
||||
client.end()
|
||||
})
|
||||
});
|
||||
|
||||
window.addEventListener('unload', function(event) {
|
||||
console.log('Uninitalized');
|
||||
//HotelTV.UnloadAppFull();
|
||||
});
|
||||
|
||||
|
||||
document.addEventListener("keydown",
|
||||
function(e) {
|
||||
let _profile = HotelTV.profile;
|
||||
let _state = HotelTV.state;
|
||||
|
||||
if (_state.menu.stage == "main") {
|
||||
console.log(`KEY::${e.keyCode} Main Menu::> ${_state.menu.main.cur} ${_profile[Number(_state.menu.main.cur)].name}`);
|
||||
}
|
||||
|
||||
switch (e.keyCode) {
|
||||
case 602: // Portail
|
||||
window.location.replace('./index.html');
|
||||
break;
|
||||
case 409:
|
||||
HotelTV.hcap.PwrOff();
|
||||
break;
|
||||
default:
|
||||
//console.log(`KEY::${e.keyCode}`);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
//HotelTV.LoadAppFull();
|
||||
});
|
||||
</script>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user