public async void startConnector() { if (m_GPIOConnectorEnable && !m_GPIOConnecorInitialized) { m_GPIOInputServiceConnectorConfig["HostName"] = HostName; m_GPIOInputServiceConnectorConfig["Port"] = Port; m_GPIOInputServiceConnectorConfig["UpdateState"] = PropertyValue.CreateInt32(0); // m_GPIOInputServiceConnectorConfig.Add("UpdateState", PropertyValue.CreateInt32(0)); for (int i = 0; i < m_ActiveGPIOInOutBanks.InOutBanks.Count; i++) { GPIOOBank bank = m_ActiveGPIOInOutBanks.InOutBanks[i]; foreach (GPIOObjects OutPuts in bank.GPIOBanks) { foreach (GPIOObject GPIOObj in OutPuts.GPIOs) { UpdateInputPropertySets(GPIOObj); } } } UpdateState(1); await m_GPIOConnector.startProcessingPackagesAsync(m_GPIOInputServiceConnectorConfig, m_GPIOOutPutServiceConnectorConfig); } }
async private void StartConnector() { m_GPIOConnector.ChangeGPIOs += GPIOConnector_ChangeGPIOs; m_GPIOConnector.startStreaming += GPIOConnector_startStreaming; m_GPIOConnector.stopStreaming += GPIOConnector_stopStreaming; m_GPIOConnector.Failed += GPIOConnector_stopStreaming; m_InputServiceConnectorConfig["HostName"] = m_Environment.HostName; m_InputServiceConnectorConfig["Port"] = m_Environment.Port; for (int i = 0; i < m_Banks.InOutBanks.Count; i++) { GPIOOBank bank = m_Banks.InOutBanks[i]; foreach (GPIOObjects OutPuts in bank.GPIOBanks) { foreach (GPIOObject GPIOObj in OutPuts.GPIOs) { UpdateInputPropertySets(GPIOObj, m_InputServiceConnectorConfig); } } } UpdateState(m_InputServiceConnectorConfig, 1); await m_GPIOConnector.startProcessingPackagesAsync(m_InputServiceConnectorConfig, m_OutPutServiceConnectorConfig); }