Allolib
1.0
C++ Components For Interactive Multimedia
|
#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) {} |
Arduino class.
Definition at line 20 of file al_Arduino.hpp.
std::vector<std::string> al::Arduino::getLines | ( | ) |
getLines received from serial port and remove them from input buffer
bool al::Arduino::init | ( | std::string | port = "" , |
unsigned long | baud = 9600 , |
||
uint32_t | granularity = 50 |
||
) |
initialize serial port and reader thread
port | serial port name |
baud | baud rate |
granularity | the maximum time for port updates in nanoseconds |
The granularity time determines the maximum time for port, but time might less if the internal buffer fills