Pages: [1]   Go Down
Author Topic: Modifying the HWSerial to make other Framelength possible  (Read 1418 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:

Code:
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.) smiley-sad
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 smiley

If my explanation is not detailed enough please tell me!

Elias

Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 652
Posts: 50869
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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).
Logged

Pages: [1]   Go Up
Jump to: