@@ -28,18 +28,18 @@ extern "C" {
2828
2929void FirmataClass::sendValueAsTwo7bitBytes (int value)
3030{
31- FirmataSerial ->write (value & B01111111); // LSB
32- FirmataSerial ->write (value >> 7 & B01111111); // MSB
31+ FirmataStream ->write (value & B01111111); // LSB
32+ FirmataStream ->write (value >> 7 & B01111111); // MSB
3333}
3434
3535void FirmataClass::startSysex (void )
3636{
37- FirmataSerial ->write (START_SYSEX);
37+ FirmataStream ->write (START_SYSEX);
3838}
3939
4040void FirmataClass::endSysex (void )
4141{
42- FirmataSerial ->write (END_SYSEX);
42+ FirmataStream ->write (END_SYSEX);
4343}
4444
4545// ******************************************************************************
@@ -67,7 +67,7 @@ void FirmataClass::begin(void)
6767void FirmataClass::begin (long speed)
6868{
6969 Serial.begin (speed);
70- FirmataSerial = &Serial;
70+ FirmataStream = &Serial;
7171 blinkVersion ();
7272 printVersion ();
7373 printFirmwareVersion ();
@@ -76,7 +76,7 @@ void FirmataClass::begin(long speed)
7676/* begin method for overriding default stream */
7777void FirmataClass::begin (Stream &s)
7878{
79- FirmataSerial = &s;
79+ FirmataStream = &s;
8080 // do not call blinkVersion() here because some hardware such as the
8181 // Ethernet shield use pin 13
8282 printVersion ();
@@ -85,9 +85,9 @@ void FirmataClass::begin(Stream &s)
8585
8686// output the protocol version message to the serial port
8787void FirmataClass::printVersion (void ) {
88- FirmataSerial ->write (REPORT_VERSION);
89- FirmataSerial ->write (FIRMATA_MAJOR_VERSION);
90- FirmataSerial ->write (FIRMATA_MINOR_VERSION);
88+ FirmataStream ->write (REPORT_VERSION);
89+ FirmataStream ->write (FIRMATA_MAJOR_VERSION);
90+ FirmataStream ->write (FIRMATA_MINOR_VERSION);
9191}
9292
9393void FirmataClass::blinkVersion (void )
@@ -106,9 +106,9 @@ void FirmataClass::printFirmwareVersion(void)
106106
107107 if (firmwareVersionCount) { // make sure that the name has been set before reporting
108108 startSysex ();
109- FirmataSerial ->write (REPORT_FIRMWARE);
110- FirmataSerial ->write (firmwareVersionVector[0 ]); // major version number
111- FirmataSerial ->write (firmwareVersionVector[1 ]); // minor version number
109+ FirmataStream ->write (REPORT_FIRMWARE);
110+ FirmataStream ->write (firmwareVersionVector[0 ]); // major version number
111+ FirmataStream ->write (firmwareVersionVector[1 ]); // minor version number
112112 for (i=2 ; i<firmwareVersionCount; ++i) {
113113 sendValueAsTwo7bitBytes (firmwareVersionVector[i]);
114114 }
@@ -159,7 +159,7 @@ void FirmataClass::setFirmwareNameAndVersion(const char *name, byte major, byte
159159
160160int FirmataClass::available (void )
161161{
162- return FirmataSerial ->available ();
162+ return FirmataStream ->available ();
163163}
164164
165165
@@ -200,7 +200,7 @@ void FirmataClass::processSysexMessage(void)
200200
201201void FirmataClass::processInput (void )
202202{
203- int inputData = FirmataSerial ->read (); // this is 'int' to handle -1 when no data
203+ int inputData = FirmataStream ->read (); // this is 'int' to handle -1 when no data
204204 int command;
205205
206206 // TODO make sure it handles -1 properly
@@ -292,7 +292,7 @@ void FirmataClass::processInput(void)
292292void FirmataClass::sendAnalog (byte pin, int value)
293293{
294294 // pin can only be 0-15, so chop higher bits
295- FirmataSerial ->write (ANALOG_MESSAGE | (pin & 0xF ));
295+ FirmataStream ->write (ANALOG_MESSAGE | (pin & 0xF ));
296296 sendValueAsTwo7bitBytes (value);
297297}
298298
@@ -323,17 +323,17 @@ void FirmataClass::sendDigital(byte pin, int value)
323323// send an 8-bit port in a single digital message (protocol v2)
324324void FirmataClass::sendDigitalPort (byte portNumber, int portData)
325325{
326- FirmataSerial ->write (DIGITAL_MESSAGE | (portNumber & 0xF ));
327- FirmataSerial ->write ((byte)portData % 128 ); // Tx bits 0-6
328- FirmataSerial ->write (portData >> 7 ); // Tx bits 7-13
326+ FirmataStream ->write (DIGITAL_MESSAGE | (portNumber & 0xF ));
327+ FirmataStream ->write ((byte)portData % 128 ); // Tx bits 0-6
328+ FirmataStream ->write (portData >> 7 ); // Tx bits 7-13
329329}
330330
331331
332332void FirmataClass::sendSysex (byte command, byte bytec, byte* bytev)
333333{
334334 byte i;
335335 startSysex ();
336- FirmataSerial ->write (command);
336+ FirmataStream ->write (command);
337337 for (i=0 ; i<bytec; i++) {
338338 sendValueAsTwo7bitBytes (bytev[i]);
339339 }
@@ -355,7 +355,7 @@ void FirmataClass::sendString(const char* string)
355355// expose the write method
356356void FirmataClass::write (byte c)
357357{
358- FirmataSerial ->write (c);
358+ FirmataStream ->write (c);
359359}
360360
361361
0 commit comments