Driver for the JY-MCU v1.06 HC-06 Bluetooth module.
Dependents: DISCO-F746NG_rtos_test MbedTableControl
Diff: HC06Bluetooth.h
- Revision:
- 11:aeb8c5c27111
- Parent:
- 10:b0a0a82a9ff5
- Child:
- 12:5ba022adbbfb
--- a/HC06Bluetooth.h Tue Aug 02 01:32:25 2016 +0000 +++ b/HC06Bluetooth.h Tue Aug 02 16:48:13 2016 +0000 @@ -13,7 +13,7 @@ #include "mbed.h" #include <string> - const int dataBufferSize = 256; +const int dataBufferSize = 256; class HC06Bluetooth { public: // Public methods. @@ -30,7 +30,7 @@ * the character that has been read. * @remark The callback function is run within within an interrupt service routine, so it should be written to be safe for ISRs. */ - HC06Bluetooth(PinName TX, PinName RX, void (*lineCallbackFunc) (const char* readString) = NULL, void (*charCallbackFunc) (char readChar) = NULL); + HC06Bluetooth(PinName TX, PinName RX, void (*lineCallbackFunc) (const char* readString, size_t strlen) = NULL, void (*charCallbackFunc) (char readChar) = NULL); virtual ~HC06Bluetooth(); /** * @brief Run the setup routine to configure the device name and the device pin. @@ -60,7 +60,7 @@ RawSerial btSerialObj; void receiveByteISR(); /// Pointer to a callback function the client provides when a line is received. - void (*lineCallbackFunc) (const char*); + void (*lineCallbackFunc) (const char*, size_t strlen); /// Pointer to a callback function the client provides when a character is received. void (*charCallbackFunc) (char); char dataReceivedBuffer[dataBufferSize];