Changeset 211 in xtideuniversalbios for trunk/Serial_Server/win32/Win32Serial.cpp
- Timestamp:
- Jan 16, 2012, 7:23:11 PM (13 years ago)
- google:author:
- gregli@hotmail.com
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Serial_Server/win32/Win32Serial.cpp
r209 r211 40 40 } 41 41 if( !name ) 42 log( 0, "No Physical COM Ports Found" );42 log( -1, "No physical COM ports found" ); 43 43 } 44 44 45 45 if( !strcmp( name, "PIPE" ) ) 46 46 { 47 log( 1, "Opening named pipe %s (simulating %lu baud)", PIPENAME, baudRate->rate );47 log( 0, "Opening named pipe %s (simulating %lu baud)", PIPENAME, baudRate->rate ); 48 48 49 49 pipe = CreateNamedPipeA( PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE|PIPE_REJECT_REMOTE_CLIENTS, 2, 1024, 1024, 0, NULL ); 50 50 if( !pipe ) 51 log( 0, "Could not CreateNamedPipe " PIPENAME );51 log( -1, "Could not CreateNamedPipe " PIPENAME ); 52 52 53 53 if( !ConnectNamedPipe( pipe, NULL ) ) 54 log( 0, "Could not ConnectNamedPipe" );54 log( -1, "Could not ConnectNamedPipe" ); 55 55 56 56 speedEmulation = 1; … … 61 61 if( QueryDosDeviceA( name, buff2, sizeof(buff2) ) ) 62 62 { 63 log( 1, "Opening %s (%lu baud)", name, baudRate->rate );63 log( 0, "Opening %s (%lu baud)", name, baudRate->rate ); 64 64 65 65 pipe = CreateFileA( name, GENERIC_READ|GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0 ); 66 66 if( !pipe ) 67 log( 0, "Could not Open \"%s\"", name );67 log( -1, "Could not Open \"%s\"", name ); 68 68 69 69 FillMemory(&dcb, sizeof(dcb), 0); … … 74 74 dcb.Parity = NOPARITY; 75 75 if( !SetCommState( pipe, &dcb ) ) 76 log( 0, "Could not SetCommState" );76 log( -1, "Could not SetCommState" ); 77 77 78 78 if( !SetCommTimeouts( pipe, &timeouts ) ) 79 log( 0, "Could not SetCommTimeouts" );79 log( -1, "Could not SetCommTimeouts" ); 80 80 } 81 81 else 82 82 { 83 int first = 1;84 83 char logbuff[ 1024 ]; 85 sprintf( logbuff, "Serial Port Not Found \"%s\", Available: ", name ); 86 for( int t = 1; t <= 30 && !name; t++ ) 84 int found = 0; 85 86 sprintf( logbuff, "serial port '%s' not found, detected COM ports:", name ); 87 88 for( int t = 1; t <= 40; t++ ) 87 89 { 88 90 sprintf( buff1, "COM%d", t ); 89 91 if( QueryDosDeviceA( buff1, buff2, sizeof(buff2) ) ) 90 92 { 91 if( !first ) 92 strcat( logbuff, ", " ); 93 else 94 first = 0; 93 strcat( logbuff, "\n " ); 95 94 strcat( logbuff, buff1 ); 95 found = 1; 96 96 } 97 97 } 98 log( 0, logbuff ); 98 if( !found ) 99 strcat( logbuff, "\n (none)" ); 100 101 log( -1, logbuff ); 99 102 } 100 103 }
Note:
See TracChangeset
for help on using the changeset viewer.