if
(!ReadFile(h, data, bytes, &n, NULL))
if
(print_data)
{
}
return
}
int
rs_flush(void* port)
{
HANDLE h = (HANDLE)port;
FlushFileBuffers(h);
return
}
int
rs_bytesWaiting(void* port)
{
//Check to see how many characters are unread
COMSTAT stat;
DWORD dwErrors = 0;
HANDLE h = (HANDLE)port;
if
(!ClearCommError(h, &dwErrors, &stat))
{
}
return
}
unsigned char
0x06, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x12, 0xAF, 0x88, 0x03};
unsigned char
0x06, 0x0FF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0C, 0x00, 0x63, 0xA8,
0x03};
// RS232 define
#define
#define
#define
// reponse en mode simpe
#define
#define
COM_TIME_OUT 10
#define
SIZE_RX 65536
int
i_TimOut = 0;
int
i_Eta = 0;
unsigned char
© 2016 Cairpol
return
-1;
print_trame(data, bytes);
n;
0;
return
0;
stat.cbInQue;
TrameInst[]= {0xFF, 0x02, 0x13, 0x30, 0x01, 0x02, 0x03, 0x04, 0x05,
Trame10M[] = {0xFF, 0x02, 0x14, 0x30, 0x01, 0x02, 0x03, 0x04, 0x05,
SYNC_BYTE
STX_BYTE
ETX_BYTE
RSP_BYTE
Tc_RX[2048];
0xFF
0x02
0x03
0x30
CairSPM sensor
31