|
|
@ -74,6 +74,8 @@ namespace Mconnect { |
|
|
|
share-url <path> <url> Share URL with device |
|
|
|
share-text <path> <text> Share text with device |
|
|
|
share-file <path> <file> Share file with device |
|
|
|
|
|
|
|
send-sms <number> <message> Send SMS |
|
|
|
""" |
|
|
|
); |
|
|
|
opt_context.set_help_enabled(true); |
|
|
@ -99,6 +101,7 @@ namespace Mconnect { |
|
|
|
Command("share-url", 2, cl.cmd_share_url), |
|
|
|
Command("share-text", 2, cl.cmd_share_text), |
|
|
|
Command("share-file", 2, cl.cmd_share_file), |
|
|
|
Command("send-sms", 3, cl.cmd_send_sms), |
|
|
|
}; |
|
|
|
handle_command(remaining, commands); |
|
|
|
|
|
|
@ -204,6 +207,17 @@ namespace Mconnect { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
private int cmd_send_sms(string[] args) { |
|
|
|
return checked_dbus_call(() => { |
|
|
|
var dp = args[0]; |
|
|
|
var number = args[1]; |
|
|
|
var message = args[2]; |
|
|
|
var telephony = get_telephony(new ObjectPath(dp)); |
|
|
|
telephony.send_sms(number, message); |
|
|
|
return 0; |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
private void print_sorted_caps(string[] caps, string format) { |
|
|
|
qsort_with_data<string>(caps, sizeof(string), |
|
|
|
(a, b) => GLib.strcmp(a, b)); |
|
|
@ -323,6 +337,17 @@ namespace Mconnect { |
|
|
|
return get_mconnect_obj_proxy(path); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* get_telephony: |
|
|
|
* |
|
|
|
* Obtain DBus interface to Telephony of given device |
|
|
|
* |
|
|
|
* @return interface or null |
|
|
|
*/ |
|
|
|
private TelephonyIface? get_telephony(ObjectPath path) throws IOError { |
|
|
|
return get_mconnect_obj_proxy(path); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* print_paths: |
|
|
|
* @objs: object paths |
|
|
|