Nol.A SDK Library 26.11.2
For IoT System Software Development
Loading...
Searching...
No Matches
CM1106 Class Reference

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.

Detailed Description

Asynchronous CM1106 UART CO2 sensor. Call begin() before measurement().

Member Function Documentation

◆ measurement()

void CM1106::measurement ( void(* func )())

Request a CO2 measurement asynchronously.

Parameters
funcNon-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.

The documentation for this class was generated from the following file: