nmealib 0.0.4
NMEA 0183/NMEA 2000 parsing library
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
nmealib::nmea2000::Nmea2000Factory Class Reference

#include <nmea2000Factory.h>

Static Public Member Functions

static std::unique_ptr< Message2000create (const std::string &raw, Message::TimePoint ts=std::chrono::system_clock::now())
 Create a Message2000 from a raw CAN frame string.
 

Detailed Description

Definition at line 11 of file nmea2000Factory.h.

Member Function Documentation

◆ create()

std::unique_ptr< Message2000 > nmealib::nmea2000::Nmea2000Factory::create ( const std::string &  raw,
Message::TimePoint  ts = std::chrono::system_clock::now() 
)
static

Create a Message2000 from a raw CAN frame string.

Supports multiple input formats:

  • "CANID:data" (e.g., "18FD1234:0102030405060708")
  • "0xCANID, 0xBB 0xCC ..." (e.g., "0x18FD1234, 0x01 0x02 0x03 ...")
  • "0xCANID 0xBB 0xCC ..." (e.g., "0x18FD1234 0x01 0x02 0x03 ...")
  • "CANID BB CC ..." (e.g., "18FD1234 01 02 03 ...")
Parameters
rawThe raw CAN frame string in any supported format.
tsOptional timestamp; defaults to the current system time.
Returns
std::unique_ptr<Message2000> A unique pointer to the created Message2000 instance. When the library is compiled with NMEALIB_NO_EXCEPTIONS, returns nullptr on failure.

Definition at line 8 of file nmea2000Factory.cpp.


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