| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | ASYNC_SETLINECTRL How to |
EH> Hi,
EH>
EH> Can somebody please provide me with an example of how to
EH> set the nr of databits, the parity and the number of
EH> stopbits using DosDevIOCtl(). I am a little confused about
EH> the format and size of the parameterlist.
EH>
EH> Erwin
Hi Erwin!
Find the part of your compiler's OS/2 C headers that should define a
LINECONTROL structure and the values of IOCTL_ASYNC and
ASYNC_SETLINECTL. Read these headers--it usually helps to know what
your are doing :).
Then you might use this clipped bit of code as an example (the
variable parity is of type parity_t which is an enum I use, use your
own if you like:)
LINECONTROL lc;
ULONG ulParamLen = sizeof(lc);
// set line parity, data bits, and stop bits.
switch(parity)
{
case NOPAR:
lc.bParity = 0;
break;
case ODDPAR:
lc.bParity = 1;
break;
case EVNPAR:
lc.bParity = 2;
break;
case MRKPAR:
lc.bParity = 3;
break;
case SPAPAR:
lc.bParity = 4;
break;
default:
break;
}
if(dataBits > 4 && dataBits < 10)
lc.bDataBits = dataBits;
if(stopBits >= 0 && stopBits < 3)
switch(stopBits)
{
case 1:
lc.bStopBits = 0;
break;
case 2:
lc.bStopBits = 2;
break;
default:
break;
}
lastResult = DosDevIOCtl(hf, IOCTL_ASYNC, ASYNC_SETLINECTRL, (PVOID)&lc,
sizeof(lc), &ulParamLen, NULL, 0, (PULONG)NULL);
--- Maximus/2 3.01
* Origin: Cuerna Verde BBS (1:307/3)SEEN-BY: 50/99 54/99 270/101 620/243 625/160 711/401 413 430 934 712/311 407 SEEN-BY: 712/505 506 517 623 624 704 713/317 800/1 @PATH: 307/1 3615/50 396/1 270/101 712/624 711/934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.