envea CAIRSENS PM Série Notice Technique page 67

Table des Matières

Publicité

Les langues disponibles

Les langues disponibles

30
Cairsens - UART Version
GetCommState(h, &dcb);
dcb.fBinary = TRUE;
dcb.BaudRate = CBR_9600;
dcb.ByteSize = 8;
dcb.Parity = NOPARITY;
dcb.StopBits = ONESTOPBIT;
//Setup the flow control
dcb.fDsrSensitivity = FALSE;
dcb.fOutxCtsFlow = FALSE;
dcb.fOutxDsrFlow = FALSE;
dcb.fOutX = FALSE;
dcb.fInX = FALSE;
if
(!SetCommState(h, &dcb))
{
CloseHandle(h);
return
}
return
(void*)h;
}
int
rs_close(void* port)
{
HANDLE h = (HANDLE)port;
CloseHandle(h);
return
0;
}
int
rs_write(void* port,
{
DWORD n = 0;
HANDLE h = (HANDLE)port;
if
(!WriteFile(h, data, bytes, &n, NULL))
return
if
(print_data)
{
printf("\n=>");
print_trame(data, bytes);
}
return
n;
}
int
rs_read(void* port, void* data,
{
DWORD n = 0;
HANDLE h = (HANDLE)port;
0;
const
void* data,
-1;
int
int
bytes)
bytes)
© 2016 Cairpol

Publicité

Chapitres

Table des Matières
loading

Ce manuel est également adapté pour:

Cairsens pm1Cairsens pm2.5Cairsens pm10

Table des Matières