Skip to content

Missing Serial.write(const char*) in HardwareSerial.h? #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
minyk opened this issue Nov 16, 2016 · 1 comment
Closed

Missing Serial.write(const char*) in HardwareSerial.h? #55

minyk opened this issue Nov 16, 2016 · 1 comment

Comments

@minyk
Copy link
Contributor

minyk commented Nov 16, 2016

Hi,

Freematics's ArduinoOBD library uses Serial.write(const char*), but with Arduino-ESP32, it dose not complie with below error:

/Users/minyk/Documents/Arduino/libraries/OBDI2C/src/OBD.cpp: In member function 'virtual void COBD::write(const char*)':
/Users/minyk/Documents/Arduino/libraries/OBDI2C/src/OBD.cpp:112:17: error: call of overloaded 'write(const char*&)' is ambiguous
  OBDUART.write(s);

So I dug the original Arduino Core code up, then found this line from HardwareSerial.h:

    using Print::write; // pull in write(str) and write(buf, size) from Print

Arduino-ESP32's HardwareSerial.h does not have that part of code. Is this on purpose?

Thank you.

@minyk minyk changed the title Missing Serial.write(const char*) in HardwareSerial.h? Missing Serial.write(const char*) in HardwareSerial.h? Nov 16, 2016
@me-no-dev
Copy link
Member

To be honest I did not know that Serial.write�(const char *) existed :) Will add it it's trivial

size_t HardwareSerial::write(const char * str){
  return write(str, strlen(str));
}

blue-2357 pushed a commit to blue-2357/arduino-esp32 that referenced this issue Jul 17, 2024
dash0820 added a commit to dash0820/arduino-esp32-stripped that referenced this issue Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants