|
int | ttyFd () |
|
int | setTtyFd (int fd) |
|
HM11 module constructor
- Parameters
-
uart | default uart to use (0 or 1) |
bool dataAvailable |
( |
unsigned int |
millis | ) |
|
check to see if there is data available for reading
- Parameters
-
millis | number of milliseconds to wait, 0 means no wait. |
- Returns
- true if there is data available to be read
int readData |
( |
char * |
buffer, |
|
|
size_t |
len |
|
) |
| |
read any available data into a user-supplied buffer. Note, the call will block until data is available to be read. Use dataAvailable() to determine whether there is data available beforehand, to avoid blocking.
- Parameters
-
buffer | the buffer to hold the data read |
len | the length of the buffer |
- Returns
- the number of bytes read
int writeData |
( |
char * |
buffer, |
|
|
size_t |
len |
|
) |
| |
write the data in buffer to the device
- Parameters
-
buffer | the buffer to hold the data read |
len | the length of the buffer |
- Returns
- the number of bytes written
bool setupTty |
( |
speed_t |
baud = B9600 | ) |
|
setup the proper tty i/o modes and the baudrate. The default baud rate is 9600 (B9600) for this device.
- Parameters
-
baud | the desired baud rate. |
- Returns
- true if successful
The documentation for this class was generated from the following files:
- /var/lib/jenkins/workspace/upm-doc-stable/src/hm11/hm11.h
- /var/lib/jenkins/workspace/upm-doc-stable/src/hm11/hm11.cxx