Skip to content

serp vhal

Oleksandr Geronime edited this page Jul 4, 2026 · 3 revisions

serp-vhal

serp-vhal — a SERP-generated VHAL (Vehicle Hardware Abstraction Layer) for Android Automotive OS (AAOS).

The project bridges SERP vehicle services to the AAOS AIDL VHAL interface. SERP services own vehicle state (speed, gear, HVAC, night mode); a generated VehicleHardwareAdapter translates SERP Property::connect() callbacks into AIDL onPropertyEvent calls that CarService consumes. The service interfaces, adapter, and process entry point are all generated from SerpIDL specs — only simulation logic is hand-written.

This project was built end-to-end with AI assistance through the SERP AI-driven workflow.


What It Demonstrates

  • Generating a real AAOS VHAL from SerpIDL specs and serpgen
  • Bridging SERP property change events to the AIDL VHAL protocol
  • Running SERP services on an Android Automotive emulator without any framework modifications
  • Simulating live vehicle data visible in standard AAOS system apps

Architecture

SERP vehicle services
  │  Property::mutate() / connect()
  ▼
VehicleHardwareAdapter   (generated SERP ↔ AIDL bridge)
  │  onPropertyChangeEvent
  ▼
SerpVehicleService       (AIDL BnVehicle)
  │  Binder IPC
  ▼
CarService (AAOS)
  │  CarPropertyManager / CarHvacManager
  ▼
AAOS system apps

Services and Simulated Properties

Service Simulated behavior
VehicleChassis Speed 0 → 120 km/h, step 5 every 2 s
VehicleDriving Gear P → N → D every 10 s; Night mode day/night toggle every 90 s
VehicleHvac Cabin temperature 16 → 28 → 16 °C every 10 s
VehicleEngine Static initial values
VehicleBody / VehicleLights / VehicleAdas Static initial values
VehicleInfo Static VIN, make, model, year

REVERSE gear is excluded — it triggers the EVS camera in AAOS which crashes the emulator.


Deployment

The VHAL binary registers as android.hardware.automotive.vehicle and is pushed to /vendor/bin/hw/. CarService connects automatically after the service restarts.

# Build (requires SERP AAOS SDK and Android NDK)
SERP_AAOS_SDK=/path/to/sdk ./scripts/build.sh --android

# Push to connected AAOS emulator / device (requires adb root)
./scripts/push.sh

# Tail VHAL logcat
./scripts/run.sh --android

Verifying in the AAOS Emulator

After deployment, CarService connects and all AAOS vehicle-aware apps receive live data:

# Speed changing every 2 seconds
adb shell cmd car_service get-property-value 0x11600207 0

# Night mode toggling every 90 seconds — switches the entire AAOS UI theme
adb shell cmd car_service get-property-value 0x11200407 0

# Gear cycling P / N / D
adb shell cmd car_service get-property-value 0x11400400 0

Project Layout

Path Contents
specs/serp.sidl Workspace root
specs/services/ Service interface and service specs
specs/deployments/ AAOS POSIX and gRPC deployment specs
src/services/ Simulation logic (hand-written, survives regeneration)
build/gen/aaos/ Generated AAOS adapter and AIDL bridge
scripts/ Build, push, run, stop helpers

Prerequisites

  • serp-src — SERP framework, generator, and AAOS SDK
  • Android NDK r27+
  • AAOS emulator or device with root access

Related Pages

Clone this wiki locally