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
27 changes: 27 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
project(based-connect)

cmake_minimum_required(VERSION 3.2)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)

find_path(GETOPT_HEADER NAMES getopt.h REQUIRED)
find_library(GETOPT_LIBRARIES NAMES getopt REQUIRED)
message(WARNING "Found lib ${GETOPT_LIBRARIES}")

include_directories(${GETOPT_HEADER})

add_executable(based-connect
based.c
based.h
bluetooth.c
bluetooth.h
main.c
util.c
util.h
)
set_property(TARGET based-connect PROPERTY C_STANDARD 99)
target_link_libraries(based-connect ${GETOPT_LIBRARIES})
if (WIN32)
target_link_libraries(based-connect wsock32 ws2_32)
endif (WIN32)
38 changes: 34 additions & 4 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,15 @@ Options:
Print the devices currently connected to the device.
!: indicates the current device
*: indicates other connected devices
S: indicates a device that music is shared to

--connect-device=<address>
Attempt to connect to the device at address.
--connect-device=<address>
Attempt to connect to the device at address.

--connect-music-share=<puppet-address>,<source-address>
Attempt to connect to the puppet device at address
(secondary headphones) and share music from source
address (computer).

--disconnect-device=<address>
Disconnect the device at address.
Expand All @@ -71,8 +77,21 @@ Options:
Building
--------

Simply run `make -j` to build the program. The executable produced will be
called `based-connect`.
Create a build directory (e.g., `mkdir build`) and enter it. Run
```sh
cmake ..
```
to create a Makefile, and then run
```sh
cmake --build .
```
to build the project.

On Windows, you'll need `vcpkg` with the `getopt` package installed. Run
```powershell
cmake -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT\scripts\buildsystems\vcpkg.cmake" ..
```
to create the build files.

Installing
----------
Expand All @@ -84,6 +103,17 @@ Alternatively, if you run Arch Linux, you can download it from the AUR here:

https://aur.archlinux.org/packages/based-connect-git/

Running
-------

On Windows, use
```powershell
Get-PnpDevice -class Bluetooth | Select-Object -Property FriendlyName,
DeviceID
```
to enumerate the Bluetooth device ID. The device ID needs to be written as
AA:BB:CC:DD:EE:FF.

Dependencies
------------

Expand Down
Loading