32/33
Sentech GigE Vision Camera StGigE SDK
Sample Guide Rev.1.00
BOOL GetSerialData(PvDevice *pDevice)
{
PvSerialPortIPEngine lSerialPort;
BOOL bReval;
bReval = SerialPortOpen( pDevice, &lSerialPort, 0 );
if( !bReval ) return FALSE;
BYTE byteSend[] = {0x02,0x00,0x30,0x01,0x00,0x03};
printf( "SendData " );
for( int i=0; i<sizeof(byteSend); i++ )
printf( "%02X ",byteSend[i] );
printf( "\n\n" );
BYTE byteRcv[4];
WORD wReadSize=0;
bReval=SerialDataSendRev(&lSerialPort,&byteSend[0],sizeof(byteSend),&byteRcv[0],sizeof(byteRcv),
&wReadSize );
if( bReval ){
printf( "RcvData " );
for( int i=0; i<wReadSize; i++ )
printf( "%02X ",byteRcv[i] );
printf( "\n\n" );
}
SerialPortClose( &lSerialPort );
return bReval;
}