Allolib  1.0
C++ Components For Interactive Multimedia
al::Arduino Class Reference

Arduino class. More...

#include <C:/Users/Andres/source/repos/casm_viewer/external/tinc/external/allolib/include/al/io/al_Arduino.hpp>

Public Member Functions

 Arduino (size_t ringBufferSize=256)
 
bool init (std::string port="", unsigned long baud=9600, uint32_t granularity=50)
 initialize serial port and reader thread More...
 
void cleanup ()
 
bool isOpen ()
 
std::vector< std::string > getLines ()
 getLines received from serial port and remove them from input buffer More...
 

Public Attributes

std::function< void(uint8_t *, size_t)> onInput = [](uint8_t *, size_t) {}
 

Detailed Description

Arduino class.

Definition at line 20 of file al_Arduino.hpp.

Member Function Documentation

◆ getLines()

std::vector<std::string> al::Arduino::getLines ( )

getLines received from serial port and remove them from input buffer

Returns
vector of lines that h

◆ init()

bool al::Arduino::init ( std::string  port = "",
unsigned long  baud = 9600,
uint32_t  granularity = 50 
)

initialize serial port and reader thread

Parameters
portserial port name
baudbaud rate
granularitythe maximum time for port updates in nanoseconds
Returns
true if port was opened succesfully

The granularity time determines the maximum time for port, but time might less if the internal buffer fills


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