|
@ -72,6 +72,8 @@ namespace Mconnect { |
|
|
share-file <path> <file> Share file with device |
|
|
share-file <path> <file> Share file with device |
|
|
|
|
|
|
|
|
send-sms <number> <message> Send SMS |
|
|
send-sms <number> <message> Send SMS |
|
|
|
|
|
|
|
|
|
|
|
find-my-phone <path> Find my phone |
|
|
""" |
|
|
""" |
|
|
); |
|
|
); |
|
|
opt_context.set_help_enabled (true); |
|
|
opt_context.set_help_enabled (true); |
|
@ -98,6 +100,7 @@ namespace Mconnect { |
|
|
Command ("share-text", 2, cl.cmd_share_text), |
|
|
Command ("share-text", 2, cl.cmd_share_text), |
|
|
Command ("share-file", 2, cl.cmd_share_file), |
|
|
Command ("share-file", 2, cl.cmd_share_file), |
|
|
Command ("send-sms", 3, cl.cmd_send_sms), |
|
|
Command ("send-sms", 3, cl.cmd_send_sms), |
|
|
|
|
|
Command ("find-my-phone", 1, cl.cmd_find_my_phone), |
|
|
}; |
|
|
}; |
|
|
handle_command (remaining, commands); |
|
|
handle_command (remaining, commands); |
|
|
|
|
|
|
|
@ -214,6 +217,15 @@ namespace Mconnect { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private int cmd_find_my_phone (string[] args) { |
|
|
|
|
|
return checked_dbus_call (() => { |
|
|
|
|
|
var dp = args[0]; |
|
|
|
|
|
var fmp = get_find_my_phone (new ObjectPath (dp)); |
|
|
|
|
|
fmp.ring (); |
|
|
|
|
|
return 0; |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private void print_sorted_caps (string[] caps, string format) { |
|
|
private void print_sorted_caps (string[] caps, string format) { |
|
|
qsort_with_data<string>(caps, sizeof (string), |
|
|
qsort_with_data<string>(caps, sizeof (string), |
|
|
(a, b) => GLib.strcmp (a, b)); |
|
|
(a, b) => GLib.strcmp (a, b)); |
|
@ -345,6 +357,17 @@ namespace Mconnect { |
|
|
return get_mconnect_obj_proxy (path); |
|
|
return get_mconnect_obj_proxy (path); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* get_find_my_phone: |
|
|
|
|
|
* |
|
|
|
|
|
* Obtain DBus interface to FindMyPhone of given device |
|
|
|
|
|
* |
|
|
|
|
|
* @return interface or null |
|
|
|
|
|
*/ |
|
|
|
|
|
private FindMyPhoneIface ? get_find_my_phone (ObjectPath path) throws IOError { |
|
|
|
|
|
return get_mconnect_obj_proxy (path); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* print_paths: |
|
|
* print_paths: |
|
|
* @objs: object paths |
|
|
* @objs: object paths |
|
|