コード例 #1
0
    public void OnConnectServicesClicked()
    {
        ShowFeedback("OnConnectServicesClicked");
#if UNITY_WSA_10_0 && !UNITY_EDITOR
        if (theSelectedDevice != null)
        {
            theSelectedDevice.ConnectService();
        }
#endif
    }
コード例 #2
0
        /// <summary>
        /// Called when the user trys to connect to the devices services.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnConnectServices(object sender, RoutedEventArgs e)
        {
            // This hooks up service connections and characteristic updates
            if (theSelectedDevice.ConnectService())
            {
                _ServiceCount.Text = theSelectedDevice.ServiceCount.ToString();

                _DeviceContent.Children.Clear();
                _DeviceContent.Children.Add(new SampleUX(theSelectedDevice));
                ShowFeedback("Service / Characteristic connection made");
            }
        }