HF-FDO2 Driver 0.1.0-dev
UART driver for PyroScience FDO2-G2 (data sheet v5 §4: #MOXY, #MRAW, #VERS)
Loading...
Searching...
No Matches
fdo2_driver.hpp File Reference

FDO2-G2 UART command client (PyroScience data sheet v5, §4). More...

#include "fdo2_types.hpp"
#include "fdo2_uart_interface.hpp"
#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string_view>
Include dependency graph for fdo2_driver.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  fdo2::Driver< UartT >
 FDO2-G2 UART client. More...
 

Namespaces

namespace  fdo2
 
namespace  fdo2::detail
 

Functions

bool fdo2::detail::AppendCmd (char *buf, std::size_t cap, std::string_view cmd) noexcept
 
void fdo2::detail::StripOptionalModbusCrcSuffix (char *line) noexcept
 If CRC is enabled, response is ... : <decimal>\\r. Strip from last " :".
 
template<typename UartT >
DriverError fdo2::detail::ReadAsciiLine (UartT &uart, char *buf, std::size_t cap, uint32_t timeout_ms) noexcept
 
const char * fdo2::detail::SkipWs (const char *p) noexcept
 
DriverError fdo2::detail::Tokenize (const char *line, char *store, std::size_t store_cap, const char *tokens[], std::size_t max_tokens, std::size_t *out_count) noexcept
 
int32_t fdo2::detail::ParseI32 (const char *s, bool *ok) noexcept
 
uint32_t fdo2::detail::ParseU32 (const char *s, bool *ok) noexcept
 
uint64_t fdo2::detail::ParseU64 (const char *s, bool *ok) noexcept
 
bool fdo2::detail::IsErroHeader (const char *tok0) noexcept
 

Detailed Description

FDO2-G2 UART command client (PyroScience data sheet v5, §4).

Implements the FDO2-G2 command set: #VERS, #IDNR, #MOXY, #MRAW, #LOGO. Lines are ASCII, terminated with \\r (optional \\n after \\r per §4.1). If optional CRC is enabled (#CRCE 1), responses end with : C before \\r; this implementation strips that suffix before parsing.

Default UART is 19200 8N1 after power-up; allow ~1 s settle time before the first transaction.