5 years, 9 months ago.

Could SerialDriver inherit RawSerial rather than SerialBase ?

As far as I can see, SerialDriver is already compatible with RawSerial (getc, putc, puts). It would only take to change the inherited class. It would be great for compatibility with libraries using RawSerial base class. That way they would be compatible with SerialDriver without any changes.

Using SerialBase as base class is somehow less convenient because SerialBase is very low level and does not define getc and putc methods.

Question relating to:

BlazeX . / SerialDriver Featured
Buffered Serial Port Driver for RTOS Buffered, ROS, Serial, UART

1 Answer

5 years, 9 months ago.

Well, why not? SerialDriver implements all methods of RawSerial, so it should be compatible. I have published an update. It works on LPC1768.

Can you tell me some "libraries using RawSerial base class" you are interested in?

Excellent, thank you. I was also asking because in SerialDriver.h you commented above the puts method "for compatibility with RawSerial".

RPC librairies (remote control of the mbed device) over serial may use your library. This one <https://developer.mbed.org/users/MichaelW/code/RPCInterface/> for instance (it's using Serial at the moment but your library could be a better drop-in replacement)

My library for real-time remote read/write of mbed variables is also using it. <https://developer.mbed.org/users/Overdrivr/code/DistantIO/>

Thank you a lot for the changes, Regards

posted by Remi Beges 30 Oct 2015

Assigned to BlazeX . 5 years, 9 months ago.

This means that the question has been accepted and is being worked on.