---
title: HwGetModemStatus
framework: serialdriverkit
role: symbol
role_heading: Instance Method
path: serialdriverkit/iouserserial/hwgetmodemstatus
---

# HwGetModemStatus

Gets the current status of the modem from the hardware.

## Declaration

```occ
virtual kern_return_t HwGetModemStatus(bool *cts, bool *dsr, bool *ri, bool *dcd);
```

## Parameters

- `cts`: On return, a Boolean variable containing the state of the clear-to-send bit. Set this value to YES when the bit is set.
- `dsr`: On return, a Boolean variable containing the state of the data-set-ready bit. Set this value to YES when the bit is set.
- `ri`: On return, a Boolean variable containing the state of the ring-indicator bit. Set this value to YES when the bit is set.
- `dcd`: On return, a Boolean variable containing the state of the data-carrier-detect bit. Set this value to YES when the bit is set.

## Return Value

Return Value kIOReturnSuccess on success, or another value if an error occurs. See Error Codes.

## Discussion

Discussion Override this method and use it to retrieve the current modem status from your hardware. Set the values of each parameter to an appropriate value based on whether the indicated bit is set.

## See Also

### Programming the Modem

- [SetModemStatus](serialdriverkit/iouserserial/setmodemstatus.md)
- [HwResetFIFO](serialdriverkit/iouserserial/hwresetfifo.md)
- [HwSendBreak](serialdriverkit/iouserserial/hwsendbreak.md)
- [HwProgramBaudRate](serialdriverkit/iouserserial/hwprogrambaudrate.md)
- [HwProgramLatencyTimer](serialdriverkit/iouserserial/hwprogramlatencytimer.md)
- [HwProgramMCR](serialdriverkit/iouserserial/hwprogrammcr.md)
- [HwProgramUART](serialdriverkit/iouserserial/hwprogramuart.md)
- [Hardware Constants](serialdriverkit/hardware-constants.md)
