Move the byte receiving into a convenience function and stop using the rx buffer.

git-svn-id: svn+ssh://oldsvn/home/mlalondesvn/svn/cral@77 3ee9b42a-b53c-0410-a25e-f0b6218d5d5b
master
follower 17 years ago
parent 5e9cbb88e0
commit b2fe6b8e9c

@ -193,6 +193,13 @@ void sendBanner(uint8_t *buffer, int ledState) { // {Socket targetSocket, ) {
} }
uint8_t readByte() {
uint8_t theByte;
recv(testSocket, &theByte, 1);
return theByte;
}
void loop() { void loop() {
Serial.println("Test W5100 socket..."); Serial.println("Test W5100 socket...");
@ -256,8 +263,7 @@ void loop() {
while (getSn_SR(testSocket) == SOCK_ESTABLISHED) { while (getSn_SR(testSocket) == SOCK_ESTABLISHED) {
while (getSn_RX_RSR(testSocket) > 0) { while (getSn_RX_RSR(testSocket) > 0) {
recv(testSocket, bytesReceived, 1); theByte = readByte();
theByte = bytesReceived[0];
//Serial.print(bytesReceived[0], BYTE); //Serial.print(bytesReceived[0], BYTE);
Serial.print(theByte, BYTE); Serial.print(theByte, BYTE);
if ((state == STATE_G) && (theByte == 'G')) { if ((state == STATE_G) && (theByte == 'G')) {

Loading…
Cancel
Save