EzBluetooth is a CLI utility for scanning and managing Bluetooth devices on Linux using bluetoothctl
. It offers
a simple interface for discovering devices, connecting to them, and checking the connection status.
- Scan for Bluetooth devices: Discover available Bluetooth devices in the vicinity.
- Connect to a device: Connect to a Bluetooth device by its name.
- Check connection status: Check the current Bluetooth connection status.
- Cross-platform: Designed to work on Linux systems with Bluetooth support.
Before using EzBluetooth, ensure that:
- Your system has Bluetooth hardware and drivers installed.
bluetoothctl
is available on your system (it’s part of thebluez
package).- You have root or sudo privileges to manage Bluetooth services.
git clone https://github.com/Bl00mGuy/ezbluetooth.git
cd ezbluetooth
Run the following gcc command to compile the project:
gcc -o EzBluetooth src/main.c src/bluetooth.c src/utils.c -lbluetooth -Wall -Wextra -std=c17
Run the utility by executing the following command in your terminal:
./EzBluetooth
Once the program starts, you can enter the following commands:
-
scan
: Scan for available Bluetooth devices in the vicinity.Example:
scan
-
connect DEVICE_NAME
: Connect to a Bluetooth device by its name. ReplaceDEVICE_NAME
with the name of the device.Example:
connect MyBluetoothSpeaker
-
status
: Check the current connection status of your Bluetooth devices.Example:
status
-
exit
: Exit the EzBluetooth utility.Example:
exit
-h, --help
: Show a list of available commands and options.-v, --version
: Show the version of the EzBluetooth utility.
$ ./ezbluetooth
--------------------------------------------------------
▗▄▄▄▖▗▄▄▄▄▖▗▄▄▖ ▗▖ ▗▖ ▗▖▗▄▄▄▖▗▄▄▄▖ ▗▄▖ ▗▄▖ ▗▄▄▄▖▗▖ ▗▖
▐▌ ▗▞▘▐▌ ▐▌▐▌ ▐▌ ▐▌▐▌ █ ▐▌ ▐▌▐▌ ▐▌ █ ▐▌ ▐▌
▐▛▀▀▘ ▗▞▘ ▐▛▀▚▖▐▌ ▐▌ ▐▌▐▛▀▀▘ █ ▐▌ ▐▌▐▌ ▐▌ █ ▐▛▀▜▌
▐▙▄▄▖▐▙▄▄▄▖▐▙▄▞▘▐▙▄▄▖▝▚▄▞▘▐▙▄▄▖ █ ▝▚▄▞▘▝▚▄▞▘ █ ▐▌ ▐▌
EzBluetooth Utility
--------------------------------------------------------
#EzBluetooth: scan
Scanning for devices...
Discovered devices:
1. Name: MyDevice, MAC: 00:11:22:33:44:55
2. Name: BluetoothSpeaker, MAC: 66:77:88:99:00:11
- If you encounter errors like "Failed to stop discovery", make sure you have appropriate permissions to manage
Bluetooth services, or try running the program with
sudo
. - If no devices are found, ensure that your Bluetooth adapter is enabled and in range of discoverable devices.
This project is licensed under the MIT License - see the LICENSE file for details.