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) { } }
public void AttReadBlobRsp(AttReadBlobRsp.RspInfo rspInfo) { if (InvokeRequired) { try { Invoke((Delegate)new AttReadBlobRsp.AttReadBlobRspDelegate(AttReadBlobRsp), rspInfo); } catch { } } else { ClearRspDelegates(); if (!rspInfo.Success) { string msg = "Att Read Blob Command Failed\n"; if (DisplayMsgCallback != null) DisplayMsgCallback(SharedAppObjs.MsgType.Error, msg); msgBox.UserMsgBox(SharedObjects.MainWin, MsgBox.MsgTypes.Error, msg); } else if ((int)rspInfo.Header.EventStatus != 26) { string msg = "Att Read Blob 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); } else LoadData(key); RestoreFormInput(); } }