如何让 Tizen 可穿戴设备通过 Wi-Fi 与 UWP App 双向通信?

How to let a Tizen wearable Device communicate in two directions with UWP App vie Wi-Fi?

场景:

到目前为止,这两者之间的通信是通过蓝牙进行的,Gear 作为服务器,UWP 作为客户端。但是它们的使用环境需要一种与 bt 相比范围更广的技术。我在这里想到了 Wi-Fi,但我对网络通信的编码完全是个新手。我应该从哪里开始?在这种情况下,明智地使用了哪些协议和服务器-客户端结构?

提前致谢。

从您的 UWP 应用程序(服务器)生成 JSON 并从您的 Tizen Web 应用程序(客户端应用程序)使用这些 JSON 作为休息客户端 想象一下,您的 UWP 生成 JSON 数据,例如 http://services.groupkt.com/country/get/all,然后按下面的示例简单地使用它,

function getServerData() {
        'use strict';

        console.log( "ready!" );
          $.ajax({
            type: "GET",
            url: "http://services.groupkt.com/country/get/all",
            success: function (data) {
                  console.log(JSON.stringify(data));
                 // use data wherever you need it 
             }
       });
    }

并且不要忘记添加这些权限和访问权限以使其正常工作。

config.xml

    <access origin="http://groupkt.com" subdomains="true"></access>
    <access origin="*" subdomains="true"></access>
    <tizen:privilege name="http://tizen.org/privilege/internet"/>
    <tizen:privilege name="http://tizen.org/privilege/application.launch"/>