Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years ago.
Clarification on base class
Hi,
MODSERIAL inherits Serial, which itself inherits SerialBase and Stream
Stream defines the putc and getc methods On the other hand, there is the RawSerial interface that defines the same methods putc getc
Do you know if there is a reason for this redundancy ?
Thank you for your help
Question relating to:
1 Answer
9 years ago.
RawSerial defines it in a different way, which skips the stdio layer that Stream uses. The Stream implementation is due to this more extensive and more flexible. However it is slower, and it is not allowed to be used in an IRQ when using RTOS, which is the main reason for RawSerial existing.