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

Dependents:   DISCO-F746NG_rtos_test MbedTableControl

Revision:
13:5768b18a1289
Parent:
12:5ba022adbbfb
Child:
14:73e799413e66
--- a/HC06Bluetooth.cpp	Tue Aug 02 20:16:26 2016 +0000
+++ b/HC06Bluetooth.cpp	Wed Aug 03 01:07:03 2016 +0000
@@ -19,7 +19,7 @@
 /* HC06 Bluetooth Class Implementation: */
 HC06Bluetooth::HC06Bluetooth(PinName TX, PinName RX, Baudrate baudrate, void (*lineCallbackFunc) (const char* readString, size_t strlen), void (*charCallbackFunc) (char readChar))
 : btSerialObj(TX, RX), baudrate(baudrate), lineCallbackFunc(lineCallbackFunc), charCallbackFunc(charCallbackFunc) {
-    btSerialObj.baud(baudrate);
+    btSerialObj.baud(BaudValue[baudrate]);
 
     // Set the interrupt to be called when a byte is received.
     if ((lineCallbackFunc != NULL) || (charCallbackFunc != NULL)) {
@@ -32,7 +32,7 @@
     // Detatch the interrupt.
     btSerialObj.attach(NULL);
     /* Sweep through a list of Baud rates until we find the one that the device has previously been set to. */
-    volatile bool baudFound = false;
+    bool baudFound = false;
     Timer timeOut;
     timeOut.start();
     // For every baud rate in the list: