pyupm_hm11 module

class pyupm_hm11.HM11(uart)[source]

Bases: object

API for the HM-11 4.0 Bluetooth Low Energy Module.

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.

C++ includes: hm11.hpp

dataAvailable(millis)[source]

bool dataAvailable(unsigned int millis)

Checks to see if there is data available for reading

millis: Number of milliseconds to wait; 0 means no waiting

True if there is data available for reading

readData(buffer, len)[source]

int readData(char *buffer, int 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.

buffer: Buffer to hold the data read

len: Length of the buffer

Number of bytes read

setupTty(*args)[source]

bool setupTty(speed_t baud=B9600)

Sets up proper tty I/O modes and the baud rate. For this device, the default baud rate is 9,600 (B9600).

baud: Desired baud rate.

True if successful

writeData(buffer, len)[source]

int writeData(char *buffer, int len)

Writes the data in the buffer to the device

buffer: Buffer to hold the data read

len: Length of the buffer

Number of bytes written

class pyupm_hm11.charArray(nelements)[source]

Bases: object

cast()[source]
static frompointer()