Check out this:
http://arduino.cc/forum/index.php/topic,120440.0.html
I'm pretty sure it's impossible to make Serial.helloWorld() a meaningful statement while using the HardwareSerial class (alternative is to rewrite entire class), because Serial is defined as HardwareSerial. However, you can make mySerial.helloWorld() a meaningful statement:
#include <Arduino.h>
class ScottSerial : public HardwareSerial {
public:
ScottSerial() : HardwareSerial(Serial){
}
size_t helloWorld() {
return println(F("Hello, world!"));
}
};
ScottSerial mySerial;
void setup() {
mySerial.begin(115200);
mySerial.print("Okay it's hello world time.");
mySerial.helloWorld();
}
void loop() {}