Windows COM in-process server exposing the Detent transceiver control engine through the OmniRig Automation API.
Developed primarily for the Xiegu G90 transceiver. It provides a partial compatibility layer for third-party logging and digital mode software expecting the OmniRig COM interface. It is not a complete drop-in replacement for the original OmniRig software suite.
Platform support is strictly limited to Windows. Requests regarding Linux compatibility, support, or ports will be ignored and redirected to the depths of the freedesktop ABI.
The module compiles to a 64-bit in-process server (detent_omnirig.dll). It implements COM mechanics directly through Win32 system primitives without external runtime dependencies or binding crates.
- Binding model: Late binding via
IDispatchonly. Requests for custom dual vtables returnE_NOINTERFACEto prevent memory corruption from unmapped method offsets. - State consolidation: Multiple COM instances within the same process share a single background polling state, preventing serial contention on identical COM ports.
- Event dispatch: Event sinks attached via
IConnectionPointare marshaled across apartment boundaries using the OLE Global Interface Table (IGlobalInterfaceTable). - Backend routing: Each rig slot can either drive a local
detentworker directly or attach to thedetentddaemon over a Windows Named Pipe.
The server supports both established OmniRig interface revisions, configured globally via INI:
- V1 interface (
OmniRig.exe): Exposes two transceiver slots (Rig1,Rig2).DialogVisiblesits at DISPID 5. Returns interface version0x0101. - V2 interface (
omnirig2.exe): Exposes four transceiver slots (Rig1throughRig4).DialogVisiblesits at DISPID 7. Returns interface version0x0201.
- Properties:
InterfaceVersion,SoftwareVersion,Rig1,Rig2,Rig3,Rig4,DialogVisible.
- Identification:
RigType,Status,StatusStr. - Capabilities:
ReadableParams,WriteableParams,IsParamReadable,IsParamWriteable. - State registers:
Freq,FreqA,FreqB,RitOffset,Pitch,Mode,Vfo,Split,Rit,Xit,Tx. - Routines:
ClearRit,SetSimplexMode,SetSplitMode,FrequencyOfTone,GetRxFrequency,GetTxFrequency,PortBits. - Unsupported:
SendCustomCommandreturnsE_NOTIMPL.
- Direct line access:
Rts,Dtr,Cts,Dsr. - Lock primitives:
LockandUnlockreturnS_OKwithout serial bus stalling.
Settings are loaded from %APPDATA%\Detent\omnirig.ini. If absent, the server scans for an existing OmniRig installation and automatically imports parameters from %APPDATA%\Afreet\Products\OmniRig\OmniRig.ini.
; Configuration format: %APPDATA%\Detent\omnirig.ini
[DETENT]
Profiles = C:\Radio\Rigs
Interface = 2
[RIG1]
Profile = g90-detent
Port = COM5
Baud = 19200
Dtr = low
Rts = low
PollMs = 100
TimeoutMs = 200
Disabled = 0
Shared = 1
Replay =
[RIG2]
Profile = NONE
Port =
Baud = 19200
Dtr = low
Rts = low
PollMs = 0
TimeoutMs = 0
Disabled = 0
Shared = 0
Replay = - Port line modes:
low,high, orhandshake. - Shared flag: Routes the connection through
detentdto permit concurrent access by external decoders. - Replay: Replaces hardware with a recorded hex exchange script for testing without a physical transceiver.
Registration is executed per-user under HKEY_CURRENT_USER\Software\Classes and does not require administrative privileges.
:: Register COM server
regsvr32 detent_omnirig.dll
:: Unregister COM server
regsvr32 /u detent_omnirig.dllThe registration writes:
- Primary CLSID:
{36A2747E-A6DF-4E86-A08F-2F88CEA7C7DA} - Primary ProgID:
Detent.OmniRigXandDetent.OmniRigX.1 - Fallback ProgID:
OmniRig.OmniRigX(claimed only if not already registered by an official OmniRig installation) - Categories:
CATID_SafeForScriptingandCATID_SafeForInitializing
Diagnostics during registration are appended to %APPDATA%\Detent\register.log.
Building requires the MSVC toolchain to link the export definition file (detent-omnirig.def), which exposes unmangled exports required by the COM runtime.
# Build 64-bit release DLL
cargo build --releaseThis software is released under the Zero-Clause BSD (0BSD) License. Refer to the LICENSE file for details.