From 1dc75ae89f53af1df1746c96c9b37a8e5bb2100f Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Tue, 7 May 2013 00:37:43 +0200 Subject: [PATCH] Call send if the buffer would be full --- SPP.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SPP.cpp b/SPP.cpp index a3b4401d..461d9bda 100644 --- a/SPP.cpp +++ b/SPP.cpp @@ -736,7 +736,7 @@ size_t SPP::write(uint8_t data) { size_t SPP::write(const uint8_t* data, size_t size) { for(uint8_t i = 0; i < size; i++) { if(sppIndex >= sizeof(sppOutputBuffer)/sizeof(sppOutputBuffer[0])) - return i; // Don't send any more if buffer is already full + send(); // Send the current data in the buffer sppOutputBuffer[sppIndex++] = data[i]; // All the bytes are put into a buffer and then send using the send() function } return size;