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

Go to the source code of this file.

Functions

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

Detailed Description

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

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.

Parameters
bufReceived bytes buffer
lenNumber of bytes received

Definition at line 60 of file udp_hello_world.cpp.