Macros | Functions
serial_loopback.cpp File Reference
#include <async_comm/serial.h>
#include <cstdint>
#include <cstdio>
#include <chrono>
#include <thread>
Include dependency graph for serial_loopback.cpp:

Go to the source code of this file.

Macros

#define NUM_BYTES   64
 

Functions

void callback (const uint8_t *buf, size_t len)
 Callback function for the async_comm library. More...
 
int main (int argc, char **argv)
 

Detailed Description

Author
Daniel Koch danie.nosp@m.lpko.nosp@m.ch@gm.nosp@m.ail..nosp@m.com

This example is designed for use with a USB-to-UART adapter with the RX and TX pins connected together (loopback). Sends a series of bytes out and prints them to the console as they are received back.

Definition in file serial_loopback.cpp.

Macro Definition Documentation

#define NUM_BYTES   64

Definition at line 49 of file serial_loopback.cpp.

Function Documentation

void callback ( const uint8_t *  buf,
size_t  len 
)

Callback function for the async_comm library.

Prints the received bytes to stdout.

Parameters
bufReceived bytes buffer
lenNumber of bytes received

Definition at line 60 of file serial_loopback.cpp.

int main ( int  argc,
char **  argv 
)

Definition at line 69 of file serial_loopback.cpp.



async_comm
Author(s):
autogenerated on Fri May 14 2021 02:35:38