Exemple #1
0
        /// <summary>
        /// Calls WiFiAP.ConnectAsync() to connect the Wi-Fi AP
        /// </summary>
        /// <param name="essid">ESSID of Wi-Fi AP to connect</param>
        /// <param name="password">Password of Wi-Fi AP to connect</param>
        /// <returns>Task to do ConnectAsync</returns>
        public Task Connect(string essid, string password)
        {
            Logger.Log("Connect() " + essid + " " + password);
            // Get a WiFiAP instance with essid from Wi-Fi AP list
            WiFiAP ap = FindAP(essid);

            // Set password
            if (password.Length > 0)
            {
                ap.SecurityInformation.SetPassphrase(password);
            }
            return(ap.ConnectAsync());
        }
Exemple #2
0
        /// <summary>
        /// Call WiFiAP.ConnectAsync() to connect the Wi-Fi AP
        /// </summary>
        /// <param name="essid">ESSID of Wi-Fi AP to connect</param>
        /// <param name="password">password of Wi-Fi AP to connect</param>
        /// <returns>Task to do ConnectAsync</returns>
        public Task Connect(String essid, String password)
        {
            LogImplementation.DLog("Connect() " + essid + " " + password);
            // Get a WiFiAP instance with essid from Wi-Fi AP list
            WiFiAP ap = FindAP(essid);

            // Set password
            if (password.Length > 0)
            {
                ap.SecurityInformation.SetPassphrase(password);
            }
            // Call Tizen C# API
            return(ap.ConnectAsync());
        }
Exemple #3
0
        /// <summary>
        /// Calls WiFiAP.ConnectAsync() to connect the Wi-Fi AP
        /// </summary>
        /// <param name="essid">ESSID of Wi-Fi AP to connect</param>
        /// <param name="password">Password of Wi-Fi AP to connect</param>
        /// <returns>Task to do ConnectAsync</returns>
        public Task Connect(string essid, string password)
        {
            Logger.Log("Connect() " + essid + " " + password);
            // Get a WiFiAP instance with essid from Wi-Fi AP list
            WiFiAP ap = FindAP(essid);

            if (ap == null)
            {
                return(Task.FromException(new ArgumentException("Cannot find " + essid)));
            }
            // Set password
            if (password.Length > 0)
            {
                ap.SecurityInformation.SetPassphrase(password);
            }

            return(ap.ConnectAsync());
        }