#include <async_comm/serial.h>
#include <cstdint>
#include <cstdio>
#include <chrono>
#include <thread>
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) |
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.
#define NUM_BYTES 64 |
Definition at line 49 of file serial_loopback.cpp.
void callback | ( | const uint8_t * | buf, |
size_t | len | ||
) |
Callback function for the async_comm library.
Prints the received bytes to stdout.
buf | Received bytes buffer |
len | Number 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.