/** * Check function for HPI union SaHpiSensorReadingUnionT */ public static bool Check( SaHpiSensorReadingUnionT x, long mod ) { if ( x == null ) { return false; } if ( mod == HpiConst.SAHPI_SENSOR_READING_TYPE_BUFFER ) { if ( x.SensorBuffer == null ) { return false; } } if ( mod == HpiConst.SAHPI_SENSOR_READING_TYPE_BUFFER ) { if ( x.SensorBuffer.Length != HpiConst.SAHPI_SENSOR_BUFFER_LENGTH ) { return false; } } return true; }
public void MarshalSaHpiSensorReadingUnionT( SaHpiSensorReadingUnionT x, long mod ) { if ( mod == HpiConst.SAHPI_SENSOR_READING_TYPE_INT64 ) { MarshalSaHpiInt64T( x.SensorInt64 ); } if ( mod == HpiConst.SAHPI_SENSOR_READING_TYPE_UINT64 ) { MarshalSaHpiUint64T( x.SensorUint64 ); } if ( mod == HpiConst.SAHPI_SENSOR_READING_TYPE_FLOAT64 ) { MarshalSaHpiFloat64T( x.SensorFloat64 ); } if ( mod == HpiConst.SAHPI_SENSOR_READING_TYPE_BUFFER ) { MarshalByteArray( x.SensorBuffer, HpiConst.SAHPI_SENSOR_BUFFER_LENGTH ); } }
public SaHpiSensorReadingUnionT DemarshalSaHpiSensorReadingUnionT( long mod ) { SaHpiSensorReadingUnionT x = new SaHpiSensorReadingUnionT(); if ( mod == HpiConst.SAHPI_SENSOR_READING_TYPE_INT64 ) { x.SensorInt64 = DemarshalSaHpiInt64T(); } if ( mod == HpiConst.SAHPI_SENSOR_READING_TYPE_UINT64 ) { x.SensorUint64 = DemarshalSaHpiUint64T(); } if ( mod == HpiConst.SAHPI_SENSOR_READING_TYPE_FLOAT64 ) { x.SensorFloat64 = DemarshalSaHpiFloat64T(); } if ( mod == HpiConst.SAHPI_SENSOR_READING_TYPE_BUFFER ) { x.SensorBuffer = DemarshalByteArray( HpiConst.SAHPI_SENSOR_BUFFER_LENGTH ); } return x; }