Skip to contentSkip to conversation

Add more supported HAL classes

PATCH In review Bastien Nocera 2 participants 2 messages Jan 16, 2008 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add more supported HAL classes

Heya,

Server and handheld are both supported minor classes for HAL and hcid, so we should handle them appropriately.

Simple patch attached.

Cheers

Index: applet/main.c
===================================================================
RCS file: /cvsroot/bluez/gnome/applet/main.c,v
retrieving revision 1.95

main.c +4 -1
diff -u -p -r1.95 main.c
@@ -1271,7 +1271,10 @@ static char *get_form_factor(void)
 	libhal_ctx_shutdown(ctx, NULL);
 	libhal_ctx_free(ctx);
 
-	if (strcmp(formfactor, "laptop") && strcmp(formfactor, "desktop")) {
+	if (strcmp(formfactor, "laptop")
+	    && strcmp(formfactor, "desktop")
+	    && strcmp (formfactor, "server")
+	    && strcmp (formfactor, "handheld")) {
 		/* We don't know anything else */
 		g_free(formfactor);
 		formfactor = g_strdup("uncategorized");

Index: properties/adapter.c
===================================================================
RCS file: /cvsroot/bluez/gnome/properties/adapter.c,v retrieving revision 1.17

adapter.c +14 -0
diff -u -p -r1.17 adapter.c
@@ -227,6 +227,12 @@ static void class_callback(GtkWidget *co
 	case 2:
 		minor = "laptop";
 		break;
+	case 3:
+		minor = "server";
+		break;
+	case 4:
+		minor = "handheld";
+		break;
 	default:
 		return;
 	}
@@ -705,6 +711,10 @@ static void create_adapter(struct adapte
 						_("Desktop workstation"));
 	gtk_combo_box_append_text(GTK_COMBO_BOX(combobox),
 						_("Laptop computer"));
+	gtk_combo_box_append_text(GTK_COMBO_BOX(combobox),
+						_("Server"));
+	gtk_combo_box_append_text(GTK_COMBO_BOX(combobox),
+						_("Handheld"));
 	gtk_box_pack_start(GTK_BOX(vbox), combobox, FALSE, FALSE, 0);
 
 	if (major && minor && g_ascii_strcasecmp(major, "computer") == 0) {
@@ -714,6 +724,10 @@ static void create_adapter(struct adapte
 			index = 1;
 		else if (g_ascii_strcasecmp(minor, "laptop") == 0)
 			index = 2;
+		else if (g_ascii_strcasecmp(minor, "server") == 0)
+			index = 3;
+		else if (g_ascii_strcasecmp(minor, "handheld") == 0)
+			index = 4;
 		else
 			index = -1;
 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

maintainer
#1 lore raw

Hi Bastien,

Quoted 2 lines

Server and handheld are both supported minor classes for HAL and hcid, so we should handle them appropriately.

patch has been applied. Thanks.

Regards

Marcel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel