public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [Bluez-devel] [Patch Update] Re: Logitech DiNovo Media LCD
       [not found] <20070108221038.266790@gmx.net>
@ 2007-01-09  4:38 ` Tim Hentenaar
  2007-01-10  8:07   ` Glen Rolle
  0 siblings, 1 reply; 2+ messages in thread
From: Tim Hentenaar @ 2007-01-09  4:38 UTC (permalink / raw)
  To: Glen Rolle; +Cc: Tjalfe, bluez-devel, patrik

[-- Attachment #1: Type: text/plain, Size: 5070 bytes --]

On Mon, 08 Jan 2007 23:10:38 +0100
"Glen Rolle" <g.len@gmx.de> wrote:

> Hello!
> 
> First of all I want to thank you for your efforts developping the LCD
> communication stuff. I have been working on this since several weeks
> to no avail and it seems that my driver programming knowledge was not
> good enough.
> 
> I was working with your patch for several days now and have some
> comments and suggestions.

The thanks, as well as the comments are much appreciated. :)
 
> - When patching I had a problem with the makefile generated
> automatically. The DBUS tags you added in the patch were integrated
> as empty strings into the makefile. I had to place the correct
> contents manually. Don't know why this happened. (I use debian
> testing with bluez-utils 3.7)

You need to rebuild the Makefile.in from Makefile.am by running
automake in the bluez-utils directory after patching, before you run
configure. You might want to retry it with a fresh copy. 

> - I have extended the interface for the lcd and added following
> functions. I wanted to have more atomic control over the LCD.
> 
> -- WriteLine (line_number, scroll_mode, string)
> --- Write only a single line, so that you can set content and scroll
> mode separately for each line.

IMO, it's easier to have the driver auto-determine the scroll mode. 
This saves the programmer from having to deal with splitting up the
text.

> 
> -- SetScreenMode (mode)
> --- An easy way to switch between the 3-line display (0) and the
> clock display (1).

You can switch back to the clock display by pressing "Clear Screen",
and to the "3-line" mode by writing text. (This is so that alerts
persist until the user presses "Clear Screen.")

> 
> -- SendRawData (array_of_integers)
> --- Mainly for testing and debugging purpose, so that you can send
> commands to the LCD without having to recompile fakehid all the time.
> The raw data starts with 0x10 and 0x11 resp. The 0xA2 will be send
> automaticallay.

