mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-15 14:16:02 -06:00
[PR #27] [CLOSED] Make Barrier work over Bluetooth sockets. #1547
Labels
No labels
HiDPI
bounty
bsd/freebsd
bsd/openbsd
bug
bug
build-infra
cantfix
critical
doc
duplicate
enhancement
fix-available
from git
from release
good first issue
help wanted
installer/package
invalid
linux
macOS
meta
needs testing
pull-request
query
question
regression
regression
v2.4.0
windows
wontfix
work-in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/barrier#1547
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/debauchee/barrier/pull/27
Author: @ali1234
Created: 3/31/2018
Status: ❌ Closed
Base:
master← Head:bluetooth-1📝 Commits (3)
e309541Non-breaking, ifdef-wrappable changes for Bluetooth.c7ab51bMore optional code.42245f8Remaining breaking changes.📊 Changes
8 files changed (+410 additions, -23 deletions)
View changed files
📝
CMakeLists.txt(+8 -0)📝
src/lib/arch/IArchNetwork.h(+1 -0)📝
src/lib/arch/unix/ArchNetworkBSD.cpp(+375 -14)📝
src/lib/arch/unix/ArchNetworkBSD.h(+15 -1)📝
src/lib/barrier/ArgParser.cpp(+6 -3)📝
src/lib/ipc/IpcClient.cpp(+2 -2)📝
src/lib/ipc/IpcServer.cpp(+1 -1)📝
src/lib/net/NetworkAddress.cpp(+2 -2)📄 Description
I don't expect you to merge this but I wanted to draw your attention to it, and ask if you are interested in this functionality.
This patch makes barrier run over RFCOMM bluetooth sockets. This is useful for a number of reasons:
It is adapted from synergy-bluetooth which I created nearly 10 years ago with assistance from Valmantas Palikša aka @walmis, who was the maintainer of Blueman at the time. I had thought the code lost, but I was inspired to go looking again with the release of Barrier. I have ported the old code to Barrier and tested that it still works. Unfortunately the change history and attribution is definitely lost, unless walmis has it.
This is Linux-only, and currently breaks TCP socket implementation.
To use it you must run bluetoothd with --compat and give yourself
write access to /var/run/sdp. The SDP code will need to be ported
to the new DBUS implementation to fix this.
No changes are needed in the server config file.
The client can be run with no arguments. It will scan for a server
using SDP. Alternatively a BDADDR can be supplied (run hciconfig
on the server to find it). This mode of operation is more reliable
and does not require the server to be discoverable. However, SDP
scanning allows a client to roam between servers seamlessly.
The SDP code is copyright (C) 2009 Valmantas Palikša.
The trick here is that bluetooth sockets are nearly interchangable with AF_INET sockets on Linux. Also, since the addition of ipv6, there is already support for two different AF socket families and the ability to select which address family to use in many (but not all) parts of the code. AF_BLUETOOTH only really requires slightly different name resolution and everything else works the same. In fact TCPListenSocket already works with AF_BLUETOOTH with no modifications, so maybe its name is not entirely accurate. ;)
The most obvious problem with this patch is that it currently replaces TCP/IP function. In the Ipc classes, and in some other places, the choice of address family is hardcoded. Rather than try to add run time selection like the old version did, I have simply changed them all to kBLUETOOTH. However, in many other places, adding support is as simple as adding another case: to a switch statement.
There is also the issue of SDP. This makes up the bulk of the patch. In Bluez 5 the API used here is deprecated, replaced by a DBus protocol. This may mean a dependency on glib or some other DBus handling library.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.