Thanks to visit codestin.com
Credit goes to www.nfiniity.com

Knowledge Base

Everything you need to know and understand to develop V2X applications.

denm-generator.py
msg = self.generate_denm()
future = self.send_request(msg)
future.add_done_callback(self.request_completed)

Remote Procedure Calls

The cube:radio API is powerful, but what if your application isn't running directly on the cube? What if you want to control the V2X radio from your laptop, a cloud server, or a remote test bench? That's where RPC comes in.

Remote Procedure Calls (RPC) let you access your cube's link-layer capabilities over an IP network—treating the radio as a remote resource you can call like any other function. When you configure your cube's V2X radios with cube-v2xconfig, the system automatically launches the cube-radio-rpc service, ready to accept connections on TCP port 23057.

Why RPC?

Built on Cap'n Proto — a modern, high-performance RPC framework — cube-radio-rpc gives you:

Language flexibility - Write clients in C++, Python, Go, Rust, and more
Network transparency - Control your radio from anywhere on the network
Type safety - The schema file defines a clear contract between server and client
Zero-copy serialization - Cap'n Proto's efficiency means minimal overhead

Recent versions of Vanetza's socktap even include a built-in RPC link layer that can connect directly to cube-radio-rpc — perfect for remote development and testing.

Quick Start: Is It Running?

Verify that cube-radio-rpc is listening on your cube:evk:

cube:~$ sudo netstat -tlnp | grep 23057
tcp6 0 0 :::23057 :::* LISTEN 567/cube-radio-rpc

Try it remotely with socktap! Assuming your cube is at 192.168.8.201, you can use both its GNSS and V2X radio from your host computer:

host:~$ socktap -l rpc --rpc-host 192.168.8.201 --gpsd-host 192.168.8.201
Starting runtime at 2025-Nov-07 10:36:01.881303
Enable application 'ca'...
Connected to RPC server id=0 version=1
RPC server's info: cube-radio=dsrc

That's it! Your laptop is now transmitting and receiving V2X messages through the cube's radio, as if the V2X hardware were built into your laptop.


Dive Deeper

Ready to build your own RPC client? Here's your roadmap:

The Contract – Understanding the Schema

Master the Cap'n Proto schema that defines every frame, parameter, and method available in cube-radio-rpc. Learn about frame structures, transmit & receive parameters for ITS-G5 and C-V2X, listener interfaces for async callbacks, and error handling. This is your reference guide for building bulletproof RPC clients in any language.

Essential reading for all RPC client developers

Python Example – From Zero to Working Code

Follow a hands-on Python tutorial using pycapnp to build a complete RPC client in minutes. Connect to the cube, identify the device, transmit V2X frames with custom parameters, and subscribe to incoming messages — all with ready-to-run code examples you can adapt immediately.

Perfect for rapid prototyping and getting started fast

Choose your path and start controlling your cube remotely! 🚀

Previous
ITS Time