boolean receivePacket(UDPpacket& packet, WiFly& wifly) { boolean ret; char buf[100]; ret = wifly.gets(buf, sizeof(buf)); packet.data += buf; // do { // rByte = wifly.read(); // //Serial.println(rByte); // packet.data = packet.data + (char) rByte; // if((char)rByte == '\n') { // break; // } // }while(rByte != -1); packet.dataLength = packet.data.length(); wifly.getHostIP(packet.ip, sizeof(packet.ip)); packet.port = wifly.getHostPort(); return true; // if(!packet.data.compareTo("-1")) // return false; // else // return true; }