async private void GPIOConnector_stopStreaming(object sender, string args)
        {
            {
                await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() =>
                { // your code should be here
                    GPIOConnector GPIOcon = sender as GPIOConnector;

                    GPIOEnvironmentConnector con = this.m_GPIOEnvironmentConnectors.getGPIOOConnectorByGPIOConnector(GPIOcon);
                    if (con != null)
                    {
                        con.GPIOConnecorInitialized = false;
                    }

                    m_Environment.GPIOConnecorInitialized = m_GPIOEnvironmentConnectors.GPIOConnecorInitialized;
                    //
                    con.stopConnector();

                    if (args.Length > 0)
                    {
                        var messageDialog = new MessageDialog(args);
                        await messageDialog.ShowAsync();
                    }
                });
            }
        }
 public GPIOEnvironmentConnector getGPIOOConnectorByGPIOConnector(GPIOConnector connnector)
 {
     for (int i = 0; i < EnvironmentConnectors.Count; i++)
     {
         GPIOEnvironmentConnector con = EnvironmentConnectors[i];
         if (con.GPIOConnector == connnector)
         {
             return(con);
         }
     }
     return(null);
 }
Exemple #3
0
        public StationEnvironment()
        {
            m_HostName      = "localhost";
            m_Port          = 3005;
            m_GPIOConnector = new GPIOConnector();
            m_OutPutServiceConnectorConfig = new PropertySet();
            m_InputServiceConnectorConfig  = new PropertySet();
            m_InputServiceConnectorConfig.Add("HostName", PropertyValue.CreateString("WilliRaspiPlus"));
            m_InputServiceConnectorConfig.Add("Port", PropertyValue.CreateInt32(3005));
            m_InputServiceConnectorConfig.Add("UpdateState", PropertyValue.CreateInt32(0));

            m_GPIOOInOutBanks = null;
        }
        async private void GPIOConnector_startStreaming(object sender, Windows.Networking.Sockets.StreamSocket args)
        {
            await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            { // your code should be here
                GPIOConnector GPIOcon = sender as GPIOConnector;

                GPIOEnvironmentConnector con = this.m_GPIOEnvironmentConnectors.getGPIOOConnectorByGPIOConnector(GPIOcon);
                if (con != null)
                {
                    con.GPIOConnecorInitialized = true;
                }

                m_Environment.GPIOConnecorInitialized = m_GPIOEnvironmentConnectors.GPIOConnecorInitialized;
            });
        }