diff --git a/Platform.cpp b/Platform.cpp index abcad83..78aa6f7 100644 --- a/Platform.cpp +++ b/Platform.cpp @@ -747,6 +747,11 @@ void RepRapNetworkAllowWriting() reprap.GetPlatform()->GetNetwork()->SetWriteEnable(true); } +bool RepRapNetworkHasALiveClient() +{ + return reprap.GetPlatform()->GetNetwork()->Status() & clientLive; +} + } @@ -777,15 +782,8 @@ void Network::Reset() status = nothing; } -void Network::Init() +void Network::CleanRing() { - alternateInput = NULL; - alternateOutput = NULL; - init_ethernet(); - Reset(); - - // Clean out the ring buffer. - for(int8_t i = 0; i <= HTTP_STATE_SIZE; i++) { netRingGetPointer->Free(); @@ -794,6 +792,15 @@ void Network::Init() netRingAddPointer = netRingGetPointer; } +void Network::Init() +{ + alternateInput = NULL; + alternateOutput = NULL; + init_ethernet(); + CleanRing(); + Reset(); +} + // Webserver calls this to read bytes that have come in from the network bool Network::Read(char& b) diff --git a/Platform.h b/Platform.h index 78b14af..f600e55 100644 --- a/Platform.h +++ b/Platform.h @@ -295,6 +295,7 @@ protected: private: void Reset(); + void CleanRing(); char* inputBuffer; char outputBuffer[STRING_LENGTH]; int inputPointer; diff --git a/SD-image/www/reprap.htm b/SD-image/www/reprap.htm index 5238b44..25f8522 100644 --- a/SD-image/www/reprap.htm +++ b/SD-image/www/reprap.htm @@ -1,8 +1,8 @@ - - + +