@@ -33,7 +33,8 @@ namespace mbed {
33
33
* @{
34
34
*/
35
35
36
- /* * A serial port (UART) for communication with other serial devices
36
+ /* * @deprecated
37
+ * A serial port (UART) for communication with other serial devices
37
38
*
38
39
* Can be used for Full Duplex communication, or Simplex by specifying
39
40
* one pin as NC (Not Connected)
@@ -53,15 +54,20 @@ namespace mbed {
53
54
* }
54
55
* @endcode
55
56
*/
56
- class Serial : public SerialBase , public Stream , private NonCopyable <Serial> {
57
+ class
58
+ MBED_DEPRECATED_SINCE (
59
+ " mbed-os-6.0.0" ,
60
+ " Use UnbufferedSerial instead."
61
+ ) Serial : public SerialBase, public Stream, private NonCopyable<Serial> {
57
62
58
63
public:
59
64
#if DEVICE_SERIAL_ASYNCH
60
65
using SerialBase::read;
61
66
using SerialBase::write;
62
67
#endif
63
68
64
- /* * Create a Serial port, connected to the specified transmit and receive pins
69
+ /* * @deprecated
70
+ * Create a Serial port, connected to the specified transmit and receive pins
65
71
*
66
72
* @param tx Transmit pin
67
73
* @param rx Receive pin
@@ -71,9 +77,11 @@ class Serial : public SerialBase, public Stream, private NonCopyable<Serial> {
71
77
* @note
72
78
* Either tx or rx may be specified as NC (Not Connected) if unused
73
79
*/
80
+ MBED_DEPRECATED (" The class has been deprecated and will be removed in the future." )
74
81
Serial (PinName tx, PinName rx, const char *name = NULL , int baud = MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE);
75
82
76
- /* * Create a Serial port, connected to the specified transmit and receive pins
83
+ /* * @deprecated
84
+ * Create a Serial port, connected to the specified transmit and receive pins
77
85
*
78
86
* @param static_pinmap reference to structure which holds static pinmap.
79
87
* @param name The name of the stream associated with this serial port (optional)
@@ -82,10 +90,13 @@ class Serial : public SerialBase, public Stream, private NonCopyable<Serial> {
82
90
* @note
83
91
* Either tx or rx may be specified as NC (Not Connected) if unused
84
92
*/
93
+ MBED_DEPRECATED (" The class has been deprecated and will be removed in the future." )
85
94
Serial (const serial_pinmap_t &static_pinmap, const char *name = NULL , int baud = MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE);
95
+ MBED_DEPRECATED (" The class has been deprecated and will be removed in the future." )
86
96
Serial (const serial_pinmap_t &&, const char * = NULL , int = MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE) = delete ; // prevent passing of temporary objects
87
97
88
- /* * Create a Serial port, connected to the specified transmit and receive pins, with the specified baud
98
+ /* * @deprecated
99
+ * Create a Serial port, connected to the specified transmit and receive pins, with the specified baud
89
100
*
90
101
* @param tx Transmit pin
91
102
* @param rx Receive pin
@@ -94,31 +105,38 @@ class Serial : public SerialBase, public Stream, private NonCopyable<Serial> {
94
105
* @note
95
106
* Either tx or rx may be specified as NC (Not Connected) if unused
96
107
*/
108
+ MBED_DEPRECATED (" The class has been deprecated and will be removed in the future." )
97
109
Serial (PinName tx, PinName rx, int baud);
98
110
99
- /* * Create a Serial port, connected to the specified transmit and receive pins, with the specified baud
111
+ /* * @deprecated
112
+ * Create a Serial port, connected to the specified transmit and receive pins, with the specified baud
100
113
*
101
114
* @param static_pinmap reference to structure which holds static pinmap.
102
115
* @param baud The baud rate of the serial port
103
116
*
104
117
* @note
105
118
* Either tx or rx may be specified as NC (Not Connected) if unused
106
119
*/
120
+ MBED_DEPRECATED (" The class has been deprecated and will be removed in the future." )
107
121
Serial (const serial_pinmap_t &static_pinmap, int baud);
122
+ MBED_DEPRECATED (" The class has been deprecated and will be removed in the future." )
108
123
Serial (const serial_pinmap_t &&, int ) = delete ; // prevent passing of temporary objects
109
124
110
125
/* Stream gives us a FileHandle with non-functional poll()/readable()/writable. Pass through
111
126
* the calls from the SerialBase instead for backwards compatibility. This problem is
112
127
* part of why Stream and Serial should be deprecated.
113
128
*/
129
+ MBED_DEPRECATED (" The class has been deprecated and will be removed in the future." )
114
130
bool readable ()
115
131
{
116
132
return SerialBase::readable ();
117
133
}
134
+ MBED_DEPRECATED (" The class has been deprecated and will be removed in the future." )
118
135
bool writable ()
119
136
{
120
137
return SerialBase::writeable ();
121
138
}
139
+ MBED_DEPRECATED (" The class has been deprecated and will be removed in the future." )
122
140
bool writeable ()
123
141
{
124
142
return SerialBase::writeable ();
0 commit comments