Modifying the HWSerial to make other Framelength possible

Hi,

I'm working on a modification of HWSerial of Arduino 1.0 to make it possible to select the framelength/parity/stopbits like this:

Serial.begin(9600,9,'E',2);

The setup of the Serial Port works fine now, but im not very familiar with cpp (virtual methods, polimorphism, inheritance, etc.) :frowning:
Why i do this is just because i want to port my working c version of a Vending Machine Interface to Arduino.
This MDB interface need 9,N,1 (which arduino does not support so far).

I want to overload the write method that it takes a uint16_t argument, but when i tried to overload the virtual write method in HWSerial i get compiler errors.
Is it correct that the HWSerial get the write method from print.cpp ?

Would be nice if anybody can tell me which function i have to overload to get this working :slight_smile:

If my explanation is not detailed enough please tell me!

Elias

Is it correct that the HWSerial get the write method from print.cpp ?

No. HardwareSerial gets the write() method from the Print class in Print.cpp (case matters, if you haven't figure that out, as do complete names).