00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "SIO_definitions.h"
00011 #include "SIO_functions.h"
00012
00013 #include "LCD_detector_CVS.hh"
00014
00015
00016
00017
00018
00019
00020 LCD_detector_CVS::LCD_detector_CVS( const char* i_name ) : SIO_block( i_name )
00021 {
00022
00023 CRC = 0;
00024 header = "<unknown>";
00025
00026 }
00027
00028
00029
00030
00031
00032
00033 LCD_detector_CVS::~LCD_detector_CVS() {}
00034
00035
00036
00037
00038
00039
00040 unsigned int LCD_detector_CVS::getCRC() { return CRC; }
00041
00042
00043
00044
00045
00046
00047 const char* LCD_detector_CVS::getHeader() { return header.c_str(); }
00048
00049
00050
00051
00052
00053
00054 void LCD_detector_CVS::setCRC( unsigned int i_CRC ) { CRC = i_CRC; return; }
00055
00056
00057
00058
00059
00060
00061
00062 void LCD_detector_CVS::setHeader
00063 (
00064 char* i_header
00065 )
00066 {
00067
00068
00069
00070
00071 if( i_header == NULL )
00072 return;
00073
00074
00075
00076
00077 header = i_header;
00078
00079
00080
00081
00082 return;
00083 }
00084
00085
00086
00087
00088
00089
00090
00091 unsigned int LCD_detector_CVS::xfer
00092 (
00093 SIO_stream* stream,
00094 SIO_operation op,
00095 unsigned int version
00096 )
00097 {
00098 if(version) ;
00099 int
00100 nchr;
00101
00102 char
00103 *temp;
00104
00105 unsigned int
00106 status;
00107
00108
00109
00110
00111 if( op == SIO_OP_WRITE )
00112 nchr = header.size();
00113
00114 SIO_DATA( stream, &nchr, 1 );
00115
00116
00117
00118
00119 if( op == SIO_OP_WRITE )
00120 {
00121 SIO_DATA( stream, const_cast<char*>(header.c_str()), nchr );
00122 }
00123
00124 else if( op == SIO_OP_READ )
00125 {
00126 temp = static_cast<char*>(malloc( nchr + 1 ));
00127 SIO_DATA( stream, temp, nchr );
00128 temp[nchr] = '\0';
00129 header = temp;
00130 free( temp );
00131 }
00132
00133
00134
00135
00136 SIO_DATA( stream, &CRC, 1 );
00137
00138
00139
00140
00141 return( SIO_BLOCK_SUCCESS );
00142 }
00143
00144
00145
00146
00147 #define LCD_DETECTOR_CVS_MAJOR 1
00148 #define LCD_DETECTOR_CVS_MINOR 0
00149
00150
00151
00152
00153 unsigned int LCD_detector_CVS::version()
00154 { return( SIO_VERSION_ENCODE( LCD_DETECTOR_CVS_MAJOR,
00155 LCD_DETECTOR_CVS_MINOR ) ); }