YARP
Yet Another Robot Platform
os/simple_receiver/simple_receiver.cpp

This reads some data from a port.Designed to be used with os/simple_sender/simple_sender.cpp example.

/*
* Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
* Copyright (C) 2006-2010 RobotCub Consortium
* All rights reserved.
*
* This software may be modified and distributed under the terms of the
* BSD-3-Clause license. See the accompanying LICENSE file for details.
*/
#include <yarp/os/Bottle.h>
#include <yarp/os/Port.h>
#include <cstdio>
int main(int argc, char* argv[])
{
YARP_UNUSED(argc);
YARP_UNUSED(argv);
Network yarp;
Bottle bot;
Port input;
input.open("/receiver");
// usually, we create connections externally, but just for this example...
Network::connect("/sender", "/receiver");
input.read(bot);
printf("Got message: %s\n", bot.toString().c_str());
input.close();
return 0;
}
yarp::os::Bottle
A simple collection of objects that can be described and transmitted in a portable way.
Definition: Bottle.h:73
Network.h
Port.h
main
int main(int argc, char *argv[])
Definition: yarpros.cpp:261
YARP_UNUSED
#define YARP_UNUSED(var)
Definition: api.h:159
yarp::os::Port
A mini-server for network communication.
Definition: Port.h:50
yarp::os::Network
Utilities for manipulating the YARP network, including initialization and shutdown.
Definition: Network.h:786
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
Bottle.h