Index: libi4uccore/posixserialportutils.vala
===================================================================
--- libi4uccore/posixserialportutils.vala	(revision dfe49c76fe79c726339d9cad8d91dc6242eb2959)
+++ libi4uccore/posixserialportutils.vala	(revision dfe49c76fe79c726339d9cad8d91dc6242eb2959)
@@ -0,0 +1,57 @@
+/* posixserialportutils.vala
+ *
+ * Copyright (C) 2010  Matias De la Puente
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author:
+ * 	Matias De la Puente <mfpuente.ar@gmail.com>
+ */
+using Gee;
+using DBus;
+using Hal;
+
+public class I4uc.Core.PosixSerialPortUtils : SerialPortUtils
+{
+	public override Gee.List<string> list_serial_ports ()
+	{
+		var serial_ports = new ArrayList<string> ();
+		
+		var dbus_error = DBus.RawError ();
+		var hal = new Hal.Context ();
+		
+		if (hal == null)
+			print ("Error getting HAL context\n");
+		
+		if (!hal.set_dbus_connection (RawBus.get (DBus.BusType.SYSTEM, ref dbus_error))) 
+			print ("Error setting dbus connection: %s\n".printf (dbus_error.message));
+		
+		if (!hal.init (ref dbus_error))
+			print ("Cannot initialize connection to the hald\nNormally this means that the HAL deamon (hald) is not running or not ready\n");
+		
+		var udis = hal.find_device_by_capability ("serial", ref dbus_error);
+		if (dbus_error.is_set ()) 
+			print ("Error finding serial devices: %s: %s\n".printf (dbus_error.name, dbus_error.message));
+		
+		foreach (var udi in udis)
+		{
+			var device = hal.device_get_property_string (udi, "serial.device", ref dbus_error);
+			if (dbus_error.is_set ()) 
+				print ("Error getting property string: %s: %s\n".printf (dbus_error.name, dbus_error.message));
+			serial_ports.add (device);
+		}
+		
+		return serial_ports.read_only_view;
+	}
+}
