|
Nol.A SDK Library 26.11.2
For IoT System Software Development
|
Asynchronous CM1106 UART CO2 sensor. Call begin() before measurement(). More...
#include <CM1106.hpp>
Public Member Functions | |
| CM1106 (SerialPort &) | |
| Bind the sensor UART; the port must outlive this driver. | |
| void | begin () |
| Start the UART at 9600 baud and install the receive handler. | |
| void | sendData (char *args, uint8_t Len) |
| Raw send API declared without an implementation in this driver. Calling this method requires an implementation supplied elsewhere. | |
| void | measurement (void(*func)()) |
| Request a CO2 measurement asynchronously. | |
| uint16_t | getCO2 () |
| Return the cached CO2 concentration in ppm without requesting a sample. | |
Public Attributes | |
| uint16_t | CO2 =0 |
| Latest CO2 concentration in ppm; initially zero and updated during reception. | |
Asynchronous CM1106 UART CO2 sensor. Call begin() before measurement().
| void CM1106::measurement | ( | void(* | func )() | ) |
Request a CO2 measurement asynchronously.
| func | Non-null callback invoked when the response frame is received. Read CO2 or getCO2() in the callback. Only one callback is stored; no timeout is reported. |