2 * Copyright 2009, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
10 #include <SupportDefs.h>
49 #define B_STOP_BIT_1 B_STOP_BITS_1
59 B_HARDWARE_CONTROL
= 0x00000001,
60 B_SOFTWARE_CONTROL
= 0x00000002
67 virtual ~BSerialPort();
69 status_t
Open(const char* portName
);
72 ssize_t
Read(void* buf
, size_t count
);
73 ssize_t
Write(const void* buf
, size_t count
);
74 void SetBlocking(bool blocking
);
75 status_t
SetTimeout(bigtime_t microSeconds
);
77 status_t
SetDataRate(data_rate bitsPerSecond
);
80 void SetDataBits(data_bits numBits
);
82 void SetStopBits(stop_bits numBits
);
85 void SetParityMode(parity_mode which
);
86 parity_mode
ParityMode();
91 void SetFlowControl(uint32 method
);
94 status_t
SetDTR(bool asserted
);
95 status_t
SetRTS(bool asserted
);
96 status_t
NumCharsAvailable(int32
* waitThisMany
);
103 ssize_t
WaitForInput();
105 int32
CountDevices();
106 status_t
GetDeviceName(int32 index
, char* name
,
107 size_t bufSize
= B_OS_NAME_LENGTH
);
111 int _DriverControl();
112 virtual void _ReservedSerialPort1();
113 virtual void _ReservedSerialPort2();
114 virtual void _ReservedSerialPort3();
115 virtual void _ReservedSerialPort4();
121 parity_mode fParityMode
;
129 #endif //_SERIAL_PORT_H