This could be useful under certain circumstances, however, there's
really no need at this point to send raw data to the mediapad, because
the functionality is quite complete (With the exception of the Nav
indicator and the Calculator -> Clipboard, of course (I know how it
works sending the data back (I've got code in place in the driver), but
I can't seem to isolate the init packet.)) 

> It might be useful to split some of your funtions e. g. the WriteText
> into a "initScreen" part and the text display. (This would remove the
> flashing display when sending new text with WriteText.)

If you look at the code that writes the text out to the display, it
handles the scrolling of the display automatically (for simplicity.)

I do concur that a WriteLine() function would be helpful, so I've added the following (based on your suggestions):

	WriteLine(lineno, text) 
	WriteLineBin(lineno, chars)
	WriteTextBin(lineno, chars)

> - hidd is not always initialized correctly. You can connect the
> MediaPad on two different ways. First is to run hidd --search and
> press the connect button on the MediaPad. This is a bit ugly compared
> to the second method but correctly initializes your DBus-interface
> (and does not show the NAV-led) The second method is to just press a
> key on the MediaPad. It will connect and will be visible to hidd, but
> the connection method in hidd is not run and therefore the
> DBUS-interface is not available. (But the NAV-led works) I think this
> is not a problem with the work you done, but maybe it helps us to
> improve the usage of the MediaPad.

The "second method" is because hidd passes the connection into the
kernel's bluetooth HID driver (which should really be in userspace,
IMHO) - and thus is "never heard from again."

> As a conclusion I would like to suggest that we have one or two more
> reviews on the code and then resend it to the bluez-devel list and
> confirm that it is working. Then we could share some better code and
> the confirmation seems to be neccessary to make the maintainer
> include a patch. (Some kind of approval by other users?)

Attached is an patch against my previous version, for both the python
script, and the driver. I've CC'd this to the list. FYI, I'll be
updating the patch on my website here shortly.

Pardon my nit-picking, however, I did notice a couple bugs in the
patch you attached: 

> + +struct mpcmd {
> +	char    command[22];
> +	uint8_t len;
> +};
> +

> +/*
> + * Send raw data to the MediaPad
> + * The data does not require the 0xa2 at the beginning
> + */
> +static void send_raw_data(int sock, char *data, int length) {
> +	struct mpcmd lcdwi; 
> +	if (!data || sock < 4) return;
> +	memcpy(&lcdwi,write_raw,sizeof(struct mpcmd));
> +	int i;
> +	for (i = 0; i < length; i++) {
> +		lcdwi.command[i + 1] = data[i];

		This will cause a segfault by writing past the end of
		lcdwi.command if (i+1) > 22, or by reading beyond the
		end of data if i is beyond the end of data.

> +	}
> +
> +	write(sock,lcdwi.command,length+1);

		Again, another potential segfault (if length + 1 > 22)

> +}

Regards,

Tim

[-- Attachment #2: bluez-utils-3.8-new.patch --]
[-- Type: text/x-patch, Size: 9497 bytes --]

--- bluez-utils-3.8/hidd/fakehid.c	2006-12-29 18:37:41.000000000 -0500
+++ bluez-utils-3.8/hidd/fakehid.c	2007-01-08 23:13:46.000000000 -0500
@@ -522,20 +522,25 @@
 }
 
 /************************ Logitech Mediapad Driver ********************************
- *     (C) 2006 Tim Hentenaar <tim@hentenaar.com>                                 *
+ *     (C) 2006-2007 Tim Hentenaar <tim@hentenaar.com>                            *
  *     Licensed under the GNU General Public License.                             *
  *     The latest version of this work is available at http://hentenaar.com       *
  *                                                                                *
+ *     Updates:                                                                   *
+ *     		Thanks to Glen Rolle for suggesting the single-line write         *
+ *     		mode, and for showing me a better method for writing chars        *
+ *     		>= 0x80 from python.
+ *                                                                                *
  *     Notes:                                                                     *
- *		1) The i18n for the device isn't currently supported.              *
- *			The way that the i18n works, is that when the device       *
- *			connects, the Winblows app retrieves the respective        *
- *			strings from the device and verifies/updates them.         *
+ *		1) The i18n for the device isn't currently supported.             *
+ *			The way that the i18n works, is that when the device      *
+ *			connects, the Winblows app retrieves the respective       *
+ *			strings from the device and verifies/updates them.        *
  *                                                                                *
- *			Simple enough to do, but I'll worry about it later.        *
- *		2) The '000' key actually sends 3 0's and is not a special key.    *
- *		3) The "Copy calulator result to clipboard" requires an            *
- *		   activation packet that I haven't isolated to date.              *
+ *			Simple enough to do, but I'll worry about it later.       *
+ *		2) The '000' key actually sends 3 0's and is not a special key.   *
+ *		3) The "Copy calulator result to clipboard" requires an           *
+ *		   activation packet that I haven't isolated to date.             *
  *              4) Git-R-Done!                                                    *
  **********************************************************************************/
 
@@ -586,7 +591,21 @@
 	{{ 0xA2, 0x10, 0x00, 0x83, 0x11, 0x00, 0x00, 0x00 }, 8},
 	{{ 0 }, 0}
 };
+
+struct mpcmd write_lcd_single[] = { /* Write a single line of text to the LCD */ 
+	{{ 0xA2, 0x10, 0x00, 0x81, 0x10, 0x00, 0x00, 0x00 }, 8},
+	{{ 0xA2, 0x10, 0x00, 0x80, 0x12, 0x10, 0x10, 0x10 }, 8},
+	{{ 0xA2, 0x10, 0x00, 0x81, 0x10, 0x00, 0x00, 0x00 }, 8},
+	{{ 0xA2, 0x11, 0x00, 0x82, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, 21},
+	{{ 0xA2, 0x11, 0x00, 0x82, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, 21},
+	{{ 0xA2, 0x11, 0x00, 0x82, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, 21},
+	{{ 0xA2, 0x10, 0x00, 0x80, 0x12, 0x10, 0x10, 0x10 }, 8},
+	{{ 0xA2, 0x10, 0x00, 0x83, 0x11, 0x00, 0x00, 0x00 }, 8},
+	{{ 0 }, 0}
+};
+
 #define N_LCDW_CMDS	14
+#define N_LCDS_CMDS	8
 
 /* LCD Line Flags */
 #define LCD_LINE_DISPLAY	0x10
@@ -646,6 +665,20 @@
 "              <!-- Max Length: 144 -->\n"
 "              <arg name=\"text\" type=\"s\" direction=\"in\"/>\n"
 "           </method>\n"
+"            <method name=\"WriteLine\">\n"
+"              <!-- Max Length: 48 -->\n"
+"              <arg name=\"lineno\" type=\"u\" direction=\"in\"/>\n"
+"              <arg name=\"text\"   type=\"s\" direction=\"in\"/>\n"
+"           </method>\n"
+"            <method name=\"WriteTextBin\">\n"
+"              <!-- Max Length: 144 -->\n"
+"              <arg name=\"text\" type=\"ai\" direction=\"in\"/>\n"
+"           </method>\n"
+"            <method name=\"WriteLineBin\">\n"
+"              <!-- Max Length: 48 -->\n"
+"              <arg name=\"lineno\" type=\"u\"  direction=\"in\"/>\n"
+"              <arg name=\"text\"   type=\"ai\" direction=\"in\"/>\n"
+"           </method>\n"
 "         </interface>\n"
 "       </node>\n";
 
@@ -713,7 +746,6 @@
 	while (setclk[i].len != 0) { write(sock,setclk[i].command,setclk[i].len); i++; }
 }
 
-
 static void write_lcd_text(int sock, char *text) {
 	char lines[16*9]; struct mpcmd *lcdw = NULL; uint32_t i = 0,z = 0,line = 0; uint8_t f1 = LCD_LINE_DISPLAY, f2 = LCD_LINE_DISPLAY, f3 = LCD_LINE_DISPLAY;
 
@@ -748,10 +780,44 @@
 	lcdw[12].command[6] = f2;
 	lcdw[12].command[7] = f3;		
 	i = 0; while (lcdw[i].len != 0) { write(sock,lcdw[i].command,lcdw[i].len); i++; } free(lcdw);
+}	
+
+static void write_lcd_line(int sock, char *text, int lineno) {
+	char lines[16*3]; struct mpcmd *lcdw = NULL; uint32_t i = 0,z = 0,line = 0; uint8_t f = LCD_LINE_DISPLAY;
+
+	if (!text || sock < 4) return; lineno = (lineno > 3) ? 3 : (lineno <= 0) ? 1 : lineno;
+	memset(lines,0x20,16*3); z = (strlen(text) > 16*3) ? 16*3 : strlen(text);
+	for (i=0;i<z;i+=16) {
+		line = i / 16;
+		memcpy(lines+(16*line),text+i,((z-i) < 16) ?  (z-i) : 16);
+	}
+
+	lcdw = malloc(sizeof(struct mpcmd)*N_LCDS_CMDS); 
+	memcpy(lcdw,write_lcd_single,sizeof(struct mpcmd)*N_LCDS_CMDS);
+	
+	/* Copy the line text */
+	memcpy(lcdw[3].command+5,lines,16);        
+	memcpy(lcdw[4].command+5,lines+16,16);
+	memcpy(lcdw[5].command+5,lines+(16*2),16);
+
+	/* Adjust the buffer numbers */
+	*(lcdw[3].command+4) = 0x20 + 3*(lineno-1);
+	*(lcdw[4].command+4) = 0x21 + 3*(lineno-1);
+	*(lcdw[5].command+4) = 0x22 + 3*(lineno-1);
+
+	/* Adjust flags */
+	if (z > 16) {
+		f |= LCD_LINE_SCROLL | LCD_2_BUFFERS;
+		if (z > 16*2) { f &= 0xF0; f |= LCD_3_BUFFERS; }
+	}
+
+	/* Write the text */
+	lcdw[1].command[4 + lineno] = LCD_LINE_INIT;
+	i = 0; while (lcdw[i].len != 0) { write(sock,lcdw[i].command,lcdw[i].len); i++; } free(lcdw);
 }		
 
 int logitech_mediapad(int sock) {
-	DBusMessage *db_msg, *db_msg_reply; DBusConnection *db_conn = NULL; DBusError db_err; DBusMessageIter db_args; dbus_uint32_t db_u1, db_u2;
+	DBusMessage *db_msg, *db_msg_reply; DBusConnection *db_conn = NULL; DBusError db_err; DBusMessageIter db_args,db_sub; dbus_uint32_t db_u1, db_u2, db_u3;
 	char buf[25], *cwtmp; struct pollfd p; int fd = 0, mode = 0, discard_keyup = 0, prev_key = 0, icons = 0, on_dbus = 0, last_dbus_poll = 0, ln = 0;
 	memset(&p,0,sizeof(struct pollfd)); p.fd = sock; p.events = POLLIN | POLLHUP | POLLERR; 
 
@@ -827,6 +893,60 @@
 						}
 					}
 					dinovo_dbus_do_reply(db_msg);
+				} else if (dbus_message_is_method_call(db_msg,"com.hentenaar.Dinovo.MediaPad","WriteLine")) {
+					/* WriteLine(lineno, text) Max Length: 48 */ 
+					if (dbus_message_iter_init(db_msg,&db_args)) {
+						if (dbus_message_iter_get_arg_type(&db_args) == DBUS_TYPE_UINT32) dbus_message_iter_get_basic(&db_args,&db_u1);
+						if (dbus_message_iter_has_next(&db_args)) {
+							dbus_message_iter_next(&db_args);
+							if (dbus_message_iter_get_arg_type(&db_args) == DBUS_TYPE_STRING) {
+								dbus_message_iter_get_basic(&db_args,&cwtmp);
+								if (cwtmp && strlen(cwtmp) > 0) write_lcd_line(sock,cwtmp,db_u1);
+							}
+						}
+					}
+					dinovo_dbus_do_reply(db_msg);
+				} else if (dbus_message_is_method_call(db_msg,"com.hentenaar.Dinovo.MediaPad","WriteTextBin")) {
+					/* WriteTextBin(chars) Max Length: 144 */ 
+					if (dbus_message_iter_init(db_msg,&db_args)) {
+						if (dbus_message_iter_get_arg_type(&db_args) == DBUS_TYPE_ARRAY) {
+							dbus_message_iter_recurse(&db_args,&db_sub);
+							if ((cwtmp = malloc(1+(16*9)))) {
+								memset(cwtmp,0,1+(16*9));
+								for (db_u1=0;db_u1<=16*9;db_u1++) {
+									dbus_message_iter_get_basic(&db_sub,&db_u2);
+									cwtmp[db_u1] = (char)db_u2;
+									if (dbus_message_iter_has_next(&db_sub)) dbus_message_iter_next(&db_sub);
+									else break;
+								} 
+								if (db_u1 > 0) write_lcd_text(sock,cwtmp); 
+								free(cwtmp);
+							}
+						}
+					}
+					dinovo_dbus_do_reply(db_msg);
+				} else if (dbus_message_is_method_call(db_msg,"com.hentenaar.Dinovo.MediaPad","WriteLineBin")) {
+					/* WriteLineBin(lineno, chars) Max Length: 48 */ 
+					if (dbus_message_iter_init(db_msg,&db_args)) {
+						if (dbus_message_iter_get_arg_type(&db_args) == DBUS_TYPE_UINT32) dbus_message_iter_get_basic(&db_args,&db_u1);
+						if (dbus_message_iter_has_next(&db_args)) {
+							dbus_message_iter_next(&db_args);
+							if (dbus_message_iter_get_arg_type(&db_args) == DBUS_TYPE_ARRAY) {
+								dbus_message_iter_recurse(&db_args,&db_sub);
+								if ((cwtmp = malloc(1+(16*3)))) {
+									memset(cwtmp,0,1+(16*3));
+									for (db_u3=0;db_u3<=16*3;db_u3++) {
+										dbus_message_iter_get_basic(&db_sub,&db_u2);
+										cwtmp[db_u3] = (char)db_u2;
+										if (dbus_message_iter_has_next(&db_sub)) dbus_message_iter_next(&db_sub);
+										else break;
+									} 
+									if (db_u3 > 0) write_lcd_line(sock,cwtmp,db_u1); free(cwtmp);
+								}
+							}
+						}
+					}
+					dinovo_dbus_do_reply(db_msg);
 				} else if (dbus_message_is_method_call(db_msg,"com.hentenaar.Dinovo.MediaPad","SetIndicator")) {
 					/* SetIndicator(indicator, blink) 
 					 *	[ indicator := see LCD_ICON_* above ]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: dinovo-py.patch --]
[-- Type: text/x-patch; name=dinovo-py.patch, Size: 2595 bytes --]

--- dinovo-dbus-test.py	2006-12-29 18:47:42.000000000 -0500
+++ dinovo-dbus-test.py	2007-01-08 23:17:08.000000000 -0500
@@ -1,4 +1,6 @@
 #!/usr/bin/env python
+# -*- coding: utf8 -*-
+# vim: set fileencoding=utf8 :
 
 import dbus
 
@@ -24,12 +26,20 @@
 LCD_LED_BLINK  = 1
 
 # Special Characters (which might be useful)
-#	Note: In the interest of i18n, it's worth mentioning that the majority of Cyrillic characters are at
-#	      0x80 - 0x8f. The ones that overlap with Greek are in the 0x90 - 0x9f range, along with various
-#	      Symbols (heart, 8th note, 16th node, alarm bell, etc.)
-#
-#	For Cyrillic, the messages work fine on Winblows, which means that the LCD uses the ASCII character set
-#       modified as it would be for KOI8-R.
+# Cyrillic / Greek:
+#	А = 'A'		б = 0x9b	Б = 0x80 	Г = 0x92	
+#	Д = 0x81	Е = 'E'		Ж = 0x82	З = 0x83
+#	И = 0x84	Й = 0x85 	К = 'K'		Л = 0x86
+#	М = 'M'		Н = 'H'		О = 'O'		П = 0x87	
+#	Р = 'P'		С = 'C'		Т = 'T'		У = 0x88
+#	Ф = 0x99	Х = 'X'		Ц = 0x89	Ч = 0x8a
+#	Ш = 0x8b	Щ = 0x8c	Ы = 0x8e	Э = 0x8f
+#	Ю =		Я =		я =		Ь = 0x8d	
+#	ь =		ф = 0xd8	ё = 0xeb
+#	α = 0x90	п = 0x93	Σ = 0x94	σ = 0x95
+#	τ = 0x97	Ω = 0x9a	ε = 0x9e	
+# Latin Extended: 0xc0 - 0xff
+# German ss-Set: ß = 0xdf
 
 SMALL_TRIANGLE_RIGHT = "\x03"
 SMALL_TRIANGLE_LEFT  = "\x04"
@@ -49,6 +59,32 @@
 GEQUAL               = "\x1d"
 LARGE_TRIANGLE_UP    = "\x1e"
 LARGE_TRIANGLE_DOWN  = "\x1f"
+EIGHTH_NOTE	     = "\x91"
+SIXTEENTH_NOTE	     = "\x96"
+BELL		     = "\x98"
+INFINITY	     = "\x9b"
+HEART		     = "\x9c"
+MATH_UNITY	     = "\x9f"
+PAUSE		     = "\xa0"
+UNKNOWN1             = "\xa1"
+CENTS		     = "\xa2"
+POUNDS		     = "\xa3"
+YEN		     = "\xa5"
+PIPE		     = "\xa6" # |
+SECTION		     = "\xa7"
+UMLAUT		     = "\xa8"
+C_INVERSE	     = "\xa9"
+UNKNOWN_2	     = "\xaa"
+DOUBLE_ARROWS_LEFT   = "\xab" # <<
+R_INVERSE	     = "\xae" 
+SQUARED		     = "\xb2"
+CUBED                = "\xb3"
+DOUBLE_ARROWS_RIGHT  = "\xbb" # >>
+ONE_FOURTH	     = "\xbc"
+ONE_HALF             = "\xbd"
+THREE_FOURTHS        = "\xbe"
+SPANISH_QMARK	     = "\xbf"
+
 
 bus = dbus.SystemBus()
 obj = bus.get_object("com.hentenaar.Dinovo.MediaPad", "/com/hentenaar/Dinovo/MediaPad")
@@ -59,4 +95,7 @@
 intf.WriteText(" -------------- "
                "| Dinovo Linux |"
 	       " -------------- ")
+#intf.WriteTextBin([0x83, ord('A'), ord('K'), ord('A'), ord('T')])
+#intf.WriteLineBin(2,[0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff])
+#intf.WriteLine(3,"Git-R-Done")
 

[-- Attachment #4: Type: text/plain, Size: 347 bytes --]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- Attachment #5: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Bluez-devel] [Patch Update] Re: Logitech DiNovo Media LCD
  2007-01-09  4:38 ` [Bluez-devel] [Patch Update] Re: Logitech DiNovo Media LCD Tim Hentenaar
@ 2007-01-10  8:07   ` Glen Rolle
  0 siblings, 0 replies; 2+ messages in thread
From: Glen Rolle @ 2007-01-10  8:07 UTC (permalink / raw)
  To: Tim Hentenaar; +Cc: bluez-devel, tjalfefisk, patrik

> > - I have extended the interface for the lcd and added following
> > functions. I wanted to have more atomic control over the LCD.
> > =

> > -- WriteLine (line_number, scroll_mode, string)
> > --- Write only a single line, so that you can set content and scroll
> > mode separately for each line.
> =

> IMO, it's easier to have the driver auto-determine the scroll mode. =

> This saves the programmer from having to deal with splitting up the
> text.
> =

Yes, but then we are missing the scroll mode 0x20 which scrolls one line ch=
aracter per character (like the html marque).
Maybe we should include a function like WriteScrollingLine, that sets this =
scrolling mode. The autodetection scrolls only buffer-wise.

> > =

> > -- SetScreenMode (mode)
> > --- An easy way to switch between the 3-line display (0) and the
> > clock display (1).
> =

> You can switch back to the clock display by pressing "Clear Screen",
> and to the "3-line" mode by writing text. (This is so that alerts
> persist until the user presses "Clear Screen.")
> =

This function is to allow a programme a more "atomic" control over the disp=
lay.

> > =

> > -- SendRawData (array_of_integers)
> > --- Mainly for testing and debugging purpose, so that you can send
> > commands to the LCD without having to recompile fakehid all the time.
> > The raw data starts with 0x10 and 0x11 resp. The 0xA2 will be send
> > automaticallay.
> =

> This could be useful under certain circumstances, however, there's
> really no need at this point to send raw data to the mediapad, because
> the functionality is quite complete (With the exception of the Nav
> indicator and the Calculator -> Clipboard, of course (I know how it
> works sending the data back (I've got code in place in the driver), but
> I can't seem to isolate the init packet.)) =

> =

I use this function for testing purpose e. g. to evaluate what effect the c=
ommand 0x83 0x00 0x00 0x00 has. (I still don't know ...). We can offer such=
 a function for advanced users, though it is not essential.

> > It might be useful to split some of your funtions e. g. the WriteText
> > into a "initScreen" part and the text display. (This would remove the
> > flashing display when sending new text with WriteText.)
> =

> If you look at the code that writes the text out to the display, it
> handles the scrolling of the display automatically (for simplicity.)
> =

What I noticed between two sequential calls to WriteText was a short flasin=
g on the display. The cause is the command 0x12 0x01 0x01 0x01 which hides =
all three lines. We could avoid this flashing by separating the screen init=
ializing and the actual text writing e. g.:
InitScreen:
  0x80 0x00 0x00 0x00
  0x12 0x01 0x01 0x01
  0x81 0x00 0x00 0x00
WriteTextOnly:
  0x20 ...
  0x21 ...
  ...
  0x28 ...
  0x12 display modes

> I do concur that a WriteLine() function would be helpful, so I've added t=
he following (based on your suggestions):
> =

>     WriteLine(lineno, text) =

>     WriteLineBin(lineno, chars)
>     WriteTextBin(lineno, chars)
>
I had a look at the patch and think we should do some minor changes:
+	{{ 0xA2, 0x10, 0x00, 0x81, 0x10, 0x00, 0x00, 0x00 }, 8},  ## Should be 0x=
80 instead of 0x81
+	{{ 0xA2, 0x10, 0x00, 0x80, 0x12, 0x10, 0x10, 0x10 }, 8},  ## This would c=
hange the scroll mode on all three lines. Using 0x00 instead of 0x10 does n=
ot change the display mode of the othr lines.
+	{{ 0xA2, 0x10, 0x00, 0x81, 0x10, 0x00, 0x00, 0x00 }, 8},
+	{{ 0xA2, 0x11, 0x00, 0x82, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20=
, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, 21},
+	{{ 0xA2, 0x11, 0x00, 0x82, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20=
, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, 21},
+	{{ 0xA2, 0x11, 0x00, 0x82, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20=
, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, 21},
+	{{ 0xA2, 0x10, 0x00, 0x80, 0x12, 0x10, 0x10, 0x10 }, 8},  ## same as abov=
e.
+	{{ 0xA2, 0x10, 0x00, 0x83, 0x11, 0x00, 0x00, 0x00 }, 8},  ## Is this line=
 really required? What does it do?

 =

> > - hidd is not always initialized correctly. You can connect the
> > MediaPad on two different ways. First is to run hidd --search and
> > press the connect button on the MediaPad. This is a bit ugly compared
> > to the second method but correctly initializes your DBus-interface
> > (and does not show the NAV-led) The second method is to just press a
> > key on the MediaPad. It will connect and will be visible to hidd, but
> > the connection method in hidd is not run and therefore the
> > DBUS-interface is not available. (But the NAV-led works) I think this
> > is not a problem with the work you done, but maybe it helps us to
> > improve the usage of the MediaPad.
> =

> The "second method" is because hidd passes the connection into the
> kernel's bluetooth HID driver (which should really be in userspace,
> IMHO) - and thus is "never heard from again."
>
That's bad. Any chance that we can change this behaviour? I would be much m=
ore user-friendly not to have to call hidd manually. Marcel?
 =

> Pardon my nit-picking, however, I did notice a couple bugs in the
> patch you attached: =

That's why I did not send it to the list directly. :-)

Kind regards,

Glen.
-- =

Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! =

Ideal f=FCr Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3DDE=
VDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-01-10  8:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20070108221038.266790@gmx.net>
2007-01-09  4:38 ` [Bluez-devel] [Patch Update] Re: Logitech DiNovo Media LCD Tim Hentenaar
2007-01-10  8:07   ` Glen Rolle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox