Driver for the JY-MCU v1.06 HC-06 Bluetooth module.

Dependents:   DISCO-F746NG_rtos_test MbedTableControl

Revision:
14:73e799413e66
Parent:
13:5768b18a1289
Child:
17:63261635b153
--- a/HC06Bluetooth.cpp	Wed Aug 03 01:07:03 2016 +0000
+++ b/HC06Bluetooth.cpp	Wed Aug 03 18:05:49 2016 +0000
@@ -90,6 +90,7 @@
 }
 
 void HC06Bluetooth::print(const char* buffer) {
+   // TODO: Code hangs if buffer is too long! Not sure why.
     btSerialObj.puts(buffer);
 }
 
@@ -118,6 +119,7 @@
                 // Terminate the buffer with a null character, since that is what strings end with.
                 receivedChar = '\0';
                 dataReceivedBuffer[dataReceivedBufferPos] = receivedChar;
+                dataReceivedBufferPos++;
                 // Copy data from the buffer to a copy.
                 std::copy(dataReceivedBuffer, dataReceivedBuffer + dataReceivedBufferPos, dataReceivedBufferCopy);
                 // Call the callback function.