Jump to content

ASYNC SETMODEMCTRL: Difference between revisions

From EDM2
Created page with "This function sets the modem control signals. ; Category:IOCTL_ASYNC (01h) ; Function:ASYNC_SETMODEMCTRL (46h) ==Parameter Packet Format== <pre> ┌───────..."
 
Ak120 (talk | contribs)
mNo edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This function sets the modem control signals.  
{{DISPLAYTITLE:ASYNC_SETMODEMCTRL}}
 
This function sets the modem control signals.
; Category:IOCTL_ASYNC (01h)  
; Category:IOCTL_ASYNC (01h)
; Function:ASYNC_SETMODEMCTRL (46h)  
; Function:ASYNC_SETMODEMCTRL (46h)


==Parameter Packet Format==
==Parameter Packet Format==
Line 14: Line 14:
└──────────────────────────────────────────────────────┘
└──────────────────────────────────────────────────────┘
</pre>
</pre>
;Related C Data Structure  
;Related C Data Structure
The MODEMSTATUS data structure can be used by C programmers.
 
To include this data structure in your file, make sure INCL_DOSDEVIOCTL is defined before you include OS2.H.
 
;Modem Control Signals ON Mask
The physical device driver sets the modem control signals as defined in this field. Bit 0 is DTR; bit 1 is RTS. If any other bits are set/reset by the masks, then a general failure error results. The OFF mask contains a mask (with all bits equal to 0) to turn the modem control signal off. The ON mask contains a mask (with all bits equal to 1) to turn the modem control signal on. If the Parameter Packet indicates both turn off and turn on on the same bit, the bit will be turned on.
 
For example:
<pre>
┌─────────┬───────────┬───────────────┐
│Mask ON  │Mask OFF  │Description    │
├─────────┼───────────┼───────────────┤
│  01h  │  FFh    │Set DTR        │
├─────────┼───────────┼───────────────┤
│  00h  │  FEh    │Clear DTR      │
├─────────┼───────────┼───────────────┤
│  02h  │  FFh    │Set RTS        │
├─────────┼───────────┼───────────────┤
│  00h  │  FDh    │Clear RTS      │
├─────────┼───────────┼───────────────┤
│  03h  │  FFh    │Set DTR and RTS│
├─────────┼───────────┼───────────────┤
│  00h  │  FCh    │Clear DTR and  │
│        │          │RTS            │
└─────────┴───────────┴───────────────┘
</pre>
If DTR Control mode input handshaking, RTS Control mode input handshaking or toggling on transmit is set, then this request cannot try to change the state of the modem control signals, that are being used for input handshaking or toggling on transmit. If the request tries to modify a modem control signal that is being used for input handshaking or toggling on transmit, a general failure error results.


The MODEMSTATUS data structure can be used by C programmers.  
;Modem Control Signals OFF Mask
See Modem Control Signals ON Mask above.


To include this data structure in your file, make sure INCL_DOSDEVIOCTL is defined before you include OS2.H.
==Data Packet Format==
==Data Packet Format==
<pre>
<pre>
Line 31: Line 58:
If the call is made with invalid Parameter Packet values and a general failure error is reported, then the modem control signals are not changed and the Data Packet information returned to the application is undefined.  
If the call is made with invalid Parameter Packet values and a general failure error is reported, then the modem control signals are not changed and the Data Packet information returned to the application is undefined.  


[[Category:IOCtl Commands]]
[[Category:IOCtl Function]]
{{DISPLAYTITLE:SYNC_SETMODEMCTRL (46h)}}

Latest revision as of 19:05, 22 October 2021

This function sets the modem control signals.

Category
IOCTL_ASYNC (01h)
Function
ASYNC_SETMODEMCTRL (46h)

Parameter Packet Format

┌──────────────────────────────────────────────────────┐
│Field                          Length     C Datatype  │
├──────────────────────────────────────────────────────┤
│Modem Control Signals ON Mask  BYTE       BYTE        │
├──────────────────────────────────────────────────────┤
│Modem Control Signals OFF Mask BYTE       BYTE        │
└──────────────────────────────────────────────────────┘
Related C Data Structure

The MODEMSTATUS data structure can be used by C programmers.

To include this data structure in your file, make sure INCL_DOSDEVIOCTL is defined before you include OS2.H.

Modem Control Signals ON Mask

The physical device driver sets the modem control signals as defined in this field. Bit 0 is DTR; bit 1 is RTS. If any other bits are set/reset by the masks, then a general failure error results. The OFF mask contains a mask (with all bits equal to 0) to turn the modem control signal off. The ON mask contains a mask (with all bits equal to 1) to turn the modem control signal on. If the Parameter Packet indicates both turn off and turn on on the same bit, the bit will be turned on.

For example:

┌─────────┬───────────┬───────────────┐
│Mask ON  │Mask OFF   │Description    │
├─────────┼───────────┼───────────────┤
│   01h   │   FFh     │Set DTR        │
├─────────┼───────────┼───────────────┤
│   00h   │   FEh     │Clear DTR      │
├─────────┼───────────┼───────────────┤
│   02h   │   FFh     │Set RTS        │
├─────────┼───────────┼───────────────┤
│   00h   │   FDh     │Clear RTS      │
├─────────┼───────────┼───────────────┤
│   03h   │   FFh     │Set DTR and RTS│
├─────────┼───────────┼───────────────┤
│   00h   │   FCh     │Clear DTR and  │
│         │           │RTS            │
└─────────┴───────────┴───────────────┘

If DTR Control mode input handshaking, RTS Control mode input handshaking or toggling on transmit is set, then this request cannot try to change the state of the modem control signals, that are being used for input handshaking or toggling on transmit. If the request tries to modify a modem control signal that is being used for input handshaking or toggling on transmit, a general failure error results.

Modem Control Signals OFF Mask

See Modem Control Signals ON Mask above.

Data Packet Format

┌───────────────────────────────────────────────────┐
│Field                       Length     C Datatype  │
├───────────────────────────────────────────────────┤
│COM Error WORD (COMERR)     WORD       USHORT      │
└───────────────────────────────────────────────────┘

Returns

If the call is made with invalid Parameter Packet values and a general failure error is reported, then the modem control signals are not changed and the Data Packet information returned to the application is undefined.