]> git.feebdaed.xyz Git - gomehub.git/commitdiff
discovery tested
authorseantywork <seantywork@gmail.com>
Thu, 18 Jul 2024 00:39:23 +0000 (09:39 +0900)
committerseantywork <seantywork@gmail.com>
Thu, 18 Jul 2024 00:39:23 +0000 (09:39 +0900)
public/js/mypage/index.js
view/mypage/index.html

index f07b3a2e5507296cc8f82cdefca757ea4154b326..ecf14a18b340cac146b82f4e20999700925502ad 100644 (file)
@@ -4,6 +4,8 @@ ws = {}
 
 CH_SOLI_ALIVE = 0
 
+SOLI_DISCOVERY_SENT = 1
+
 TURN_SERVER_ADDRESS = {}
 
 SOLI_SIGNAL_ADDRESS = ""
@@ -159,9 +161,19 @@ async function openSoli(){
                 CH_SOLI_ALIVE = 1
             }
 
-        }
+            if (SOLI_DISCOVERY_SENT == 0){
+
+                document.getElementById("discovery-reader").innerText = msg.data
+
+                SOLI_DISCOVERY_SENT = 1
+
+            } else {
 
-        document.getElementById("soli-action-result").innerText = msg.data
+                document.getElementById("soli-action-result").innerText = msg.data
+
+            }
+
+        }
 
 
     }
@@ -186,7 +198,7 @@ async function sendSoliQuery(){
 
     document.getElementById("soli-action-data").value = ""
 
-    ws.send(JSON.stringify({command: 'roundtrip', data: u_query + ":"}))
+    ws.send(JSON.stringify({command: 'roundtrip', data: u_query }))
 
 }
 
@@ -215,6 +227,20 @@ async function initSoli(){
 
 }
 
+async function sendDiscovery(){
+
+    if(CH_SOLI_ALIVE != 1){
+
+        alert("soli not opened, yet")
+
+        return
+    }
+
+    SOLI_DISCOVERY_SENT = 0
+
+    ws.send(JSON.stringify({command: 'roundtrip', data: "discovery:"}))
+
+}
 
 async function initCCTV(){
 
@@ -305,7 +331,7 @@ async function initCCTV(){
 
     console.log("init success")
 
-    let req = "cctv:" + STREAMING_KEY
+    let req = "cctv:" + "default," + STREAMING_KEY
 
     ws.send(JSON.stringify({command: 'roundtrip', data: req}))
 }
index dd643cd38bd46335a31519c6b28b2527900d0fd9..a41cd8b904ea3204ae93d03f4ce083e747366816 100644 (file)
@@ -9,6 +9,7 @@
 
     <h1> Sorrylinus </h1>
 
+  
     <label for="soli-open-user-id">Soli ID</label>
     <input type="text" id="soli-open-user-id">
     <br>
     <br>
     <input type="button" onclick="openSoli()" value="open">
 
+    <pre id="discovery-reader"></pre>
+
+    <input type="button" onclick="sendDiscovery()" value="open">
+
     <h3> Action </h3>
   
     <label for="soli-action-data">Query</label>