arn-c0de / arn-c0de/InteractiveChecklists
Feature Idea: ๐ฎ Android Button Panel โ Virtual HID Device for DCS World
- Dominant language
- Kotlin
- Stars
- 45
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
> **Type:** Feature Request / Experimental Evaluation
> **Status:** ๐ฌ Testing in Progress
> **Priority:** Medium
---
## ๐ Description
Implement a system that allows application to act as a configurable button panel for DCS World by transmitting input events over UDP connection back to **forward_parsed_udp.py** .
This document also serves as an **experimental evaluation** to determine whether the **Virtual HID approach** is better and easier suited than **direct Export.lua commands** for the application and every Module Aircraft.
---
## ๐๏ธ Proposed Architecture
### Option A: Virtual HID Device *(Current Experiment)*
```
โโโโโโโโโโโโโโโโ UDP/AES-GCM โโโโโโโโโโโโโโโโ HID Driver โโโโโโโโโโโโโ
โ ๐ฑ Android โ โโโโโโโโโโโโโโโโโบ โ ๐ Python โ โโโโโโโโโโโโโโโโบ โ ๐ฎ DCS โ
โ Button App โ โ Backend โ โ World โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโ
(vgamepad/uinput) (Std Joystick)
```
### Option B: Direct Export.lua *(Comparison)*
```
โโโโโโโโโโโโโโโโ UDP/AES-GCM โโโโโโโโโโโโโโโโ Export.lua โโโโโโโโโโโโโ
โ ๐ฑ Android โ โโโโโโโโโโโโโโโโโบ โ ๐ Python โ โโโโโโโโโโโโโโโโบ โ ๐ฎ DCS โ
โ Button App โ โ Backend โ โ World โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโ
(Lua Socket) (LoSetCommand)
```
---
## โ๏ธ Comparison Matrix
| Kriterium | Virtual HID | Export.lua |
|-----------|:-----------:|:----------:|
| DCS Native Binding UI | โ
| โ |
| Works with other games | โ
| โ |
| No Lua scripting needed | โ
| โ |
| Module-specific commands | โ | โ
|
| No virtual device setup | โ | โ
|
| Lower abstraction layers | โ | โ
|
| Portable solution | โ
| โ |
---
## ๐ฆ Scope
### โ In Scope
- New Kotlin module with configurable buttons, switches, encoders
- Bidirectional UDP communication
- Secure channel: ECDH key exchange + AES-GCM encryption via **forward_parsed_udp.py** and **crypto_handshake.py**
- Python backend exposing virtual HID device
- DCS World recognition as standard input hardware
- Cross-platform backend (Windows/Linux)
- Working also in other games (MSFS , XPLANE etc)
### โ Out of Scope
- Android as direct USB HID (no root/custom kernel)
- Reverse engineering of DCS internals
- Macro functionality (1 event = 1 HID input)
---
## ๐ Requirements
| Requirement | Target | Status |
|-------------|--------|:------:|
| End-to-end latency | < 10 ms | โณ |
| Event mapping | 1:1 (no macros) | โณ |
| Device identification | Fixed VID/PID | โณ |
| License compliance | Apache/BSD/MIT only | โณ |
### ๐ฅ๏ธ Platform Support
| Platform | Implementation | Library |
|----------|----------------|---------|
| Windows | ViGEmBus | `vgamepad` |
| Linux | uinput/evdev | `evdev` |
---
## โ Acceptance Criteria
- [ ] Android button press visible in DCS as costumizable modular joystick button
- [ ] Secure channel established automatically on startup
- [ ] System runs reliably for extended sessions (8h+)
- [ ] No control inputs gone lost
- [ ] No conflicts with physical input devices
---
## ๐งช Test Cases
### Phase 1: Infrastructure Setup (if use seperate .py forwarder)
- [ ] 1.1 โ Python backend stable on Windows (ViGEmBus)
- [ ] 1.2 โ Python backend stable on Linux (uinput)
- [ ] 1.3 โ Virtual joystick visible in Windows Game Controllers
- [ ] 1.4 โ Virtual joystick visible in `jstest`/`evtest` (Linux)
- [ ] 1.5 โ Fixed VID/PID persists across restarts
- [ ] 1.6 โ ECDH key exchange successful
- [ ] 1.7 โ AES-GCM packets decoded correctly
### Phase 2: Basic HID Functionality
- [ ] 2.1 โ Single button press registers
- [ ] 2.2 โ Button release handled correctly
- [ ] 2.3 โ Multiple simultaneous presses work
- [ ] 2.4 โ Latency < 10 ms (button โ HID event)
- [ ] 2.5 โ No event loss at 10 Hz
- [ ] 2.6 โ No event loss at 50 events/sec burst
### Phase 3: DCS World Integration
- [ ] 3.1 โ DCS detects virtual joystick in Controls
- [ ] 3.2 โ Button bindable via DCS UI
- [ ] 3.3 โ Bound button triggers correct action
- [ ] 3.4 โ Binding persists across DCS restarts
- [ ] 3.5 โ No conflict with physical joysticks
- [ ] 3.6 โ โ๏ธ F/A-18C Hornet tested
- [ ] 3.7 โ ๐ฉ๏ธ A-10C II tested
- [ ] 3.8 โ ๐ Ka-50 tested
### Phase 4: Stability & Edge Cases
- [ ] 4.1 โ Stable over 2h session
- [ ] 4.2 โ Stable over 8h session
- [ ] 4.3 โ Reconnect after app backgrounded
- [ ] 4.4 โ Reconnect after network interruption
- [ ] 4.5 โ Graceful backend restart handling
- [ ] 4.6 โ No memory leaks (24h test)
- [ ] 4.7 โ CPU usage < 5% idle / < 15% active
### Phase 5: Export.lua Comparison ๐ฌ
- [ ] 5.1 โ Export.lua socket connection works
- [ ] 5.2 โ `LoSetCommand()` executes externally
- [ ] 5.3 โ Measure latency: UDP โ Export.lua โ action
- [ ] 5.4 โ Module-specific commands work (e.g., UFC)
- [ ] 5.5 โ `GetDevice()` cockpit manipulation works
- [ ] 5.6 โ **Compare latency:** HID vs Export.lua
- [ ] 5.7 โ **Compare reliability:** 1000 events test
---
## ๐ Measurement Log
| Test | Date | Result | Latency | Notes |
|:----:|:----:|:------:|:-------:|-------|
| 2.4 | | โณ | โ ms | |
| 5.3 | | โณ | โ ms | |
| 5.6 | | โณ | โ ms | |
---
## ๐ ๏ธ Implementation Checklist
### ๐ฑ Android App
- [ ] Button grid UI
- [ ] Button configuration (label, ID, type)
- [ ] UDP socket management
- [ ] ECDH key exchange (client)
- [ ] AES-GCM encryption
- [ ] Connection status indicator
- [ ] Reconnect logic
- [ ] Haptic feedback
- [ ] Config save/load (JSON)
### ๐ Python Backend
- [ ] Async UDP server
- [ ] ECDH key exchange (server)
- [ ] AES-GCM decryption
- [ ] Event queue management
- [ ] Windows: ViGEmBus integration
- [ ] Linux: uinput integration
- [ ] Button mapping config (JSON/YAML)
- [ ] Structured logging
- [ ] Systemd service (Linux)
- [ ] Windows service wrapper
### ๐ฎ DCS Integration
- [ ] Virtual device recognition
- [ ] Test binding profile
- [ ] Module preset profiles
- [ ] User documentation
---
## ๐ฎ Future Extensions
- [ ] Configurable button-to-HID mapping (JSON/YAML)
- [ ] Multi-device support
- [ ] Encoder and axis support
- [ ] Heartbeat and reconnect handling
---
## ๐ Current Status
| Phase | Status |
|-------|:------:|
| Infrastructure | โณIn Progress|
| Basic HID | โณ Open |
| DCS Integration | โณ Open |
| Stability | โณ Open |
| Comparison | โณ Open |
---
Contributor guide
Assessment
This issue has not been assessed yet.