Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions build-windows.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
param(
[string]$Generator = "Ninja",
[string]$BuildDir = "out\\build\\windows",
[string]$Config = "RelWithDebInfo"
)

function Abort($msg) {
Write-Error $msg
exit 1
}

if (-not (Get-Command cmake -ErrorAction SilentlyContinue)) { Abort "cmake not found on PATH. Install CMake and retry." }
if ($Generator -eq "Ninja" -and -not (Get-Command ninja -ErrorAction SilentlyContinue)) { Abort "ninja not found on PATH. Install Ninja and retry." }

Write-Host "Configuring (Generator=$Generator, BuildDir=$BuildDir, Config=$Config)"
cmake -S . -B $BuildDir -G $Generator -DCOMPILE_WIN32=ON -DCMAKE_BUILD_TYPE=$Config
if ($LASTEXITCODE -ne 0) { Abort "CMake configure failed." }

Write-Host "Building"
cmake --build $BuildDir --config $Config -- -v
if ($LASTEXITCODE -ne 0) { Abort "Build failed." }

Write-Host "Build finished. Artifacts are in: $BuildDir"
11 changes: 11 additions & 0 deletions configs/fne-config.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,17 @@ master:
# spanning tree updates.)
spanningTreeFastReconnect: true

# Console patch status registry configuration.
patchStatus:
# Flag indicating whether or not console patch status publishing is enabled.
enabled: true
# Default TTL, in seconds, for console patch status updates that do not specify one.
defaultTtlSeconds: 15
# Minimum accepted TTL, in seconds, for console patch status updates.
minTtlSeconds: 5
# Maximum accepted TTL, in seconds, for console patch status updates.
maxTtlSeconds: 300

# Flag indicating whether or not peer pinging will be reported.
reportPeerPing: true

Expand Down
30 changes: 30 additions & 0 deletions docs/WINDOWS_BUILD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Windows build prerequisites and steps for dvmhost

Prerequisites
- Visual Studio 2019/2022 (Desktop development with C++ workload) or at least the MSVC build tools.
- CMake 3.16 or newer
- Ninja (recommended generator)
- Git
- (Optional) OpenSSL for Windows if you need SSL; not required by default when building with `-DCOMPILE_WIN32=ON`.

Quick steps
1. Open a Developer command prompt (e.g. "x64 Native Tools Command Prompt for VS 2022") or run the MSVC environment so compilers are on PATH.
2. Ensure `cmake` and `ninja` are on PATH.
3. From the repository root:

```powershell
# create an out/build directory and configure
mkdir -p out\build\windows
cmake -S . -B out\build\windows -G Ninja -DCOMPILE_WIN32=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo

# build
cmake --build out\build\windows --config RelWithDebInfo
```

Notes
- The project provides `CMakeSettings.json` presets for Visual Studio Code/CMake Tools which enable `COMPILE_WIN32` and use Ninja.
- TUI support is disabled on Windows by design; some utilities that require ncurses will not be available when `COMPILE_WIN32=ON`.
- If you prefer Visual Studio IDE: open the CMake project in Visual Studio, select the provided configuration (see `CMakeSettings.json`) and build.
- If you need OpenSSL for Windows, install a binary distribution and set `-DOPENSSL_ROOT_DIR="C:/path/to/openssl"` when invoking `cmake`.

If you want, run `.uild-windows.ps1` from a Developer PowerShell prompt — it will run the configure+build steps automatically.
1 change: 1 addition & 0 deletions src/common/network/BaseNetwork.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
#define TAG_TRANSFER_ACT_LOG "TRNSLOG"
#define TAG_TRANSFER_DIAG_LOG "TRNSDIAG"
#define TAG_TRANSFER_STATUS "TRNSSTS"
#define TAG_TRANSFER_PATCH_STATUS "TRNSPTCH"

#define TAG_ANNOUNCE "ANNC"
#define TAG_PEER_REPLICA "REPL"
Expand Down
4 changes: 3 additions & 1 deletion src/common/network/RTPFNEHeader.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ namespace network
TRANSFER_SUBFUNC_ACTIVITY = 0x01U, //!< Activity Log Transfer
TRANSFER_SUBFUNC_DIAG = 0x02U, //!< Diagnostic Log Transfer
TRANSFER_SUBFUNC_STATUS = 0x03U, //!< Status Transfer
TRANSFER_SUBFUNC_PATCH_STATUS = 0x04U, //!< Console Patch Status Transfer

ANNC_SUBFUNC_GRP_AFFIL = 0x00U, //!< Announce Group Affiliation
ANNC_SUBFUNC_UNIT_REG = 0x01U, //!< Announce Unit Registration
Expand All @@ -114,6 +115,7 @@ namespace network

REPL_ACT_PEER_LIST = 0xA2U, //!< FNE Replication Active Peer List Transfer
REPL_HA_PARAMS = 0xA3U, //!< FNE Replication HA Parameters
REPL_PATCH_STATUS = 0xA4U, //!< FNE Replication Patch Status Transfer

NET_TREE_LIST = 0x00U, //!< FNE Network Tree List
NET_TREE_DISC = 0x01U //!< FNE Network Tree Disconnect
Expand Down Expand Up @@ -215,4 +217,4 @@ namespace network
} // namespace frame
} // namespace network

#endif // __RTP_FNE_HEADER_H__
#endif // __RTP_FNE_HEADER_H__
10 changes: 10 additions & 0 deletions src/fne/HostFNE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,7 @@ bool HostFNE::createPeerNetworks()

network->setNetTreeDiscCallback(std::bind(&HostFNE::processNetworkTreeDisconnect, this, std::placeholders::_1, std::placeholders::_2));
network->setNotifyPeerReplicaCallback(std::bind(&HostFNE::processPeerReplicaNotify, this, std::placeholders::_1));
network->setPatchStatusCallback(std::bind(&HostFNE::processPeerPatchStatus, this, std::placeholders::_1, std::placeholders::_2));

network->enable(enabled);
if (enabled) {
Expand Down Expand Up @@ -1194,3 +1195,12 @@ void HostFNE::processPeerReplicaNotify(network::PeerNetwork* peerNetwork)
m_network->setPeerReplica(true);
}
}

/* Processes peer patch status replication. */

void HostFNE::processPeerPatchStatus(network::PeerNetwork* peerNetwork, json::object obj)
{
if (m_network != nullptr && peerNetwork != nullptr) {
m_network->processReplicatedPatchStatus(peerNetwork->getPeerId(), obj);
}
}
7 changes: 7 additions & 0 deletions src/fne/HostFNE.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#define __HOST_FNE_H__

#include "Defines.h"
#include "common/json/json.h"
#include "common/lookups/RadioIdLookup.h"
#include "common/lookups/TalkgroupRulesLookup.h"
#include "common/lookups/PeerListLookup.h"
Expand Down Expand Up @@ -265,6 +266,12 @@ class HOST_SW_API HostFNE {
* @param peerNetwork Peer network instance.
*/
void processPeerReplicaNotify(network::PeerNetwork* peerNetwork);
/**
* @brief Processes peer patch status replication.
* @param peerNetwork Peer network instance.
* @param obj Patch status JSON payload.
*/
void processPeerPatchStatus(network::PeerNetwork* peerNetwork, json::object obj);
};

#endif // __HOST_FNE_H__
Loading