Changeset 69907 in vbox for trunk/include/iprt
- Timestamp:
- Dec 3, 2017 8:54:16 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/serialport.h
r69895 r69907 53 53 #define NIL_RTSERIALPORT ((RTSERIALPORT)0) 54 54 55 56 /**57 * Serial port event.58 */59 typedef enum RTSERIALPORTEVT60 {61 /** Invalid event. */62 RTSERIALPORTEVT_INVALID = 0,63 /** Data was received and can be read. */64 RTSERIALPORTEVT_DATA_RX,65 /** All data was transmitted and there is room again in the transmit buffer. */66 RTSERIALPORTEVT_DATA_TX,67 /** A BREAK condition was detected on the communication channel. */68 RTSERIALPORTEVT_BREAK_DETECTED,69 /** One of the monitored status lines changed, check with RTSerialPortQueryStatusLines(). */70 RTSERIALPORTEVT_STATUS_LINE_CHANGED,71 /** Status line monitor failed with an error and status line monitoring is disabled. */72 RTSERIALPORTEVT_STATUS_LINE_MONITOR_FAILED,73 /** 32bit hack. */74 RTSERIALPORTEVT_32BIT_HACK = 0x7fffffff75 } RTSERIALPORTEVT;76 /** Pointer to a serial port event enum. */77 typedef RTSERIALPORTEVT *PRTSERIALPORTEVT;78 55 79 56 /** … … 160 137 * @{ */ 161 138 /** Open the serial port with the receiver enabled to receive data. */ 162 #define RT _SERIALPORT_OPEN_F_READ RT_BIT(0)139 #define RTSERIALPORT_OPEN_F_READ RT_BIT(0) 163 140 /** Open the serial port with the transmitter enabled to transmit data. */ 164 #define RT _SERIALPORT_OPEN_F_WRITE RT_BIT(1)141 #define RTSERIALPORT_OPEN_F_WRITE RT_BIT(1) 165 142 /** Open the serial port with status line monitoring enabled to get notified about status line changes. */ 166 #define RT _SERIALPORT_OPEN_F_SUPPORT_STATUS_LINE_MONITORING RT_BIT(2)143 #define RTSERIALPORT_OPEN_F_SUPPORT_STATUS_LINE_MONITORING RT_BIT(2) 167 144 /** Open the serial port with BREAK condition detection enabled (Requires extra work on some hosts). */ 168 #define RT _SERIALPORT_OPEN_F_DETECT_BREAK_CONDITION RT_BIT(3)145 #define RTSERIALPORT_OPEN_F_DETECT_BREAK_CONDITION RT_BIT(3) 169 146 /** Open the serial port with loopback mode enabled. */ 170 #define RT _SERIALPORT_OPEN_F_ENABLE_LOOPBACK RT_BIT(4)147 #define RTSERIALPORT_OPEN_F_ENABLE_LOOPBACK RT_BIT(4) 171 148 /** Bitmask of valid flags. */ 172 #define RT _SERIALPORT_OPEN_F_VALID_MASK UINT32_C(0x0000001f)149 #define RTSERIALPORT_OPEN_F_VALID_MASK UINT32_C(0x0000001f) 173 150 /** @} */ 174 151 … … 177 154 * @{ */ 178 155 /** Change the RTS (Ready To Send) line signal. */ 179 #define RT _SERIALPORT_CHG_STS_LINES_F_RTS RT_BIT(0)156 #define RTSERIALPORT_CHG_STS_LINES_F_RTS RT_BIT(0) 180 157 /** Change the DTR (Data Terminal Ready) line signal. */ 181 #define RT _SERIALPORT_CHG_STS_LINES_F_DTR RT_BIT(1)158 #define RTSERIALPORT_CHG_STS_LINES_F_DTR RT_BIT(1) 182 159 /** Bitmask of valid flags. */ 183 #define RT _SERIALPORT_CHG_STS_LINES_F_VALID_MASK UINT32_C(0x00000003)160 #define RTSERIALPORT_CHG_STS_LINES_F_VALID_MASK UINT32_C(0x00000003) 184 161 /** @} */ 185 162 … … 188 165 * @{ */ 189 166 /** The DCD (Data Carrier Detect) signal is active. */ 190 #define RT _SERIALPORT_STS_LINE_DCD RT_BIT(0)167 #define RTSERIALPORT_STS_LINE_DCD RT_BIT(0) 191 168 /** The RI (Ring Indicator) signal is active. */ 192 #define RT _SERIALPORT_STS_LINE_RI RT_BIT(1)169 #define RTSERIALPORT_STS_LINE_RI RT_BIT(1) 193 170 /** The DSR (Data Set Ready) signal is active. */ 194 #define RT _SERIALPORT_STS_LINE_DSR RT_BIT(2)171 #define RTSERIALPORT_STS_LINE_DSR RT_BIT(2) 195 172 /** The CTS (Clear To Send) signal is active. */ 196 #define RT_SERIALPORT_STS_LINE_CTS RT_BIT(3) 173 #define RTSERIALPORT_STS_LINE_CTS RT_BIT(3) 174 /** @} */ 175 176 177 /** @name RTSerialPortEvtPoll flags 178 * @{ */ 179 /** Data was received and can be read. */ 180 #define RTSERIALPORT_EVT_F_DATA_RX RT_BIT(0) 181 /** All data was transmitted and there is room again in the transmit buffer. */ 182 #define RTSERIALPORT_EVT_F_DATA_TX RT_BIT(1) 183 /** A BREAK condition was detected on the communication channel. 184 * Only available when BREAK condition detection was enabled when opening the serial port .*/ 185 #define RTSERIALPORT_EVT_F_BREAK_DETECTED RT_BIT(2) 186 /** One of the monitored status lines changed, check with RTSerialPortQueryStatusLines(). 187 * Only available if status line monitoring was enabled when opening the serial port. */ 188 #define RTSERIALPORT_EVT_F_STATUS_LINE_CHANGED RT_BIT(3) 189 /** Status line monitor failed with an error and status line monitoring is disabled, 190 * this cannot be given in the event mask but will be set if status line 191 * monitoring is enabled and the monitor failed. */ 192 #define RTSERIALPORT_EVT_F_STATUS_LINE_MONITOR_FAILED RT_BIT(4) 193 /** Bitmask of valid flags. */ 194 #define RTSERIALPORT_EVT_F_VALID_MASK UINT32_C(0x0000001f) 197 195 /** @} */ 198 196 … … 204 202 * @param phSerialPort Where to store the IPRT serial port handle on success. 205 203 * @param pszPortAddress The address of the serial port (host dependent). 206 * @param fFlags Flags to open the serial port with, see RT _SERIALPORT_OPEN_F_*.204 * @param fFlags Flags to open the serial port with, see RTSERIALPORT_OPEN_F_*. 207 205 */ 208 206 RTDECL(int) RTSerialPortOpen(PRTSERIALPORT phSerialPort, const char *pszPortAddress, uint32_t fFlags); … … 308 306 * @retval VERR_INTERRUPTED if another thread interrupted the polling through RTSerialPortEvtPollInterrupt(). 309 307 * @param hSerialPort The IPRT serial port handle. 310 * @param penmEvt Where to store the event on success. 308 * @param fEvtMask The mask of events to receive, see RTSERIALPORT_EVT_F_* 309 * @param pfEvtsRecv Where to store the bitmask of events received. 311 310 * @param msTimeout Number of milliseconds to wait for an event. 312 311 */ 313 RTDECL(int) RTSerialPortEvtPoll(RTSERIALPORT hSerialPort, RTSERIALPORTEVT *penmEvt, RTMSINTERVAL msTimeout); 312 RTDECL(int) RTSerialPortEvtPoll(RTSERIALPORT hSerialPort, uint32_t fEvtMask, uint32_t *pfEvtsRecv, 313 RTMSINTERVAL msTimeout); 314 314 315 315 … … 340 340 * @returns IPRT status code. 341 341 * @param hSerialPort The IPRT serial port handle. 342 * @param fClear Combination of status lines to clear, see RT _SERIALPORT_CHG_STS_LINES_F_*.343 * @param fSet Combination of status lines to set, see RT _SERIALPORT_CHG_STS_LINES_F_*.342 * @param fClear Combination of status lines to clear, see RTSERIALPORT_CHG_STS_LINES_F_*. 343 * @param fSet Combination of status lines to set, see RTSERIALPORT_CHG_STS_LINES_F_*. 344 344 * 345 345 * @note fClear takes precedence over fSet in case the same status line bit is set in both arguments. … … 354 354 * @param hSerialPort The IPRT serial port handle. 355 355 * @param pfStsLines Where to store the bitmask of active status lines on success, 356 * see RT _SERIALPORT_STS_LINE_*.356 * see RTSERIALPORT_STS_LINE_*. 357 357 */ 358 358 RTDECL(int) RTSerialPortQueryStatusLines(RTSERIALPORT hSerialPort, uint32_t *pfStsLines);
Note:
See TracChangeset
for help on using the changeset viewer.