Yes, this is a quite old thread.
I raised this thread just to share what I found in iRex DR series GTK+ patches. If somebody want to incoporate eink update in his C code, here it is (extracted from eink-display-update.patch from iRex):
Quote:
+// IREX
+// create connection to displayMgr
+void irex_display_init(char addr[], int port) {
+ if (irex_display_socket==-1) {
+ irex_display_socket = socket(PF_INET, SOCK_DGRAM, 0);
+ irex_display_addr.sin_family = AF_INET;
+ irex_display_addr.sin_port = htons(port);
+ irex_display_addr.sin_addr.s_addr = inet_addr(addr);
+ irex_pid = getpid();
+ memset(irex_display_addr.sin_zero, '\0', sizeof irex_display_addr.sin_zero);
+ }
+}
+
+// IREX
+// send a display update message
+void irex_display_update(int x, int y, int width, int height) {
+ char msg[256];
+ irex_display_init("127.0.0.1",50555);
+ sprintf(msg,"!I,%d,%d,%d,%d,%d,%d,%d,%d,%s,%d",
+ irex_pid,
+ x, y, width, height,
+ irex_dump_ignore,
+ irex_dump_is_window,
+ irex_dump_window_type,
+ irex_dump_widget_type,
+ irex_dump_focus);
+ //printf("Sent update message: %s\n", msg);
+ sendto(irex_display_socket, msg, strlen(msg), 0,
+ (struct sockaddr*)&irex_display_addr, sizeof(irex_display_addr));
+ irex_dump_focus = 0;
+}
|