Build Configuration
Network Configuration
Section titled “Network Configuration”Determine App Sending Port
Section titled “Determine App Sending Port”By default, the gamepad App broadcasts data to port 12121. The port passed during SDK construction must match:
RetroidGamepad rc(12121); ///< Port must match App configurationDetermine Development Host IP
Section titled “Determine Development Host IP”The mobile App needs to know the development host’s IP address to send UDP data:
- Ensure the phone and development host are on the same local network (connected to the same WiFi)
- Check the IP address on the development host:
ip addr show # Linuxipconfig # Windows- Configure the development host’s IP address in the gamepad App
Firewall Configuration
Section titled “Firewall Configuration”Ensure the development host’s firewall allows inbound connections on UDP port 12121:
# Linux (Ubuntu)sudo ufw allow 12121/udp
# Windows# Add UDP 12121 inbound rule in Windows Defender FirewallEnvironment Requirements
Section titled “Environment Requirements”| Item | Requirement |
|---|---|
| Operating System | Linux (Ubuntu recommended) or Windows (WSL) |
| CMake | ≥ 3.10 |
| Compiler | C++17 compiler |
| Git | For pulling the fmt submodule |
Build Steps
Section titled “Build Steps”Pull Submodules
Section titled “Pull Submodules”The example programs depend on the fmt library (managed via git submodule). Initialize before first build:
cd gamepadgit submodule update --init --recursiveBuild SDK and Examples
Section titled “Build SDK and Examples”Enter the project directory, create a build folder and compile:
cd gamepadmkdir build && cd buildcmake ..make -jBuild artifacts:
| Artifact | Description |
|---|---|
libgamepad_receiver.a | Static library for upper-layer application linking |
example/example_retroid | Retroid gamepad example executable |
example/example_skydroid | Skydroid gamepad example executable |
Build Static Library Only (No Examples)
Section titled “Build Static Library Only (No Examples)”cmake .. -DBUILD_EXAMPLE=OFFmake -jARM Cross-Compilation
Section titled “ARM Cross-Compilation”To run on an ARM platform (e.g., Lite3 onboard host), uncomment the cross-compiler settings in CMakeLists.txt:
SET(CMAKE_C_COMPILER "aarch64-linux-gnu-gcc")SET(CMAKE_CXX_COMPILER "aarch64-linux-gnu-g++")Then compile:
cmake ..make -jCMake Configuration
Section titled “CMake Configuration”CMakeLists.txt main configuration options:
| Parameter | Default | Description |
|---|---|---|
BUILD_EXAMPLE | ON | Whether to build example programs |
Linked dependency libraries:
target_link_libraries(gamepad_receiver PRIVATE -lpthread -lm -lrt -ldl -lstdc++)Mobile App
Section titled “Mobile App”App Installation
Section titled “App Installation”The controlapp.apk is provided in the project root directory. Install it on an Android phone to use.
![]()
App Configuration
Section titled “App Configuration”Configure the following in the gamepad App:
- Target IP: Development host’s IP address (ensure phone and host are on the same local network)
- Target Port: Default
12121, must match SDK construction parameters - Gamepad Type: Select Retroid or Skydroid

Usage Steps
Section titled “Usage Steps”- Ensure the phone and development host are connected to the same WiFi
- Open the App and configure the target IP and port
- Run the example program or custom program on the development host
- Operate the gamepad and observe whether the terminal output updates in real time