You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.2 KiB

  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js"></script>
  6. <script src="../js/zcmd.js"></script>
  7. <meta name="viewport" content="width=device-width,initial-scale=1">
  8. <title>唤醒测试</title>
  9. <style>
  10. </style>
  11. <script>
  12. </script>
  13. </head>
  14. <body>
  15. <script>
  16. var zcmd = new ZCommand();
  17. zcmd.set_onSendraw(function (data) {
  18. console.log("zcmd send:" + JSON.stringify(data, null, 0));
  19. });
  20. zcmd.set_onReceipt(function (tx, rx) {
  21. console.log("zcmd receipt:" + JSON.stringify(rx, null, 0));
  22. });
  23. </script>
  24. <div>
  25. <h1>唤醒测试</h1>
  26. <table>
  27. <tr>
  28. <td>triggerWakeup</td>
  29. <td>-</td>
  30. <td><button
  31. onclick='zcmd.send_message({"command": "triggerWakeup"},2000).then((data) => {alert(JSON.stringify(data,null,2))})'>Trigger</button>
  32. </td>
  33. </tr>
  34. </table>
  35. </div>
  36. <script>
  37. $(function () {
  38. // ZWSURL = "ws://127.0.0.1:19000";
  39. zcmd.start_auto_connect(ZWSURL);
  40. });
  41. </script>
  42. </body>
  43. </html>