Commit e43309f0 authored by Isabella Skořepová's avatar Isabella Skořepová
Browse files

Run autodetect automatically

parent c7829100
......@@ -54,6 +54,7 @@ private interface Methods : GLib.Object {
* Return object name for file name
*=====================================*/
public static string? object_name(string file_name) {
autodetect();
try {
Controller c = Bus.get_proxy_sync(BusType.SESSION,"info.skorepa.DSerial1","/controller");
var path = c.get_path(file_name);
......@@ -68,6 +69,7 @@ public static string? object_name(string file_name) {
* List all available ports
*=====================================*/
public static string[] get_ports() {
autodetect();
try {
Properties c = Bus.get_proxy_sync(BusType.SESSION,"info.skorepa.DSerial1","/controller");
return c.get("info.skorepa.DSerial1.controller", "PortList").get_strv();
......@@ -156,6 +158,7 @@ public class SerialClient {
* Constructor
*=====================================*/
public SerialClient(string port_object) {
autodetect();
stdout.flush();
properties = new PropertiesAccessor(GLib.BusType.SESSION, "info.skorepa.DSerial1.port", port_object);
try {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment