From 70bfc2f3300613119da419cbd6724e443037b1b0 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Mon, 24 Jun 2013 11:23:35 +0200 Subject: Removed unused Stream interface from Bridge class --- libraries/Bridge/Bridge.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'libraries/Bridge/Bridge.cpp') diff --git a/libraries/Bridge/Bridge.cpp b/libraries/Bridge/Bridge.cpp index d6d830c..6e9cafc 100644 --- a/libraries/Bridge/Bridge.cpp +++ b/libraries/Bridge/Bridge.cpp @@ -31,19 +31,19 @@ void BridgeClass::begin() { do { dropAll(); delay(1100); - } while (available()>0); + } while (stream.available()>0); // Bridge startup: // - If the bridge is not running starts it safely - print(CTRL_C); + stream.print(CTRL_C); delay(250); - print(F("\n")); + stream.print(F("\n")); delay(500); - print(F("\n")); + stream.print(F("\n")); delay(750); // Wait for OpenWRT message // "Press enter to activate console" - print(F("run-bridge\n")); + stream.print(F("run-bridge\n")); delay(500); dropAll(); @@ -111,8 +111,8 @@ void BridgeClass::crcReset() { } void BridgeClass::crcWrite() { - write((char)(CRC >> 8)); - write((char)(CRC & 0xFF)); + stream.write((char)(CRC >> 8)); + stream.write((char)(CRC & 0xFF)); } bool BridgeClass::crcCheck(uint16_t _CRC) { @@ -128,24 +128,24 @@ uint16_t BridgeClass::transfer(const uint8_t *buff1, uint16_t len1, for ( ; ; delay(100), dropAll() /* Delay for retransmission */) { // Send packet crcReset(); - write((char)0xFF); // Start of packet (0xFF) + stream.write((char)0xFF); // Start of packet (0xFF) crcUpdate(0xFF); - write((char)index); // Message index + stream.write((char)index); // Message index crcUpdate(index); - write((char)((len >> 8) & 0xFF)); // Message length (hi) + stream.write((char)((len >> 8) & 0xFF)); // Message length (hi) crcUpdate((len >> 8) & 0xFF); - write((char)(len & 0xFF)); // Message length (lo) + stream.write((char)(len & 0xFF)); // Message length (lo) crcUpdate(len & 0xFF); for (uint16_t i=0; i= 0) return c; } while(millis() - _startMillis < timeout); return -1; // -1 indicates timeout } void BridgeClass::dropAll() { - while (available() > 0) { - read(); + while (stream.available() > 0) { + stream.read(); } } -- cgit v1.2.3-18-g5258