Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+200
@@ -0,0 +1,200 @@
|
||||
|
||||
var exampleSocket;
|
||||
var firstMsg = true;
|
||||
var textBoxArr = [];
|
||||
var SelBranchVal = "";
|
||||
var connectedToServer = false;
|
||||
var msg;
|
||||
|
||||
|
||||
window.onload = function () {
|
||||
WebSocketTest();
|
||||
}
|
||||
|
||||
function WebSocketTest() {
|
||||
if ("WebSocket" in window) {
|
||||
{
|
||||
var ipadresse = document.getElementById("ipadresse").value;
|
||||
exampleSocket = new WebSocket("ws://" + ipadresse);
|
||||
connectedToServer = true;
|
||||
}
|
||||
exampleSocket.onopen = function () {
|
||||
document.getElementById("Serverconnect").innerHTML = "Server: connected";
|
||||
document.getElementById("Serverconnect").style.color = "green"
|
||||
};
|
||||
//wird immer aufgerufen wenn der Socket eine Nachricht vom Server empfängt
|
||||
exampleSocket.onmessage = function (event) {
|
||||
console.log(msg);
|
||||
msg = JSON.parse(event.data);
|
||||
document.getElementById("receivedMessages").innerHTML += JSON.stringify(msg);
|
||||
document.getElementById("receivedMessages").innerHTML += "<br>";
|
||||
|
||||
};
|
||||
|
||||
exampleSocket.onclose = function () {
|
||||
// websocket is closed.
|
||||
document.getElementById("Serverconnect").innerHTML = "Server: not connected";
|
||||
document.getElementById("Serverconnect").style.color = "grey";
|
||||
|
||||
// document.getElementById("Wlsconnect").innerHTML = "Wls: not connected";
|
||||
document.getElementById("Wlsconnect").style.color = "red";
|
||||
|
||||
connectedToServer = false;
|
||||
alert("Connection to Server closed.");
|
||||
};
|
||||
}
|
||||
|
||||
else {
|
||||
// The browser doesn't support WebSocket
|
||||
alert("WebSocket is NOT supported by your Browser!");
|
||||
}
|
||||
}
|
||||
|
||||
function sendGetEssentials() {
|
||||
|
||||
exampleSocket.send(JSON.stringify({
|
||||
type: "getEssentials",
|
||||
uuid: "UUID"
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
function sendMountTags() {
|
||||
|
||||
exampleSocket.send(JSON.stringify({
|
||||
type: "mountTag",
|
||||
uuid: "UUID",
|
||||
data: {
|
||||
mountingPointTag : "BarcodeTag1",
|
||||
assetTag: "BarcodeAsset1"
|
||||
}
|
||||
}));
|
||||
exampleSocket.send(JSON.stringify({
|
||||
type: "mountTag",
|
||||
uuid: "UUID",
|
||||
data: {
|
||||
mountingPointTag : "BarcodeTag2",
|
||||
assetTag: "BarcodeAsset2"
|
||||
}
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
|
||||
function sendGetAssets() {
|
||||
|
||||
exampleSocket.send(JSON.stringify({
|
||||
type: "getAssets",
|
||||
uuid: "UUID"
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
|
||||
function sendGetPlannedMounting() {
|
||||
|
||||
exampleSocket.send(JSON.stringify({
|
||||
type: "getPlannedMounting",
|
||||
uuid: "UUID"
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
function sendGetObjectMounting() {
|
||||
|
||||
exampleSocket.send(JSON.stringify({
|
||||
type: "getObjectMounting",
|
||||
uuid: "UUID"
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------//
|
||||
function servicePortsInformationRequest() {
|
||||
console.log("servicePortsInformationRequest");
|
||||
|
||||
exampleSocket.send(JSON.stringify({
|
||||
type: "servicePortsInformationRequest",
|
||||
uuid: "UUID"
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------//
|
||||
|
||||
function baseDlRequest() {
|
||||
|
||||
exampleSocket.send(JSON.stringify({
|
||||
type: "baseDlRequest",
|
||||
uuid: "UUID"
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
function pdfListRequest() {
|
||||
|
||||
exampleSocket.send(JSON.stringify({
|
||||
type: "pdfListRequest",
|
||||
uuid: "UUID"
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------//
|
||||
function sendGetAssets() {
|
||||
//exampleSocket schickt eine Abfrage an den Server
|
||||
//liefert das asset mit der TypId zurück
|
||||
// BSM
|
||||
exampleSocket.send(JSON.stringify({
|
||||
type: "getAssets",
|
||||
uuid: "UUID",
|
||||
data: {
|
||||
assetTypeId: [1, 2, 3, 4, 5, 6, 10, 12]
|
||||
}
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
function sendAvsEndEnd() {
|
||||
console.log("sendAvsEndEnd");
|
||||
exampleSocket.send(JSON.stringify({
|
||||
endTime: 1641887329958,
|
||||
eventTime: 1641887329958,
|
||||
eventType: 10,
|
||||
id: 72774090,
|
||||
lastRangeClosed: true,
|
||||
streamName: "av_0141"
|
||||
}));
|
||||
}
|
||||
|
||||
function sendAvsOpen() {
|
||||
console.log("sendAvsOpen");
|
||||
exampleSocket.send(JSON.stringify({
|
||||
endTime: 1641887329958,
|
||||
eventTime: 1641887329958,
|
||||
eventType: 10,
|
||||
id: 72774090,
|
||||
lastRangeClosed: true,
|
||||
streamName: "av_0141"
|
||||
}));
|
||||
}
|
||||
|
||||
function sendMountTags() {
|
||||
exampleSocket.send(JSON.stringify({
|
||||
type: "mountTag",
|
||||
uuid: "UUID",
|
||||
data: {
|
||||
mountingPointTag: "se_barcode_1",
|
||||
assetTag: "asset_barcode_1"
|
||||
}
|
||||
}));
|
||||
exampleSocket.send(JSON.stringify({
|
||||
type: "mountTag",
|
||||
uuid: "UUID",
|
||||
data: {
|
||||
mountingPointTag: "se_barcode_2",
|
||||
assetTag: "asset_barcode_2"
|
||||
}
|
||||
}));
|
||||
}
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
<!DOCTYPE HTML>
|
||||
<meta charset="utf-8" />
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Websockets</title>
|
||||
<style>
|
||||
th {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
table {
|
||||
text-align: left;
|
||||
table-layout: fixed;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript" src="js/websocket.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Websocket Sniffer</h1>
|
||||
<!-- divFunctions -->
|
||||
<hr>
|
||||
<table style="width:40.5%" id="HeaderTable">
|
||||
<tr id="HeaderTableRow">
|
||||
<td>
|
||||
<div id="WebSocketStart">
|
||||
<input type="button" id="create" value="Connect to Server" onclick="WebSocketTest()">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<form>
|
||||
<input type="text" value="localhost:2080" id="ipadresse" />
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
<div id="Serverconnect">
|
||||
<font color="red">
|
||||
Server: not connected
|
||||
</font>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr>
|
||||
<!-- Alle ISM-Anfragen der ICD senden-->
|
||||
<div id="divFunctions">
|
||||
<h2>getEssentials</h2>
|
||||
<input type="button" id="sendGetEssentials" value="Send getEssentials" onclick="sendGetEssentials()">
|
||||
|
||||
<h2>mountTags</h2>
|
||||
<input type="button" id="sendMountTags" value="Send mountTags" onclick="sendMountTags()">
|
||||
|
||||
|
||||
<h2>getAssets</h2>
|
||||
<input type="button" id="sendGetAssets" value="Send getAssets" onclick="sendGetAssets()">
|
||||
|
||||
<h2>getPlannedMounting</h2>
|
||||
<input type="button" id="sendGetPlannedMounting" value="Send getPlannedMounting" onclick="sendGetPlannedMounting()">
|
||||
|
||||
<h2>getObjectMounting</h2>
|
||||
<input type="button" id="sendGetObjectMounting" value="Send getObjectMounting" onclick="sendGetObjectMounting()">
|
||||
<hr>
|
||||
<h1>ServiceInformations: port 7300<h1>
|
||||
<h2>servicePortsInformationRequest</h2>
|
||||
<input type="button" id="servicePortsInformationRequest" value="Send servicePortsInformationRequest" onclick="servicePortsInformationRequest()"> <br>
|
||||
<h3>An den Port ppm, ports typeId:2 folgenden Request schicken:</h3>
|
||||
<input type="button" id="baseDlRequest" value="Send baseDlRequest" onclick="baseDlRequest()"> <br>
|
||||
<input type="button" id="pdfListRequest" value="Send pdfListRequest" onclick="pdfListRequest()"> <br>
|
||||
|
||||
<h1>AVS-Event: Port 1234<h1>
|
||||
<h2>send Open Stream</h2>
|
||||
<input type="button" id="sendAvsOpen" value="Send sendAvsOpen" onclick="sendAvsOpen()">
|
||||
|
||||
<h2>send End Stream</h2>
|
||||
<input type="button" id="sendAvsEndEnd" value="Send sendAvsEndEnd" onclick="sendAvsEndEnd()">
|
||||
</div>
|
||||
<p id="receivedMessages">
|
||||
|
||||
|
||||
</html>
|
||||
Reference in new issue
Block a user