Exemple #1
0
 public RspDataInThread(DeviceForm deviceForm)
 {
     ExtCmdStatus = new ExtCmdStatus();
     AttErrorRsp = new AttErrorRsp();
     m_attFindInfoRsp = new AttFindInfoRsp(deviceForm);
     m_attFindByTypeValueRsp = new AttFindByTypeValueRsp(deviceForm);
     m_attReadByTypeRsp = new AttReadByTypeRsp(deviceForm);
     AttReadRsp = new AttReadRsp(deviceForm);
     AttReadBlobRsp = new AttReadBlobRsp(deviceForm);
     m_attReadByGrpTypeRsp = new AttReadByGrpTypeRsp(deviceForm);
     AttWriteRsp = new AttWriteRsp();
     AttPrepareWriteRsp = new AttPrepareWriteRsp();
     AttExecuteWriteRsp = new AttExecuteWriteRsp();
     AttHandleValueNotification = new AttHandleValueNotification(deviceForm);
     AttHandleValueIndication = new AttHandleValueIndication(deviceForm);
     m_taskThread = new Thread(new ParameterizedThreadStart(TaskThread));
     m_taskThread.Name = moduleName;
     m_taskThread.Start(m_threadData);
     Thread.Sleep(0);
     while (!m_taskThread.IsAlive)
     { }
 }
Exemple #2
0
 public RspDataInThread(DeviceForm deviceForm)
 {
     ExtCmdStatus            = new ExtCmdStatus();
     AttErrorRsp             = new AttErrorRsp();
     m_attFindInfoRsp        = new AttFindInfoRsp(deviceForm);
     m_attFindByTypeValueRsp = new AttFindByTypeValueRsp(deviceForm);
     m_attReadByTypeRsp      = new AttReadByTypeRsp(deviceForm);
     AttReadRsp                 = new AttReadRsp(deviceForm);
     AttReadBlobRsp             = new AttReadBlobRsp(deviceForm);
     m_attReadByGrpTypeRsp      = new AttReadByGrpTypeRsp(deviceForm);
     AttWriteRsp                = new AttWriteRsp();
     AttPrepareWriteRsp         = new AttPrepareWriteRsp();
     AttExecuteWriteRsp         = new AttExecuteWriteRsp();
     AttHandleValueNotification = new AttHandleValueNotification(deviceForm);
     AttHandleValueIndication   = new AttHandleValueIndication(deviceForm);
     m_taskThread               = new Thread(new ParameterizedThreadStart(TaskThread));
     m_taskThread.Name          = moduleName;
     m_taskThread.Start(m_threadData);
     Thread.Sleep(0);
     while (!m_taskThread.IsAlive)
     {
     }
 }
Exemple #3
0
 public void AttPrepareWriteRsp(AttPrepareWriteRsp.RspInfo rspInfo)
 {
     if (InvokeRequired)
     {
         try
         {
             Invoke((Delegate)new AttPrepareWriteRsp.AttPrepareWriteRspDelegate(AttPrepareWriteRsp), rspInfo);
         }
         catch { }
     }
     else
     {
         ClearRspDelegates();
         if (!rspInfo.success)
         {
             string msg = "Att Prepare Write Command Failed\n";
             if (DisplayMsgCallback != null)
                 DisplayMsgCallback(SharedAppObjs.MsgType.Error, msg);
             msgBox.UserMsgBox(SharedObjects.MainWin, MsgBox.MsgTypes.Error, msg);
         }
         else
         {
             string msg = "Att Prepare Write Command Failed\n" + "Status = " + devUtils.GetStatusStr(rspInfo.header.EventStatus) + "\n";
             if (DisplayMsgCallback != null)
                 DisplayMsgCallback(SharedAppObjs.MsgType.Error, msg);
             msgBox.UserMsgBox(SharedObjects.MainWin, MsgBox.MsgTypes.Error, msg);
         }
         RestoreFormInput();
     }
 }