Skip to content

Build Configuration

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 configuration

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:
Terminal window
ip addr show # Linux
ipconfig # Windows
  • Configure the development host’s IP address in the gamepad App

Ensure the development host’s firewall allows inbound connections on UDP port 12121:

Terminal window
# Linux (Ubuntu)
sudo ufw allow 12121/udp
# Windows
# Add UDP 12121 inbound rule in Windows Defender Firewall
ItemRequirement
Operating SystemLinux (Ubuntu recommended) or Windows (WSL)
CMake≥ 3.10
CompilerC++17 compiler
GitFor pulling the fmt submodule

The example programs depend on the fmt library (managed via git submodule). Initialize before first build:

Terminal window
cd gamepad
git submodule update --init --recursive

Enter the project directory, create a build folder and compile:

Terminal window
cd gamepad
mkdir build && cd build
cmake ..
make -j

Build artifacts:

ArtifactDescription
libgamepad_receiver.aStatic library for upper-layer application linking
example/example_retroidRetroid gamepad example executable
example/example_skydroidSkydroid gamepad example executable
Terminal window
cmake .. -DBUILD_EXAMPLE=OFF
make -j

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:

Terminal window
cmake ..
make -j

CMakeLists.txt main configuration options:

ParameterDefaultDescription
BUILD_EXAMPLEONWhether to build example programs

Linked dependency libraries:

target_link_libraries(gamepad_receiver PRIVATE -lpthread -lm -lrt -ldl -lstdc++)

The controlapp.apk is provided in the project root directory. Install it on an Android phone to use.

App Icon

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

IP Configuration Interface

  1. Ensure the phone and development host are connected to the same WiFi
  2. Open the App and configure the target IP and port
  3. Run the example program or custom program on the development host
  4. Operate the gamepad and observe whether the terminal output updates in real time