Async Comm
A library for asynchronous serial communication
udp_hello_world.cpp File Reference
#include <async_comm/udp.h>
#include <cstdint>
#include <cstring>
#include <iostream>
#include <chrono>
#include <thread>
#include <vector>
Include dependency graph for udp_hello_world.cpp:

Go to the source code of this file.


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

Detailed Description

Daniel Koch

This example opens two UDP objects listening on different ports on the local host, and then uses each to send a simple "hello world" message to the other.

Definition in file udp_hello_world.cpp.

Function Documentation

◆ callback()

void callback ( const uint8_t *  buf,
size_t  len 

Callback function for the async_comm library.

Prints the received bytes to stdout.

bufReceived bytes buffer
lenNumber of bytes received

Definition at line 60 of file udp_hello_world.cpp.