Send commitlog mailing list submissions to
[EMAIL PROTECTED]
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]
You can reach the person managing the list at
[EMAIL PROTECTED]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:
1. r1757 - in trunk/src/target/OM-2007/openmoko-libs: .
libmokogsmd libmokoui ([EMAIL PROTECTED])
2. r1758 - in trunk/oe/packages: . portmap portmap/files
portmap/portmap-5-26 ([EMAIL PROTECTED])
3. r1759 - in
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm: . data
src ([EMAIL PROTECTED])
--- Begin Message ---
Author: mickey
Date: 2007-04-15 00:30:14 +0200 (Sun, 15 Apr 2007)
New Revision: 1757
Added:
trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/moko-gsmd-marshal.list
Modified:
trunk/src/target/OM-2007/openmoko-libs/configure.ac
trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/Makefile.am
trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/libmokogsmd.pro
trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/moko-gsmd-connection.c
trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/moko-gsmd-connection.h
trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-tool-box.c
trunk/src/target/OM-2007/openmoko-libs/openmoko-libs.pc.in
Log:
openmoko-libs: bump to 0.0.3
- add glib-genmarshal support to buildsystem
- add first bunch of functions to libgsmd API
Modified: trunk/src/target/OM-2007/openmoko-libs/configure.ac
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/configure.ac 2007-04-14 08:30:34 UTC
(rev 1756)
+++ trunk/src/target/OM-2007/openmoko-libs/configure.ac 2007-04-14 22:30:14 UTC
(rev 1757)
@@ -1,5 +1,5 @@
AC_PREREQ(2.53)
-AC_INIT(openmoko-libs, 0.0.2, http://www.openmoko.org/)
+AC_INIT(openmoko-libs, 0.0.3, http://www.openmoko.org/)
AM_INIT_AUTOMAKE()
AC_CONFIG_SRCDIR(libmokoui/moko-window.c)
AM_CONFIG_HEADER(config.h)
Modified: trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/Makefile.am
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/Makefile.am
2007-04-14 08:30:34 UTC (rev 1756)
+++ trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/Makefile.am
2007-04-14 22:30:14 UTC (rev 1757)
@@ -1,9 +1,12 @@
lib_LTLIBRARIES=libmokogsmd.la
public_headers=moko-gsmd-connection.h
+built_sources=moko-gsmd-marshal.h moko-gsmd-marshal.c
+stamp_files=stamp-moko-gsmd-marshal.h stamp-moko-gsmd-marshal.c
sources=moko-gsmd-connection.c
-libmokogsmd_la_SOURCES= $(sources) $(public_headers)
+$(libmokogsmd_la_OBJECTS): $(built_sources)
+libmokogsmd_la_SOURCES= $(public_headers) $(sources)
libmokogsmd_la_LIBADD=
libmokogsmd_la_LDFLAGS= -version-info 0:0:0
AM_CFLAGS = -Wall -pedantic -std=c99
@@ -11,3 +14,19 @@
libmokogsmdheadersdir=$(includedir)/openmoko-libs/libmokogsmd
libmokogsmdheaders_DATA=$(public_headers)
+
+moko-gsmd-marshal.c: stamp-moko-gsmd-marshal.c
+ @true
+stamp-moko-gsmd-marshal.c: moko-gsmd-marshal.list
+ $(GLIB_GENMARSHAL) --prefix=moko_gsmd_marshal
$(srcdir)/moko-gsmd-marshal.list --header --body >moko-gsmd-marshal.c \
+ && echo timestamp >$(@F)
+
+moko-gsmd-marshal.h: stamp-moko-gsmd-marshal.h
+ @true
+stamp-moko-gsmd-marshal.h: moko-gsmd-marshal.list
+ $(GLIB_GENMARSHAL) --prefix=moko_gsmd_marshal
$(srcdir)/moko-gsmd-marshal.list --header >moko-gsmd-marshal.h \
+ && echo timestamp >$(@F)
+
+CLEANFILES = $(stamp_files) $(built_sources)
+DISTCLEANFILES = $(stamp_files) $(built_sources)
+MAINTAINERCLEANFILES = $(stamp_files) $(built_sources)
Modified: trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/libmokogsmd.pro
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/libmokogsmd.pro
2007-04-14 08:30:34 UTC (rev 1756)
+++ trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/libmokogsmd.pro
2007-04-14 22:30:14 UTC (rev 1757)
@@ -1,6 +1,9 @@
TEMPLATE = lib
TARGET = mokogsmd
+GENMARSHALS = moko-gsmd-marshal.list
+GENMARSHALS_PREFIX = moko_gsmd_marshal
+
HEADERS += moko-gsmd-connection.h
SOURCES += moko-gsmd-connection.c
Modified:
trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/moko-gsmd-connection.c
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/moko-gsmd-connection.c
2007-04-14 08:30:34 UTC (rev 1756)
+++ trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/moko-gsmd-connection.c
2007-04-14 22:30:14 UTC (rev 1757)
@@ -16,6 +16,7 @@
*/
#include "moko-gsmd-connection.h"
+#include "moko-gsmd-marshal.h"
#include <libgsmd/libgsmd.h>
@@ -133,6 +134,34 @@
//TODO add SIGNAL_GSMD_EVT_IN_SMS once libgsmd has it
//TODO add SIGNAL_GSMD_EVT_IN_GPRS once libgsmd has it
+ moko_gsmd_connection_signals[SIGNAL_GSMD_EVT_IN_CLIP] = g_signal_new
+ ("incoming-clip",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS,
+ NULL,
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__STRING,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_STRING,
+ NULL);
+
+ moko_gsmd_connection_signals[SIGNAL_GSMD_EVT_NETREG] = g_signal_new
+ ("network-registration",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS,
+ NULL,
+ NULL,
+ NULL,
+ moko_gsmd_marshal_VOID__INT_INT_INT,
+ G_TYPE_NONE,
+ 3,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ NULL);
+
moko_gsmd_connection_signals[SIGNAL_GSMD_EVT_SIGNAL] = g_signal_new
("signal-strength-changed",
G_TYPE_FROM_CLASS (klass),
@@ -196,9 +225,16 @@
case GSMD_EVT_IN_CLIP:
//moko_gsmd_connection_signals[SIGNAL_GSMD_EVT_IN_CLIP]; break;
case GSMD_EVT_NETREG:
- //moko_gsmd_connection_signals[SIGNAL_GSMD_EVT_NETREG]; break;
+ // work around for bugzilla.openmoko.org #454
+ if ( aux->u.netreg.state == MOKO_GSMD_CONNECTION_NETREG_HOME ||
+ aux->u.netreg.state == MOKO_GSMD_CONNECTION_NETREG_ROAMING )
+ g_signal_emit( G_OBJECT(self),
moko_gsmd_connection_signals[SIGNAL_GSMD_EVT_NETREG], 0,
+ aux->u.netreg.state, aux->u.netreg.lac,
aux->u.netreg.ci );
+ else
+ g_signal_emit( G_OBJECT(self),
moko_gsmd_connection_signals[SIGNAL_GSMD_EVT_NETREG], 0,
+ aux->u.netreg.state, 0, 0 );
+ break;
case GSMD_EVT_SIGNAL:
- moko_debug( "-- signal strength = %d", aux->u.signal.sigq.rssi );
g_signal_emit( G_OBJECT(self),
moko_gsmd_connection_signals[SIGNAL_GSMD_EVT_SIGNAL], 0,
aux->u.signal.sigq.rssi ); break;
case GSMD_EVT_PIN:
//moko_gsmd_connection_signals[SIGNAL_GSMD_EVT_PIN]; break;
@@ -250,8 +286,8 @@
priv->source->pollfd.fd = lgsm_fd( priv->handle );
priv->source->pollfd.events = G_IO_IN | G_IO_HUP | G_IO_ERR;
priv->source->pollfd.revents = 0;
- g_source_add_poll( priv->source, &priv->source->pollfd );
- g_source_attach( priv->source, NULL );
+ g_source_add_poll( (GSource*) priv->source, &priv->source->pollfd );
+ g_source_attach( (GSource*) priv->source, NULL );
int rc = 0;
for ( int i = GSMD_EVT_IN_CALL; i < __NUM_GSMD_EVT; ++i )
@@ -262,3 +298,15 @@
}
+/* public API */
+void moko_gsmd_connection_network_register(MokoGsmdConnection* self)
+{
+ MokoGsmdConnectionPrivate* priv = GSMD_CONNECTION_GET_PRIVATE(self);
+ lgsm_netreg_register( priv->handle, 0 );
+}
+
+void moko_gsmd_connection_set_antenna_power(MokoGsmdConnection* self, gboolean
on)
+{
+ MokoGsmdConnectionPrivate* priv = GSMD_CONNECTION_GET_PRIVATE(self);
+ lgsm_phone_power( priv->handle, on ? 1 : 0 );
+}
Modified:
trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/moko-gsmd-connection.h
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/moko-gsmd-connection.h
2007-04-14 08:30:34 UTC (rev 1756)
+++ trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/moko-gsmd-connection.h
2007-04-14 22:30:14 UTC (rev 1757)
@@ -39,9 +39,23 @@
GType moko_gsmd_connection_get_type();
MokoGsmdConnection* moko_gsmd_connection_new();
+void moko_gsmd_connection_network_register(MokoGsmdConnection* self); //TODO
add type, i.e. MOKO_GSMD_CONNECTION_NETREG_AUTO
+void moko_gsmd_connection_set_antenna_power(MokoGsmdConnection* self, gboolean
on);
+enum {
+ MOKO_GSMD_CONNECTION_NETREG_NONE = 0,
+ MOKO_GSMD_CONNECTION_NETREG_HOME = 1,
+ MOKO_GSMD_CONNECTION_NETREG_SEARCHING = 2,
+ MOKO_GSMD_CONNECTION_NETREG_DENIED = 3,
+ MOKO_GSMD_CONNECTION_NETREG_ROAMING = 5,
+} MokoGsmdConnectionNetregType;
+
/* signals */
void moko_gsmd_connection_incoming_call(MokoGsmdConnection* self, int type);
+//sms
+//gprs
+void moko_gsmd_connection_incoming_clip(MokoGsmdConnection* self, const char*
number);
+void moko_gsmd_connection_network_registration(MokoGsmdConnection* self, int
type, int lac, int cell);
void moko_gsmd_connection_signal_strength_changed(MokoGsmdConnection* self,
int strength);
G_END_DECLS
Added: trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/moko-gsmd-marshal.list
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/moko-gsmd-marshal.list
2007-04-14 08:30:34 UTC (rev 1756)
+++ trunk/src/target/OM-2007/openmoko-libs/libmokogsmd/moko-gsmd-marshal.list
2007-04-14 22:30:14 UTC (rev 1757)
@@ -0,0 +1 @@
+VOID:INT,INT,INT
Modified: trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-tool-box.c
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-tool-box.c
2007-04-14 08:30:34 UTC (rev 1756)
+++ trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-tool-box.c
2007-04-14 22:30:14 UTC (rev 1757)
@@ -49,11 +49,11 @@
LAST_SIGNAL,
};
+static guint moko_tool_box_signals[LAST_SIGNAL] = { 0 };
+
static void moko_tool_box_class_init (MokoToolBoxClass *klass);
static void moko_tool_box_init (MokoToolBox *self);
-static guint moko_tool_box_signals[LAST_SIGNAL] = { 0 };
-
static void _button_release(GtkWidget* w, MokoToolBox* self)
{
MokoToolBoxPriv *priv = MOKO_TOOL_BOX_GET_PRIVATE(self);
Modified: trunk/src/target/OM-2007/openmoko-libs/openmoko-libs.pc.in
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/openmoko-libs.pc.in 2007-04-14
08:30:34 UTC (rev 1756)
+++ trunk/src/target/OM-2007/openmoko-libs/openmoko-libs.pc.in 2007-04-14
22:30:14 UTC (rev 1757)
@@ -7,5 +7,5 @@
Description: OpenMoko Application Framework Libraries
Version: @VERSION@
Cflags: -I${includedir}
-Libs: -L${libdir} -lmokoui
+Libs: -L${libdir} -lmokoui -lmokojournal -lmokogsmd
Requires: gtk+-2.0
--- End Message ---
--- Begin Message ---
Author: mickey
Date: 2007-04-15 01:19:36 +0200 (Sun, 15 Apr 2007)
New Revision: 1758
Added:
trunk/oe/packages/portmap/
trunk/oe/packages/portmap/files/
trunk/oe/packages/portmap/files/make.patch
trunk/oe/packages/portmap/files/no-libwrap.patch
trunk/oe/packages/portmap/files/portmap.init
trunk/oe/packages/portmap/portmap-5-26/
trunk/oe/packages/portmap/portmap-5-26/make.patch
trunk/oe/packages/portmap/portmap.inc
trunk/oe/packages/portmap/portmap_5-26.bb
Log:
oe: add portmap w/ different SRC_URI, closes #283
Added: trunk/oe/packages/portmap/files/make.patch
===================================================================
--- trunk/oe/packages/portmap/files/make.patch 2007-04-14 22:30:14 UTC (rev
1757)
+++ trunk/oe/packages/portmap/files/make.patch 2007-04-14 23:19:36 UTC (rev
1758)
@@ -0,0 +1,83 @@
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+--- portmap_5beta/Makefile~make.patch
++++ portmap_5beta/Makefile
+@@ -105,6 +105,13 @@
+ #
+ #CONST = -Dconst=
+
++DESTDIR =
++prefix = /usr
++sbindir = /sbin
++datadir = $(prefix)/share
++mandir = $(datadir)/man
++docdir = $(datadir)/doc/portmap
++
+ ### End of configurable stuff.
+ ##############################
+
+@@ -122,35 +129,38 @@
+ COPT = $(CONST) $(HOSTS_ACCESS) $(CHECK_PORT) \
+ $(SYS) -DFACILITY=$(FACILITY) $(ULONG) $(ZOMBIES) $(SA_LEN) \
+ $(LOOPBACK) $(SETPGRP)
+-CFLAGS = -Wall $(COPT) -O2 $(NSARCHS)
++CFLAGS = -Wall -O2 $(NSARCHS)
+ OBJECTS = portmap.o pmap_check.o from_local.o $(AUX)
+
+ all: portmap pmap_dump pmap_set
+
+ portmap: $(OBJECTS) # $(WRAP_DIR)/libwrap.a
+- $(CC) $(CFLAGS) -o $@ $(OBJECTS) $(WRAP_LIB) $(LIBS)
++ $(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(WRAP_LIB) $(LIBS)
+
+-pmap_dump: pmap_dump.c
+- $(CC) $(CFLAGS) -o $@ $? $(LIBS)
++pmap_dump: pmap_dump.o
++ $(CC) $(LDFLAGS) -o $@ $? $(LIBS)
+
+-pmap_set: pmap_set.c
+- $(CC) $(CFLAGS) -o $@ $? $(LIBS)
++pmap_set: pmap_set.o
++ $(CC) $(LDFLAGS) -o $@ $? $(LIBS)
+
+ from_local: from_local.c
+- cc $(CFLAGS) -DTEST -o $@ from_local.c
++ $(CC) $(COPT) -DTEST $(CFLAGS) $(LDFLAGS) -o $@ from_local.c
+
+ get_myaddress: get_myaddress.c
+- cc $(CFLAGS) -DTEST -o $@ get_myaddress.c $(LIBS)
++ $(CC) $(COPT) -DTEST $(CFLAGS) $(LDFLAGS) -o $@ get_myaddress.c $(LIBS)
+
+ install: all
+- install -o root -g root -m 0755 -s portmap ${BASEDIR}/sbin
+- install -o root -g root -m 0755 -s pmap_dump ${BASEDIR}/sbin
+- install -o root -g root -m 0755 -s pmap_set ${BASEDIR}/sbin
+- install -o root -g root -m 0644 portmap.8 ${BASEDIR}/usr/share/man/man8
+- install -o root -g root -m 0644 pmap_dump.8
${BASEDIR}/usr/share/man/man8
+- install -o root -g root -m 0644 pmap_set.8 ${BASEDIR}/usr/share/man/man8
+- cat BLURB >${BASEDIR}/usr/share/doc/portmap/portmapper.txt
+- gzip -9f ${BASEDIR}/usr/share/doc/portmap/portmapper.txt
++ install -d $(DESTDIR)/$(sbindir) \
++ $(DESTDIR)/$(docdir) \
++ $(DESTDIR)/$(mandir)/man8
++ install -m 0755 portmap $(DESTDIR)/$(sbindir)
++ install -m 0755 pmap_dump $(DESTDIR)/$(sbindir)
++ install -m 0755 pmap_set $(DESTDIR)/$(sbindir)
++ install -m 0644 portmap.8 $(DESTDIR)/$(mandir)/man8
++ install -m 0644 pmap_dump.8 $(DESTDIR)/$(mandir)/man8
++ install -m 0644 pmap_set.8 $(DESTDIR)/$(mandir)/man8
++ cat BLURB >$(DESTDIR)/$(docdir)/portmapper.txt
++ gzip -9f $(DESTDIR)/$(docdir)/portmapper.txt
+
+
+ lint:
+@@ -176,3 +186,6 @@
+ portmap.o: portmap.c
+ portmap.o: pmap_check.h Makefile
+ strerror.o: strerror.c
++
++%.o: %.c
++ $(CC) $(COPT) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $*.c -o $*.o
Added: trunk/oe/packages/portmap/files/no-libwrap.patch
===================================================================
--- trunk/oe/packages/portmap/files/no-libwrap.patch 2007-04-14 22:30:14 UTC
(rev 1757)
+++ trunk/oe/packages/portmap/files/no-libwrap.patch 2007-04-14 23:19:36 UTC
(rev 1758)
@@ -0,0 +1,26 @@
+--- Makefile~ 2004-06-03 11:19:23.000000000 +0100
++++ Makefile 2004-06-03 11:24:53.000000000 +0100
+@@ -15,9 +15,9 @@
+ # no access control tables. The local system, since it runs the portmap
+ # daemon, is always treated as an authorized host.
+
+-HOSTS_ACCESS= -DHOSTS_ACCESS
++#HOSTS_ACCESS= -DHOSTS_ACCESS
+ #WRAP_LIB = $(WRAP_DIR)/libwrap.a
+-WRAP_LIB = -lwrap
++#WRAP_LIB = -lwrap
+
+ # Comment out if your RPC library does not allocate privileged ports for
+ # requests from processes with root privilege, or the new portmap will
+--- pmap_check.c~ 2004-06-03 11:24:20.000000000 +0100
++++ pmap_check.c 2004-06-03 11:24:33.000000000 +0100
+@@ -48,7 +48,9 @@
+ #endif
+ #include <sys/types.h>
+ #include <unistd.h>
++#ifdef HOSTS_ACCESS
+ #include <tcpd.h>
++#endif
+
+ extern char *inet_ntoa();
+
Added: trunk/oe/packages/portmap/files/portmap.init
===================================================================
--- trunk/oe/packages/portmap/files/portmap.init 2007-04-14 22:30:14 UTC
(rev 1757)
+++ trunk/oe/packages/portmap/files/portmap.init 2007-04-14 23:19:36 UTC
(rev 1758)
@@ -0,0 +1,50 @@
+#!/bin/sh
+#
+# start/stop portmap daemon.
+
+test -f /sbin/portmap || exit 0
+
+case "$1" in
+ start)
+ echo -n "Starting portmap daemon:"
+ echo -n " portmap"
+ start-stop-daemon --start --quiet --exec /sbin/portmap
+ echo "."
+
+ if [ -f /var/run/portmap.upgrade-state ]; then
+ echo -n "Restoring old RPC service information..."
+ sleep 1 # needs a short pause or pmap_set won't work. :(
+ pmap_set </var/run/portmap.upgrade-state
+ rm -f /var/run/portmap.upgrade-state
+ echo "done."
+ fi
+
+ ;;
+ stop)
+ echo -n "Stopping portmap daemon:"
+ echo -n " portmap" ; start-stop-daemon --stop --quiet --exec
/sbin/portmap
+ echo "."
+ ;;
+ reload)
+ ;;
+ force-reload)
+ $0 restart
+ ;;
+ restart)
+ pmap_dump >/var/run/portmap.state
+ $0 stop
+ $0 start
+ if [ ! -f /var/run/portmap.upgrade-state ]; then
+ sleep 1
+ pmap_set </var/run/portmap.state
+ fi
+ rm -f /var/run/portmap.state
+ ;;
+ *)
+ echo "Usage: /etc/init.d/portmap {start|stop|reload|restart}"
+ exit 1
+ ;;
+esac
+
+exit 0
+
Property changes on: trunk/oe/packages/portmap/files/portmap.init
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/oe/packages/portmap/portmap-5-26/make.patch
===================================================================
--- trunk/oe/packages/portmap/portmap-5-26/make.patch 2007-04-14 22:30:14 UTC
(rev 1757)
+++ trunk/oe/packages/portmap/portmap-5-26/make.patch 2007-04-14 23:19:36 UTC
(rev 1758)
@@ -0,0 +1,73 @@
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+Index: portmap_5beta/Makefile
+===================================================================
+--- portmap_5beta.orig/Makefile 2006-12-19 10:32:58.000000000 +0000
++++ portmap_5beta/Makefile 2006-12-19 10:35:54.000000000 +0000
+@@ -110,6 +110,13 @@
+ #
+ #CONST = -Dconst=
+
++DESTDIR =
++prefix = /usr
++sbindir = /sbin
++datadir = $(prefix)/share
++mandir = $(datadir)/man
++docdir = $(datadir)/doc/portmap
++
+ ### End of configurable stuff.
+ ##############################
+
+@@ -127,7 +134,7 @@
+ COPT = $(CONST) $(HOSTS_ACCESS) $(CHECK_PORT) \
+ $(SYS) -DFACILITY=$(FACILITY) $(ULONG) $(ZOMBIES) $(BROKEN_PIPE) \
+ $(SA_LEN) $(LOOPBACK) $(SETPGRP)
+-CFLAGS = -Wall $(COPT) -O2 $(NSARCHS)
++CFLAGS = -Wall -O2 $(NSARCHS)
+ OBJECTS = portmap.o pmap_check.o from_local.o $(AUX)
+
+ all: portmap pmap_dump pmap_set
+@@ -142,20 +149,23 @@
+ $(CC) $(CFLAGS) -o $@ $? $(LIBS)
+
+ from_local: from_local.c
+- cc $(CFLAGS) -DTEST -o $@ from_local.c
++ $(CC) $(COPT) -DTEST $(CFLAGS) $(LDFLAGS) -o $@ from_local.c
+
+ get_myaddress: get_myaddress.c
+- cc $(CFLAGS) -DTEST -o $@ get_myaddress.c $(LIBS)
++ $(CC) $(COPT) -DTEST $(CFLAGS) $(LDFLAGS) -o $@ get_myaddress.c $(LIBS)
+
+ install: all
+- install -o root -g root -m 0755 -s portmap ${BASEDIR}/sbin
+- install -o root -g root -m 0755 -s pmap_dump ${BASEDIR}/sbin
+- install -o root -g root -m 0755 -s pmap_set ${BASEDIR}/sbin
+- install -o root -g root -m 0644 portmap.8 ${BASEDIR}/usr/share/man/man8
+- install -o root -g root -m 0644 pmap_dump.8
${BASEDIR}/usr/share/man/man8
+- install -o root -g root -m 0644 pmap_set.8 ${BASEDIR}/usr/share/man/man8
+- cat BLURB >${BASEDIR}/usr/share/doc/portmap/portmapper.txt
+- gzip -9f ${BASEDIR}/usr/share/doc/portmap/portmapper.txt
++ install -d $(DESTDIR)/$(sbindir) \
++ $(DESTDIR)/$(docdir) \
++ $(DESTDIR)/$(mandir)/man8
++ install -m 0755 portmap ${DESTDIR}/sbin
++ install -m 0755 pmap_dump ${DESTDIR}/sbin
++ install -m 0755 pmap_set ${DESTDIR}/sbin
++ install -m 0644 portmap.8 ${DESTDIR}/usr/share/man/man8
++ install -m 0644 pmap_dump.8 ${DESTDIR}/usr/share/man/man8
++ install -m 0644 pmap_set.8 ${DESTDIR}/usr/share/man/man8
++ cat BLURB >${DESTDIR}/usr/share/doc/portmap/portmapper.txt
++ gzip -9f ${DESTDIR}/usr/share/doc/portmap/portmapper.txt
+
+
+ lint:
+@@ -181,3 +191,6 @@
+ portmap.o: portmap.c
+ portmap.o: pmap_check.h Makefile
+ strerror.o: strerror.c
++
++%.o: %.c
++ $(CC) $(COPT) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $*.c -o $*.o
Added: trunk/oe/packages/portmap/portmap.inc
===================================================================
--- trunk/oe/packages/portmap/portmap.inc 2007-04-14 22:30:14 UTC (rev
1757)
+++ trunk/oe/packages/portmap/portmap.inc 2007-04-14 23:19:36 UTC (rev
1758)
@@ -0,0 +1,32 @@
+DESCRIPTION = "RPC program number mapper."
+SECTION = "console/network"
+LICENSE = "GPL"
+PR = "r1"
+
+SRC_URI = "http://files.ichilton.co.uk/nfs/portmap_5.orig.tar.gz \
+
http://crypto.riken.go.jp/archives/linux/debian/debian/pool/main/p/portmap/portmap_${PV}.diff.gz;patch=1
\
+ file://no-libwrap.patch;patch=1;pnum=0 \
+ file://portmap.init \
+ file://make.patch;patch=1"
+S = "${WORKDIR}/portmap_5beta"
+
+INITSCRIPT_NAME = "portmap"
+INITSCRIPT_PARAMS = "start 43 S . start 32 0 6 . stop 81 1 ."
+
+inherit update-rc.d
+
+sbindir = "/sbin"
+
+do_compile() {
+ oe_runmake
+}
+
+do_install() {
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/portmap.init ${D}${sysconfdir}/init.d/portmap
+ oe_runmake 'docdir=${docdir}/portmap' 'DESTDIR=${D}' install
+}
+
+PACKAGES =+ "portmap-utils"
+FILES_portmap-utils = "/sbin/pmap_set /sbin/pmap_dump"
+FILES_${PN}-doc += "${docdir}"
Added: trunk/oe/packages/portmap/portmap_5-26.bb
===================================================================
--- trunk/oe/packages/portmap/portmap_5-26.bb 2007-04-14 22:30:14 UTC (rev
1757)
+++ trunk/oe/packages/portmap/portmap_5-26.bb 2007-04-14 23:19:36 UTC (rev
1758)
@@ -0,0 +1 @@
+require portmap.inc
--- End Message ---
--- Begin Message ---
Author: mickey
Date: 2007-04-15 01:26:52 +0200 (Sun, 15 Apr 2007)
New Revision: 1759
Added:
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/data/SignalStrength_NR.png
Removed:
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.c
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.h
Modified:
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/configure.ac
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/data/Makefile.am
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/Makefile.am
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
Log:
openmoko-panel-gsm: scratch the current state and reimplement it completely
using the nice MokoGsmdConnection abstraction
Modified: trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/configure.ac
===================================================================
--- trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/configure.ac
2007-04-14 23:19:36 UTC (rev 1758)
+++ trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/configure.ac
2007-04-14 23:26:52 UTC (rev 1759)
@@ -11,15 +11,12 @@
AC_PROG_LIBTOOL
# base deps
-PKG_CHECK_MODULES(OPENMOKO, openmoko-libs >= 0.0.2,,
- AC_MSG_ERROR([*** Required OpenMoko Libraries >= 0.0.2 not
installed ***]))
+PKG_CHECK_MODULES(OPENMOKO, openmoko-libs >= 0.0.3,,
+ AC_MSG_ERROR([*** Required OpenMoko Libraries >= 0.0.3 not
installed ***]))
-PKG_CHECK_MODULES(LIBGSMD, libgsmd,,
- exit)
+LIBS="$LIBS $OPENMOKO_LIBS"
+CFLAGS="$CFLAGS $OPENMOKO_CFLAGS"
-LIBS="$LIBS $OPENMOKO_LIBS $LIBGSMD_LIBS"
-CFLAGS="$CFLAGS $OPENMOKO_CFLAGS $LIBGSMD_CFLAGS"
-
# output stuff
AC_OUTPUT([
Makefile
Modified:
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/data/Makefile.am
===================================================================
--- trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/data/Makefile.am
2007-04-14 23:19:36 UTC (rev 1758)
+++ trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/data/Makefile.am
2007-04-14 23:26:52 UTC (rev 1759)
@@ -11,6 +11,8 @@
SignalStrength25g_04.png \
SignalStrength25g_05.png \
\
+ SignalStrength_NR.png \
+ \
SignalStrength_00.png \
SignalStrength_01.png \
SignalStrength_02.png \
Added:
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/data/SignalStrength_NR.png
===================================================================
(Binary files differ)
Property changes on:
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/data/SignalStrength_NR.png
___________________________________________________________________
Name: svn:mime-type
+ image/png
Modified:
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/Makefile.am
===================================================================
--- trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/Makefile.am
2007-04-14 23:19:36 UTC (rev 1758)
+++ trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/Makefile.am
2007-04-14 23:26:52 UTC (rev 1759)
@@ -4,7 +4,7 @@
appletdir = $(libdir)/matchbox-panel/
applet_LTLIBRARIES = libopenmoko-panel-gsm.la
-libopenmoko_panel_gsm_la_SOURCES = openmoko-panel-gsm.c moko-gsm-conn.c
+libopenmoko_panel_gsm_la_SOURCES = openmoko-panel-gsm.c
libopenmoko_panel_gsm_la_LIBADD = @OPENMOKO_LIBS@
MAINTAINERCLEANFILES = Makefile.in
Deleted:
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.c
===================================================================
---
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.c
2007-04-14 23:19:36 UTC (rev 1758)
+++
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.c
2007-04-14 23:26:52 UTC (rev 1759)
@@ -1,201 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include <sys/time.h>
-
-#include <libgsmd/libgsmd.h>
-#include <libgsmd/event.h>
-
-#include <glib/gmain.h>
-#include <glib/giochannel.h>
-
-#include "moko-gsm-conn.h"
-
-#undef FALSE
-#define FALSE 0
-#undef TRUE
-#define TRUE 1
-
-static struct lgsm_handle *lgsmh = NULL;
-static GPollFD GPfd;
-static gint gsm_q = -99;
-static gint gprs_q = -99;
-static int test = 0;
-
-static gboolean
-gsm_watcher_prepare (GSource * source, gint * timeout)
-{
- *timeout = -1;
-
- return FALSE;
-}
-
-static gboolean
-gsm_watcher_check (GSource * source)
-{
- if (GPfd.revents & (G_IO_IN | G_IO_PRI))
- {
- return TRUE;
- }
- else
- {
- return FALSE;
- }
-
-}
-static gboolean
-gsm_watcher_dispatch (GSource * source,
- GSourceFunc callback, gpointer user_data)
-{
- int rc;
- char buf[STDIN_BUF_SIZE + 1];
- int gsm_fd = lgsm_fd (lgsmh);
- /* we've received something on the gsmd socket, pass it
- * on to the library */
-
- rc = read (gsm_fd, buf, sizeof (buf));
- if (rc <= 0)
- {
- return FALSE;
- }
- else
- {
- rc = lgsm_handle_packet (lgsmh, buf, rc);
- }
-
- return TRUE;
-}
-
-static int
-sigq_handler(struct lgsm_handle *lh, int evt, struct gsmd_evt_auxdata *aux)
-{
- printf("EVENT: Signal Quality: %u\n", aux->u.signal.sigq.rssi);
- gsm_q = aux->u.signal.sigq.rssi;
- //FIXME: Call panel applet image change function here, instead of use g
timeout function to check singal value
- return 0;
-}
-
-static int
-netreg_handler(struct lgsm_handle *lh, int evt, struct gsmd_evt_auxdata *aux)
-{
- printf("EVENT: Netreg ");
-
- switch (aux->u.netreg.state)
- {
- case 0:
- printf("not searching for network ");
- break;
- case 1:
- printf("registered (home network) ");
- break;
- case 2:
- printf("searching for network ");
- break;
- case 3:
- printf("registration denied ");
- break;
- case 5:
- printf("registered (roaming) ");
- break;
- }
-
- if (aux->u.netreg.lac)
- printf("LocationAreaCode = 0x%04X ", aux->u.netreg.lac);
- if (aux->u.netreg.ci)
- printf("CellID = 0x%04X ", aux->u.netreg.ci);
-
- printf("\n");
- return 0;
-}
-
-static int
-gsm_connect_init()
-{
- lgsmh = lgsm_init(LGSMD_DEVICE_GSMD);
-
- if (!lgsmh)
- {
- printf("Can't connect to gsmd\n");
- return FALSE;
- }
- else
- {
- lgsm_evt_handler_register(lgsmh, GSMD_EVT_NETREG, &netreg_handler);
- lgsm_evt_handler_register(lgsmh, GSMD_EVT_SIGNAL, &sigq_handler);
- return TRUE;
- }
-}
-
-SignalStatus
-moko_panel_gsm_signal_quality()
-{
- switch (gsm_q)
- {
- case 4 :
- return LEVEL_1 ;
- case 3 :
- return LEVEL_2 ;
- case 2 :
- return LEVEL_3 ;
- case 1 :
- return LEVEL_4 ;
- case 0 :
- return LEVEL_5 ;
- default :
- return UN_CONN;
- }
-}
-/*for a rainning day*/
-SignalStatus
-moko_panel_gprs_signal_quality()
-{
-//some code for only for test, since there have not any methord to check out
gprs signal.
-if (0)
-{
- test ++;
- if (test > 11 || test < 0)
- test = 0;
- switch (test)
- {
- case 10 :
- return LEVEL_1 ;
- case 9 :
- return LEVEL_2 ;
- case 8 :
- return LEVEL_3 ;
- case 7 :
- return LEVEL_4 ;
- case 6 :
- return LEVEL_5 ;
- default :
- return UN_CONN;
- }
-}
- return UN_CONN;
-}
-
-void
-gsm_watcher_install (void)
-{
- static GSourceFuncs gsm_watcher_funcs = {
- gsm_watcher_prepare,
- gsm_watcher_check,
- gsm_watcher_dispatch,
- NULL
- };
- /* FIXME: we never unref the watcher. */
- GSource *gsm_watcher = g_source_new (&gsm_watcher_funcs, sizeof (GSource));
-
- gsm_connect_init();
-
- if (!lgsmh)
- return ;
-
- GPfd.fd = lgsm_fd (lgsmh);
- GPfd.events = G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_PRI;
- GPfd.revents = 0;
-
- g_source_add_poll (gsm_watcher, &GPfd);
- g_source_attach (gsm_watcher, NULL);
-
- return;
-}
Deleted:
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.h
===================================================================
---
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.h
2007-04-14 23:19:36 UTC (rev 1758)
+++
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.h
2007-04-14 23:26:52 UTC (rev 1759)
@@ -1,35 +0,0 @@
-#ifndef _MOKO_PANEL_GSM_CONN_
-#define _MOKO_PANEL_GSM_CONN_
-
-#include <glib-object.h>
-
-#define STDIN_BUF_SIZE 1024
-/*signal value: "0": best connection "5": connect error*/
-G_BEGIN_DECLS
-
-enum{
- GSM,
- GPRS,
- SIN_NO
-};
-
-typedef enum{
- UN_INIT = -1,
- LEVEL_1 = 0,
- LEVEL_2,
- LEVEL_3,
- LEVEL_4,
- LEVEL_5,
- UN_CONN,
- TOTAL_STATUS
-}SignalStatus;
-
-void gsm_watcher_install (void);
-
-SignalStatus moko_panel_gsm_signal_quality(void);
-
-SignalStatus moko_panel_gprs_signal_quality(void);
-
-G_END_DECLS
-
-#endif /*_MOKO_PANEL_GSM_CONN_*/
Modified:
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
===================================================================
---
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
2007-04-14 23:19:36 UTC (rev 1758)
+++
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
2007-04-14 23:26:52 UTC (rev 1759)
@@ -1,6 +1,6 @@
/* openmoko-panel-gsm.c
*
- * Authored by Sun Zhiyong <[EMAIL PROTECTED]>
+ * Authored by Michael 'Mickey' Lauer <[EMAIL PROTECTED]>
* Copyright (C) 2007 OpenMoko Inc.
*
* This program is free software; you can redistribute it and/or modify
@@ -14,6 +14,7 @@
*
* Current Version: $Rev$ ($Date$) [$Author: mickey $]
*/
+#include <libmokogsmd/moko-gsmd-connection.h>
#include <libmokoui/moko-panel-applet.h>
#include <gtk/gtkimage.h>
@@ -21,108 +22,50 @@
#include <gtk/gtk.h>
#include <time.h>
-#include "moko-gsm-conn.h"
-
-typedef struct{
- GtkWidget *image;
- SignalStatus status;
-} MokoSignal;
-
typedef struct {
- MokoSignal gsm;
- MokoSignal gprs;
- GtkWidget *hbox;
- guint timeout_id;
+ GtkImage* image;
+ gboolean gprs_mode;
} GsmApplet;
-static gchar *gsm_q_name[TOTAL_STATUS]={
- "SignalStrength_01.png",
- "SignalStrength_02.png",
- "SignalStrength_03.png",
- "SignalStrength_04.png",
- "SignalStrength_05.png",
- "SignalStrength_00.png"
-};
-
-static gchar *gprs_q_name[TOTAL_STATUS]={
- "SignalStrength25g_01.png",
- "SignalStrength25g_02.png",
- "SignalStrength25g_03.png",
- "SignalStrength25g_04.png",
- "SignalStrength25g_05.png",
- NULL
-};
-
-static void
-gsm_applet_free (GsmApplet *applet)
+static void gsm_applet_free(GsmApplet *applet)
{
- g_source_remove (applet->timeout_id);
-
- g_slice_free (GsmApplet, applet);
+ g_slice_free( GsmApplet, applet );
}
-static gboolean
-timeout_cb (GsmApplet *applet)
+static void gsm_applet_update_signal_strength(MokoGsmdConnection* connection,
int strength, GsmApplet *applet)
{
- char path[512];
- static SignalStatus status = 0;
-
- status = moko_panel_gsm_signal_quality ();
- if (status != applet->gsm.status )
- {
- applet->gsm.status = status;
- snprintf (path, 512, "%s/%s", PKGDATADIR, gsm_q_name[applet->gsm.status]);
- if (GTK_IS_IMAGE(applet->gsm.image))
- gtk_image_set_from_file (GTK_IMAGE(applet->gsm.image), path);
- else
- g_error ("gsm image set failed");
- }
+ g_debug( "gsm_applet_update_signal_strength: signal strength = %d",
strength );
+ //TODO calibrate
+ int pixmap = 0;
+ if ( strength > 30 )
+ pixmap = 5;
+ else if ( strength > 20 )
+ pixmap = 4;
+ else if ( strength > 17 )
+ pixmap = 3;
+ else if ( strength > 13 )
+ pixmap = 2;
+ else if ( strength > 10 )
+ pixmap = 1;
- status = moko_panel_gprs_signal_quality ();
- g_debug ("status = %d", status);
- if (status == UN_CONN && GTK_WIDGET (applet->gprs.image))
- {
- gtk_widget_hide (GTK_WIDGET(applet->gprs.image));
- }
- else
- {
- applet->gprs.status = status;
- snprintf (path, 512, "%s/%s", PKGDATADIR,
gprs_q_name[applet->gprs.status]);
- if (GTK_IS_IMAGE(applet->gprs.image))
- gtk_image_set_from_file (GTK_IMAGE(applet->gprs.image), path);
- gtk_widget_show (GTK_WIDGET (applet->gprs.image));
- }
-
- /* keep going*/
- return TRUE;
+ const char* imagestring = g_strdup_printf( "%s/SignalStrength%s%02d.png",
PKGDATADIR, applet->gprs_mode ? "25g_" : "_", pixmap );
+ gtk_image_set_from_file( GTK_IMAGE(applet->image), imagestring );
}
-G_MODULE_EXPORT GtkWidget*
-mb_panel_applet_create(const char* id, GtkOrientation orientation)
+G_MODULE_EXPORT GtkWidget* mb_panel_applet_create(const char* id,
GtkOrientation orientation)
{
- MokoPanelApplet* mokoapplet = moko_panel_applet_new();
+ MokoPanelApplet* mokoapplet = MOKO_PANEL_APPLET(moko_panel_applet_new());
- GsmApplet *applet;
- applet = g_slice_new (GsmApplet);
-
- g_object_weak_ref (G_OBJECT(mokoapplet), (GWeakNotify) gsm_applet_free,
applet );
- applet->timeout_id = g_timeout_add(4000, (GSourceFunc) timeout_cb, applet);
+ GsmApplet *applet;
+ applet = g_slice_new(GsmApplet);
+ applet->image = GTK_IMAGE(gtk_image_new_from_file( PKGDATADIR
"/SignalStrength_NR.png" ) );
+ applet->gprs_mode = FALSE;
+ gtk_widget_set_name( GTK_WIDGET(applet->image), "openmoko-gsm-applet" );
+ g_object_weak_ref( G_OBJECT(applet->image), (GWeakNotify) gsm_applet_free,
applet );
+ moko_panel_applet_set_widget( mokoapplet, GTK_WIDGET(applet->image) );
+ gtk_widget_show_all( GTK_WIDGET(mokoapplet) );
- applet->gsm.image = gtk_image_new ();//make an empty GtkImage object
- applet->gsm.status = UN_INIT;
- applet->gprs.image = gtk_image_new ();//make an empty GtkImage object
- applet->gprs.status = UN_INIT;
-
- applet->hbox = gtk_hbox_new(FALSE, 0);
- gtk_widget_show (applet->hbox);
-
- gtk_box_pack_start (GTK_BOX(applet->hbox), GTK_WIDGET(applet->gprs.image),
FALSE, FALSE, 2);
- gtk_box_pack_end (GTK_BOX(applet->hbox), GTK_WIDGET(applet->gsm.image),
FALSE, FALSE, 2);
-
- moko_panel_applet_set_widget (GTK_CONTAINER(mokoapplet),
GTK_WIDGET(applet->hbox));
- gtk_widget_show_all (GTK_WIDGET(mokoapplet) );
-
- gsm_watcher_install ();
-
- return GTK_WIDGET(mokoapplet);
+ MokoGsmdConnection* gsm = moko_gsmd_connection_new();
+ g_signal_connect( G_OBJECT(gsm), "signal-strength-changed",
G_CALLBACK(gsm_applet_update_signal_strength), applet );
+ return GTK_WIDGET(mokoapplet);
};
--- End Message ---
_______________________________________________
commitlog mailing list
[EMAIL PROTECTED]
http://lists.openmoko.org/mailman/listinfo/commitlog