HM11 Class
- ID: hm11
- Name: Bluetooth Low Energy Module
- Other Names: Grove BLE
- Other Chips: HM-10, HM-12
- Category: wifi
- Manufacturer: seeed
- Connection: uart
- Link: http://wiki.seeed.cc/Bluetooth_V4.0_HM_11_BLE_Module/
The driver was tested with the Grove BLE module. It's an HM-11 BLE 4.0 module based on a TI CC2541 chip. It operates using a standard 'AT' command set. See the datasheet for a full list of available commands and their possible responses:
http://www.seeedstudio.com/wiki/images/c/cd/Bluetooth4_en.pdf
It is connected via a UART at 9,600 baud.
Item Index
Methods
Methods
HM11
-
uart
HM11 object constructor
Parameters:
-
uart
NumberDefault UART to use (0 or 1)
Returns:
dataAvailable
-
millis
Checks to see if there is data available for reading
Parameters:
-
millis
NumberNumber of milliseconds to wait; 0 means no waiting
Returns:
True if there is data available for reading
readData
-
buffer
-
len
Reads any available data into a user-supplied buffer. Note: the call blocks until data is available for reading. Use dataAvailable() to determine whether there is data available beforehand, to avoid blocking.
Parameters:
-
buffer
StringBuffer to hold the data read
-
len
NumberLength of the buffer
Returns:
Number of bytes read
writeData
-
buffer
-
len
Writes the data in the buffer to the device
Parameters:
-
buffer
StringBuffer to hold the data read
-
len
NumberLength of the buffer
Returns:
Number of bytes written
setupTty
-
baud
Sets up proper tty I/O modes and the baud rate. For this device, the default baud rate is 9,600 (B9600).
Parameters:
-
baud
Speed_tDesired baud rate.
Returns:
True if successful