webusb / arduino

WebUSB demos running on Arduino (and compatible) hardware.
580 stars 154 forks source link

s/WebSerial/WebUSBSerial/g #10

Closed beaufortfrancois closed 8 years ago

beaufortfrancois commented 8 years ago

I'd like to rename WebSerial to WebUSBSerial for two reasons:

  1. There is already a WebSerial Arduino library that does something completely different.
  2. Name is confusing especially with the "real" WebSerial API coming
  3. I think it's better to be explicit about which Serial we're using instead of the #define Serial WebSerial which can be misleading for new comers.

Yeah. I'm not that good at counting...

R=@reillyeon

kenchris commented 8 years ago

The #define is nice in the sense that removing it makes it possible to test the code using the standard arduino serial connection. So you can make sure that everything works fine before moving to WebUSB.

I am fine with changing the name though

reillyeon commented 8 years ago

I would rather rename WebUSB -> WebUSBSerial and keep the #define Serial WebUSBSerial as I agree with @kenchris's point about testing.

beaufortfrancois commented 8 years ago

I've updated this PR and kept the #define Serial WebUSBSerial.

beaufortfrancois commented 8 years ago

One quick observation though, why do we specify baud in Serial.begin if WebUSBSerial doesn't use it: https://github.com/webusb/arduino/blob/25e33acb0345fffa610c07aa20c898e2a3861859/library/WebUSB/WebUSB.cpp#L227

kenchris commented 8 years ago

Because the Arduino Serial object requires it - again for testing purposes

beaufortfrancois commented 8 years ago

:+1: