File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
src/main/java/com/mageddo/linux/bluetoothfix Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,9 @@ boolean disconnect(String deviceId) {
6868 }
6969
7070 CommandLines .Result restartService () {
71+
72+ log .warn ("systemctl will ask you for root password to restart bluetooth service ..." );
73+
7174 final CommandLine cmd = new CommandLine ("/bin/sh" )
7275 .addArguments (new String []{
7376 "-c" ,
Original file line number Diff line number Diff line change 55@ Slf4j
66public class Main {
77 public static void main (String [] args ) {
8-
9- if (!Linux .runningAsRoot ()) {
10- log .warn ("you need to run as root due to restart bluetooth service, exiting..." );
8+ if (args .length == 0 ){
9+ log .warn ("pass the bluetooth device id which you want to connect to, ex: \" 94:CC:56:E5:72:85\" " );
1110 System .exit (1 );
1211 }
13- new BluetoothConnector ().connect ("94:DB:56:F5:78:41" );
12+ new BluetoothConnector ().connect (args [ 0 ] );
1413 }
1514
1615}
You can’t perform that action at this time.
0 commit comments