BLE HID Remote Controller
Overview
The hid_remote application implements a Bluetooth LE Remote Controller on a
single Atmosic SoC. It provides:
HOGP - HID over GATT Profile (keyboard + consumer control reports)
ATVV - Android TV Voice over BLE (DMIC -> IMA ADPCM -> GATT voice stream)
IR/NEC - Infrared blaster driven by the Atmosic PWM FIFO driver
BAS - Battery Service
DIS - Device Information Service (PnP VID/PID)
OTA - MCUmgr firmware upgrade over BLE (optional, via
basic_ota_bt.conf)
The application uses two cooperating SMF (Zephyr State Machine Framework) instances:
MMI state machine - user-facing states (idle, pairing, connected, HID ready, streaming)
GAP state machine - advertising lifecycle (reconnect, pairing, stop)
Supported Boards
ATMEVK-5205-NQK-2
Key Combinations
Press both keys:
HOME + BACK - immediately enter undirected pairing mode. Pairing mode remains active until the next cold boot; hibernation wakeup does not switch back to reconnect mode.
OK + VOL+ - delete all bonds and perform a cold reboot.
The LED stays on while a combination is active, and the individual key events are suppressed. The pairing combination does not reboot the remote.
Building
Default build:
west build -p always -b <BOARD> openair/applications/hid_remote –sysbuild -T applications.hid_remote.atm
With MCUboot OTA support:
west build -p always -b <BOARD> openair/applications/hid_remote --sysbuild -T applications.hid_remote.atm.mcuboot.ota
Flashing
west flash --no-rebuild --device <DEVICE_ID> [--jlink] [--erase_all/--erase_flash]
Configuration
Key Kconfig options (prj.conf):
Kconfig |
Purpose |
|---|---|
|
HID over GATT Profile |
|
Enable ATVV GATT service + ADPCM encoder; implies |
|
Atmosic DMIC (PDM microphone) driver (implied by |
|
IMA ADPCM encoder library |
|
Android TV Voice GATT service |
|
NEC infrared blaster |
|
Battery Service |
|
Device Information Service |
|
Bond persistence via NVS flash |
|
Retain the forced-pairing marker across hibernation wakeup |
|
Number of local Bluetooth identities (configured as 1) |
|
Maximum bonded hosts (configured as 2) |
|
Maximum simultaneous BLE connections (configured as 3) |
|
Extended advertising sets for two reconnect targets and one pairing set |
|
Atmosic keyboard matrix input driver |
Key timing constants (Kconfig):
Constant |
Default |
Description |
|---|---|---|
|
60000 cs |
Disconnect after idle (600 s) |
|
3000 cs |
HID ready watchdog (30 s) |
|
3000 cs |
Slave latency enable delay (30 s) |
|
1000 cs |
Maximum voice stream duration (10 s) |
|
30000 ms |
Reconnect advertising window; converted to Zephyr’s 10 ms timeout units |
|
6000 ms |
Pairing advertising window; converted to Zephyr’s 10 ms timeout units |
Advertising
The application uses one BT identity (CONFIG_BT_ID_MAX=1), supports up to
two bonded hosts and up to three simultaneous BLE connections. It selects
between two advertising modes:
Reconnect - low-duty directed advertising for each bonded host
Pairing - undirected, connectable, scannable advertising that broadcasts the device name
On a normal cold boot, the application starts reconnect advertising when a bond
exists; otherwise it starts undirected pairing advertising. Pressing
HOME + BACK overrides this selection and keeps pairing advertising active
until a cold boot. The forced-pairing marker is stored in Atmosic
hibernation-retained memory. Advertising interval defaults to 40 ms
(0x0040 x 625 us) and is configurable via
CONFIG_RC_ADV_INTERVAL_MIN / CONFIG_RC_ADV_INTERVAL_MAX in Kconfig.
Voice Pipeline
When ATVV is enabled the voice data path is:
PDM microphone -> DMIC driver -> PCM samples -> IMA ADPCM encoder -> ATVV GATT notify
The host opens the microphone by writing MIC_OPEN to the ATVV control point.
The MMI transitions to MMI_S_STREAMING and calls rc_audio_stream_start().
On MIC_CLOSE or ATVV disconnect the stream stops automatically.