int serial_io_init( const char* port, const char* strsettings )
{
HANDLE hCom = NULL;
+ DCB dcb;
+ COMMTIMEOUTS sCT;
char strport[16];
snprintf( strport, sizeof( strport ), "\\\\.\\%s", port );
return -1;
}
- DCB dcb;
-
ZeroMemory(&dcb, sizeof(DCB));
GetCommState(hCom, &dcb);
SetCommState(hCom, &dcb);
- COMMTIMEOUTS sCT;
-
memset(&sCT, 0, sizeof(sCT));
sCT.ReadTotalTimeoutConstant = 10;
**/
int serial_io_read( int fd, char * buffer, int buffer_size )
{
+ DWORD dwBytesIn = 0;
dbg(1, "serial_io_read fd = %d buffer_size = %d\n", fd, buffer_size);
- DWORD dwBytesIn = 0;
if (fd <= 0)
{
**/
int serial_io_write(int fd, const char * buffer)
{
+ DWORD dwBytesOut = 0;
dbg(1, "serial_io_write fd = %d buffer = '%s'\n",fd, buffer);
- DWORD dwBytesOut = 0;
WriteFile((HANDLE)fd, buffer, strlen(buffer), &dwBytesOut, NULL);