Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Detent OmniRigX

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.

Detent OmniRigX Architecture

Architecture

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 IDispatch only. Requests for custom dual vtables return E_NOINTERFACE to 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 IConnectionPoint are marshaled across apartment boundaries using the OLE Global Interface Table (IGlobalInterfaceTable).
  • Backend routing: Each rig slot can either drive a local detent worker directly or attach to the detentd daemon over a Windows Named Pipe.

Compatibility and Interface Modes

The server supports both established OmniRig interface revisions, configured globally via INI:

  • V1 interface (OmniRig.exe): Exposes two transceiver slots (Rig1, Rig2). DialogVisible sits at DISPID 5. Returns interface version 0x0101.
  • V2 interface (omnirig2.exe): Exposes four transceiver slots (Rig1 through Rig4). DialogVisible sits at DISPID 7. Returns interface version 0x0201.

Supported Automation Members

OmniRig Object (IOmniRigX)

  • Properties: InterfaceVersion, SoftwareVersion, Rig1, Rig2, Rig3, Rig4, DialogVisible.

Rig Object (IRigX)

  • 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: SendCustomCommand returns E_NOTIMPL.

PortBits Object (IPortBits)

  • Direct line access: Rts, Dtr, Cts, Dsr.
  • Lock primitives: Lock and Unlock return S_OK without serial bus stalling.

Configuration and Migration

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 = 

Parameter Constraints

  • Port line modes: low, high, or handshake.
  • Shared flag: Routes the connection through detentd to permit concurrent access by external decoders.
  • Replay: Replaces hardware with a recorded hex exchange script for testing without a physical transceiver.

Registration

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.dll

The registration writes:

  • Primary CLSID: {36A2747E-A6DF-4E86-A08F-2F88CEA7C7DA}
  • Primary ProgID: Detent.OmniRigX and Detent.OmniRigX.1
  • Fallback ProgID: OmniRig.OmniRigX (claimed only if not already registered by an official OmniRig installation)
  • Categories: CATID_SafeForScripting and CATID_SafeForInitializing

Diagnostics during registration are appended to %APPDATA%\Detent\register.log.

Building

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 --release

License

This software is released under the Zero-Clause BSD (0BSD) License. Refer to the LICENSE file for details.

About

Windows COM in-process server exposing the Detent transceiver control engine through the OmniRig V1/V2 Automation API.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages