Exemplo n.º 1
0
    public void SetWifiConnectedStatus(bool isConnected)
    {
        if (!IsWifiOpen)
        {
            return;
        }

        IsWifiConnected = isConnected;
        if (!IsWifiConnected)
        {
            Image.sprite = WifiUnconnectedTexture;
            Debug.Log("WifiStrengthIcon:WifiUnconnectedTexture");
        }
        else
        {
            if (IsWifiConnected && !WifiManage.Instance.IsChangeStrength)
            {
                CurWifiStrength = WifiManage.Instance.GetWifiStrength();
            }
            else if (IsWifiConnected && WifiManage.Instance.IsChangeStrength)
            {
                CurWifiStrength = WifiManage.Instance.ConnectedWifiStrength;
            }
            else
            {
                CurWifiStrength = WifiStrength.Null;
            }
            SetWifiStrength(CurWifiStrength);
            Debug.Log("WifiStrengthIcon:" + CurWifiStrength);
        }
    }
Exemplo n.º 2
0
    public void Init(bool isOpen, bool isConnected)
    {
        if (Image == null)
        {
            Image = this.GetComponent <Image>();
        }
        IsWifiOpen      = isOpen;
        IsWifiConnected = isConnected;

        SetWifiSwitchStatus(IsWifiOpen, IsWifiConnected);

        if (IsWifiConnected && !WifiManage.Instance.IsChangeStrength)
        {
            CurWifiStrength = WifiManage.Instance.GetWifiStrength();
        }
        else if (IsWifiConnected && WifiManage.Instance.IsChangeStrength)
        {
            CurWifiStrength = WifiManage.Instance.ConnectedWifiStrength;
        }
        else
        {
            CurWifiStrength = WifiStrength.Null;
        }

        SetWifiConnectedStatus(isConnected);
    }
Exemplo n.º 3
0
 public WifiInfo(int networkId, string name, string macAddress, string capabilities, WifiStrength wifiStrength, WifiStatus wifiStatus, bool needPassword, bool is5G)
 {
     NetworkId    = networkId;
     Name         = name;
     MacAddress   = macAddress;
     Capabilities = capabilities;
     WifiStrength = wifiStrength;
     WifiStatus   = wifiStatus;
     NeedPassword = needPassword;
     Is5G         = is5G;
 }
Exemplo n.º 4
0
    public bool Is5G; //是否是5G信号

    public WifiInfo(JWifiInfo jWifiInfo)
    {
        NetworkId    = jWifiInfo.networkID;
        Name         = jWifiInfo.SSID;
        MacAddress   = jWifiInfo.BSSID;
        Capabilities = jWifiInfo.capabilities;
        WifiStrength = (WifiStrength)jWifiInfo.level;
        WifiStatus   = (WifiStatus)jWifiInfo.wifiStatus;
        NeedPassword = jWifiInfo.needPassword;
        Is5G         = jWifiInfo.is5G;
    }
Exemplo n.º 5
0
    public void SetWifiStrength(WifiStrength wifiStrength)
    {
        if (!IsWifiOpen || !IsWifiConnected)
        {
            return;
        }

        if (Image == null || WifiStrengths == null)
        {
            return;
        }

        CurWifiStrength = wifiStrength;
        WifiManage.Instance.IsChangeStrength      = true;
        WifiManage.Instance.ConnectedWifiStrength = wifiStrength;
        int index = (int)CurWifiStrength;

        if (index <= WifiStrengths.Length - 1)
        {
            Image.sprite = WifiStrengths[index];
        }

        Debug.Log("set WifiStrength:" + CurWifiStrength);
    }
 private void WifiStrengthChange(WifiStrength wifiStrength)
 {
     Svr.SvrLog.Log("DeviceStatusPanel,WifiStrengthChange," + wifiStrength);
     WSIcon.SetWifiStrength(wifiStrength);
 }