private void Button_Click2(object sender, RoutedEventArgs e) { int ret; IAsyncAction ConnectAction = Windows.System.Threading.ThreadPool.RunAsync((ConnectThread) => { SID = iotc.IOTC_Get_SessionID(); ret = iotc.IOTC_Connect_ByUID_Parallel("XXXXXXXXXXXXXXXXXXXXX", SID); //put UID here CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync( Windows.UI.Core.CoreDispatcherPriority.High, new Windows.UI.Core.DispatchedHandler(() => { UpdateUI("IOTC_Get_SessionID = " + SID + ", Connect [" + ret + "]"); })); nRDTIndex = rdt.RDT_Create(SID, RDT_WAIT_TIMEMS, 0); CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync( Windows.UI.Core.CoreDispatcherPriority.High, new Windows.UI.Core.DispatchedHandler(() => { UpdateUI("RDT Create [" + nRDTIndex + "]"); })); if (nRDTIndex < 0) { iotc.IOTC_Session_Close(SID); iotc.IOTC_DeInitialize(); rdt.RDT_DeInitialize(); } }); }
private void Button_Click4(object sender, RoutedEventArgs e) { running = false; new System.Threading.ManualResetEvent(false).WaitOne(500); AV1.avClientStop(avIndex); new System.Threading.ManualResetEvent(false).WaitOne(500); AV1.avDeInitialize(); IOTC1.IOTC_DeInitialize(); UpdateUI("DeInitialize"); }
private void Button_Click3(object sender, RoutedEventArgs e) { IOTC1.IOTC_Session_Close(SID); IOTC1.IOTC_DeInitialize(); }