@@ -126,6 +126,46 @@ class Serial_ : public Stream
126126 virtual size_t write (const uint8_t *buffer, size_t size);
127127 using Print::write; // pull in write(str) from Print
128128 operator bool ();
129+
130+ // This method allows processing "SEND_BREAK" requests sent by
131+ // the USB host. Those requests indicate that the host wants to
132+ // send a BREAK signal and are accompanied by a single uint16_t
133+ // value, specifying the duration of the break. The value 0
134+ // means to end any current break, while the value 0xffff means
135+ // to start an indefinite break.
136+ // readBreak() will return the value of the most recent break
137+ // request, but will return it at most once, returning -1 when
138+ // readBreak() is called again (until another break request is
139+ // received, which is again returned once).
140+ // This also mean that if two break requests are received
141+ // without readBreak() being called in between, the value of the
142+ // first request is lost.
143+ // Note that the value returned is a long, so it can return
144+ // 0-0xffff as well as -1.
145+ int32_t readBreak ();
146+
147+ // These return the settings specified by the USB host for the
148+ // serial port. These aren't really used, but are offered here
149+ // in case a sketch wants to act on these settings.
150+ uint32_t baud ();
151+ uint8_t stopbits ();
152+ uint8_t paritytype ();
153+ uint8_t numbits ();
154+ bool dtr ();
155+ bool rts ();
156+ enum {
157+ ONE_STOP_BIT = 0 ,
158+ ONE_AND_HALF_STOP_BIT = 1 ,
159+ TWO_STOP_BITS = 2 ,
160+ };
161+ enum {
162+ NO_PARITY = 0 ,
163+ ODD_PARITY = 1 ,
164+ EVEN_PARITY = 2 ,
165+ MARK_PARITY = 3 ,
166+ SPACE_PARITY = 4 ,
167+ };
168+
129169private:
130170 USBDeviceClass &usb;
131171 RingBuffer *_cdc_rx_buffer;
0 commit comments