Skip to Content
Hands-On Robotics Programming with C++
book

Hands-On Robotics Programming with C++

by Dinesh Tavasalkar
March 2019
Intermediate to advanced
312 pages
7h 37m
English
Packt Publishing
Content preview from Hands-On Robotics Programming with C++

Socket programming

A socket is an endpoint of a two-way communication system in a network. We create sockets so that we can send bits of information through them. To establish a Bluetooth communication between the devices, we need to create a socket. One socket will be on the server side and the other will be on the client side. In our case, the Android smartphone is the client and the RPi is the server.

The client socket tries to establish a connection with the server socket, while the server socket tries to listen to the incoming connection request from the client socket. In Bluetooth programming, we can choose between two socket options, RFCOMM and L2CAP, as represented in the following diagram:

In a socket program, the following connection ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learn Robotics Programming

Learn Robotics Programming

Danny Staple
C++ Reactive Programming

C++ Reactive Programming

Praseed Pai, Peter Abraham

Publisher Resources

ISBN: 9781789139006Supplemental Content