37 #include <sys/select.h>
38 #include <sys/types.h>
41 #include <mraa/uart.h>
43 const int MHZ16_DEFAULT_UART = 0;
46 const uint8_t MHZ16_START = 0x7e;
47 const uint8_t MHZ16_END = 0x7e;
107 int readData(
char *buffer,
size_t len);
143 bool getData(
int *gas,
int *temp);
152 int ttyFd() {
return m_ttyFd; };
153 int setTtyFd(
int fd) { m_ttyFd = fd; };
156 mraa_uart_context m_uart;
C++ API support for the Grove CO2 sensor.
Definition: mhz16.h:73
MHZ16(int uart)
Definition: mhz16.cxx:34
void calibrateZeroPoint()
Definition: mhz16.cxx:209
bool verifyPacket(unsigned char *pkt)
Definition: mhz16.cxx:159
~MHZ16()
Definition: mhz16.cxx:62
bool dataAvailable(unsigned int millis)
Definition: mhz16.cxx:70
int writeData(char *buffer, size_t len)
Definition: mhz16.cxx:110
bool getData(int *gas, int *temp)
Definition: mhz16.cxx:170
int readData(char *buffer, size_t len)
Definition: mhz16.cxx:94
bool setupTty(speed_t baud=B9600)
Definition: mhz16.cxx:131