Example #1
0
 protected void initDevice(QueryDeviceInfoEventArg arg)
 {
     Console.WriteLine(arg.error);
     if (arg.error == CSTAUniversalFailure_t.allOK)
     {
         this.device_info            = arg.arg;
         this.device_associated_info = arg.att_arg;
     }
     else
     {
         throw new DeviceExeption(this.device, "initDevice " + arg.error);
     }
 }
Example #2
0
        public CSTAConfirmationEvent Parse(IStructReader reader)
        {
            Logger logger = LogManager.GetLogger("TSAPIClient");

            try
            {
                object result;

                logger.Info("CSTAQueryDeviceInfoConfParser.Parse: eventType=CSTA_QUERY_DEVICE_INFO_CONF");
                logger.Info("CSTAQueryDeviceInfoConfParser.Parse: try to read the CSTAQueryDeviceInfoConfEvent_t confirmation event...");

                if (reader.TryReadStruct(typeof(CSTAQueryDeviceInfoConfEvent_t), out result))
                {
                    logger.Info("CSTAQueryDeviceInfoConfParser.Parse: successfully read the CSTAQueryDeviceInfoConfEvent_t confirmation event!");

                    CSTAQueryDeviceInfoConfEvent_t queryDeviceInfo = (CSTAQueryDeviceInfoConfEvent_t)result;

                    logger.Info("CSTAQueryDeviceInfoConfParser.Parse: deviceType={0}", queryDeviceInfo.deviceType);

                    CSTAConfirmationEvent cstaConfirmation = new CSTAConfirmationEvent
                    {
                        u = { queryDeviceInfo = queryDeviceInfo }
                    };

                    return(cstaConfirmation);
                }

                return(null);
            }
            catch (Exception err)
            {
                logger.Error(string.Format("Error in CSTAQueryDeviceInfoConfParser.Parse: {0}", err));
            }

            return(null);
        }
Example #3
0
 public QueryDeviceInfoReturn(CstaConfirmationEvent a1, ATTEvent_t a2)
 {
     Csta = a1.queryDeviceInfo;
     Att  = a2.queryDeviceInfo;
 }