| version 1.1, 2003/10/16 17:58:44 | version 1.3, 2005/02/07 14:46:14 | 
| Line 11  typedef struct { | Line 11  typedef struct { | 
 | } _CMSER, *CMSER; | } _CMSER, *CMSER; | 
 |  |  | 
 |  |  | 
| static UINT serialread(COMMNG self, BYTE *data) { | static UINT serialread(COMMNG self, UINT8 *data) { | 
 |  |  | 
 | CMSER   serial; | CMSER   serial; | 
 | COMSTAT ct; | COMSTAT ct; | 
| Line 28  static UINT serialread(COMMNG self, BYTE | Line 28  static UINT serialread(COMMNG self, BYTE | 
 | return(0); | return(0); | 
 | } | } | 
 |  |  | 
| static UINT serialwrite(COMMNG self, BYTE data) { | static UINT serialwrite(COMMNG self, UINT8 data) { | 
 |  |  | 
 | CMSER   serial; | CMSER   serial; | 
 | DWORD   writesize; | DWORD   writesize; | 
| Line 38  static UINT serialwrite(COMMNG self, BYT | Line 38  static UINT serialwrite(COMMNG self, BYT | 
 | return(1); | return(1); | 
 | } | } | 
 |  |  | 
| static BYTE serialgetstat(COMMNG self) { | static UINT8 serialgetstat(COMMNG self) { | 
 |  |  | 
 | CMSER   serial; | CMSER   serial; | 
 | DCB             dcb; | DCB             dcb; | 
| Line 53  static BYTE serialgetstat(COMMNG self) { | Line 53  static BYTE serialgetstat(COMMNG self) { | 
 | } | } | 
 | } | } | 
 |  |  | 
| static UINT serialmsg(COMMNG self, UINT msg, long param) { | static long serialmsg(COMMNG self, UINT msg, long param) { | 
 |  |  | 
 | (void)self; | (void)self; | 
 | (void)msg; | (void)msg; | 
| Line 73  static void serialrelease(COMMNG self) { | Line 73  static void serialrelease(COMMNG self) { | 
 |  |  | 
 | // ---- | // ---- | 
 |  |  | 
| COMMNG cmserial_create(UINT port, BYTE param, UINT32 speed) { | COMMNG cmserial_create(UINT port, UINT8 param, UINT32 speed) { | 
 |  |  | 
 | char    commstr[16]; | char    commstr[16]; | 
 | HANDLE  hdl; | HANDLE  hdl; | 
| Line 89  COMMNG cmserial_create(UINT port, BYTE p | Line 89  COMMNG cmserial_create(UINT port, BYTE p | 
 | goto cscre_err1; | goto cscre_err1; | 
 | } | } | 
 | GetCommState(hdl, &dcb); | GetCommState(hdl, &dcb); | 
| for (i=0; i<(sizeof(cmserial_speed)/sizeof(UINT32)); i++) { | for (i=0; i<NELEMENTS(cmserial_speed); i++) { | 
 | if (cmserial_speed[i] >= speed) { | if (cmserial_speed[i] >= speed) { | 
 | dcb.BaudRate = cmserial_speed[i]; | dcb.BaudRate = cmserial_speed[i]; | 
 | break; | break; | 
 | } | } | 
 | } | } | 
| dcb.ByteSize = (BYTE)(((param >> 2) & 3) + 5); | dcb.ByteSize = (UINT8)(((param >> 2) & 3) + 5); | 
 | switch(param & 0x30) { | switch(param & 0x30) { | 
 | case 0x10: | case 0x10: | 
 | dcb.Parity = ODDPARITY; | dcb.Parity = ODDPARITY; |