Skip to content

[Backport release-4_1] Enable automatic reconnect for TCP and UDP NMEA receivers#7238

Merged
nirvn merged 1 commit intorelease-4_1from
backport-7228-to-release-4_1
Mar 31, 2026
Merged

[Backport release-4_1] Enable automatic reconnect for TCP and UDP NMEA receivers#7238
nirvn merged 1 commit intorelease-4_1from
backport-7228-to-release-4_1

Conversation

@qfield-fairy
Copy link
Copy Markdown
Collaborator

Backport #7228
Authored by: @MichaelEFlip

The reconnect infrastructure (mReconnectOnDisconnect flag, mReconnectTimer with 2s delay, state change handler) exists in both TcpReceiver and UdpReceiver but is never activated. The flag mReconnectOnDisconnect is initialized to false and never set to true, so when a connection drops the reconnect timer never starts.

This is inconsistent with BluetoothReceiver which correctly sets its equivalent flag (mConnectOnDisconnect = true) in handleConnectDevice() and tracks connection failures.

Fix: set mReconnectOnDisconnect = true in handleConnectDevice() for both TCP and UDP receivers, with a failure counter that bails out after 10 failed reconnection attempts (matching BluetoothReceiver behavior). The flag is reset to false in handleDisconnectDevice() to prevent reconnection when the user explicitly disconnects.
@qfield-fairy
Copy link
Copy Markdown
Collaborator Author

qfield-fairy commented Mar 31, 2026

🪟 Windows builds

Download a Windows build of this PR for testing.
(Built from commit 46abe34)

🐧 Linux AppImage builds

Download a Linux AppImage build of this PR for testing.
(Built from commit 46abe34)

🍎 MacOS DMG universal builds

Download a MacOS DMG universal build of this PR for testing.
(Built from commit 46abe34)

📱 Android builds

Download an Android arm64 build of this PR for testing.
(Built from commit 46abe34)

Other Android architectures

@nirvn nirvn merged commit f0a7bb4 into release-4_1 Mar 31, 2026
26 checks passed
@nirvn nirvn deleted the backport-7228-to-release-4_1 branch March 31, 2026 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants