Send commitlog mailing list submissions to
commitlog@lists.openmoko.org
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. r4344 -
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-wifi/data
([EMAIL PROTECTED])
2. r4345 - trunk/src/target/opkg/libopkg ([EMAIL PROTECTED])
3. r4346 - trunk/src/target/opkg/libopkg ([EMAIL PROTECTED])
4. r4347 - developers/werner ([EMAIL PROTECTED])
5. r4348 -
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-battery/src
([EMAIL PROTECTED])
6. r4349 - in
trunk/src/target/OM-2007.2/applications/openmoko-dialer2: .
src/phone-kit ([EMAIL PROTECTED])
--- Begin Message ---
Author: erin_yueh
Date: 2008-04-11 13:28:27 +0200 (Fri, 11 Apr 2008)
New Revision: 4344
Modified:
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-wifi/data/Wifi.png
Log:
openmoko-panel-wifi: update a new wifi icon (Erin Yueh)
Modified:
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-wifi/data/Wifi.png
===================================================================
(Binary files differ)
--- End Message ---
--- Begin Message ---
Author: thomas
Date: 2008-04-11 13:45:25 +0200 (Fri, 11 Apr 2008)
New Revision: 4345
Added:
trunk/src/target/opkg/libopkg/opkg_defines.h
trunk/src/target/opkg/libopkg/opkg_error.h
Modified:
trunk/src/target/opkg/libopkg/opkg.h
trunk/src/target/opkg/libopkg/opkg_state.h
Log:
opkg: split out opkg.h
Modified: trunk/src/target/opkg/libopkg/opkg.h
===================================================================
--- trunk/src/target/opkg/libopkg/opkg.h 2008-04-11 11:28:27 UTC (rev
4344)
+++ trunk/src/target/opkg/libopkg/opkg.h 2008-04-11 11:45:25 UTC (rev
4345)
@@ -26,39 +26,8 @@
#include "opkg_conf.h"
#include "opkg_message.h"
-#define OPKG_PKG_EXTENSION ".ipk"
-#define DPKG_PKG_EXTENSION ".deb"
+#include "opkg_error.h"
+#include "opkg_defines.h"
+#include "opkg_state.h"
-#define OPKG_LEGAL_PKG_NAME_CHARS "abcdefghijklmnopqrstuvwxyz0123456789.+-"
-#define OPKG_PKG_VERSION_SEP_CHAR '_'
-
-#define OPKG_STATE_DIR_PREFIX OPKGLIBDIR"/opkg"
-#define OPKG_LISTS_DIR_SUFFIX "lists"
-#define OPKG_INFO_DIR_SUFFIX "info"
-#define OPKG_STATUS_FILE_SUFFIX "status"
-
-#define OPKG_BACKUP_SUFFIX "-opkg.backup"
-
-#define OPKG_LIST_DESCRIPTION_LENGTH 128
-
-enum opkg_error {
- OPKG_SUCCESS = 0,
- OPKG_PKG_DEPS_UNSATISFIED,
- OPKG_PKG_IS_ESSENTIAL,
- OPKG_PKG_HAS_DEPENDENTS,
- OPKG_PKG_HAS_NO_CANDIDATE
-};
-typedef enum opkg_error opkg_error_t;
-
-extern int opkg_state_changed;
-
-
-struct errlist {
- char * errmsg;
- struct errlist * next;
-} ;
-
-struct errlist* error_list;
-
-
#endif
Added: trunk/src/target/opkg/libopkg/opkg_defines.h
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_defines.h 2008-04-11 11:28:27 UTC
(rev 4344)
+++ trunk/src/target/opkg/libopkg/opkg_defines.h 2008-04-11 11:45:25 UTC
(rev 4345)
@@ -0,0 +1,34 @@
+/* opkg_defines.h - the opkg package management system
+
+ Copyright (C) 2008 OpenMoko Inc
+
+ 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 2, 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.
+*/
+
+#ifndef OPKG_DEFINES_H
+#define OPKG_DEFINES_H
+
+#define OPKG_PKG_EXTENSION ".ipk"
+#define DPKG_PKG_EXTENSION ".deb"
+
+#define OPKG_LEGAL_PKG_NAME_CHARS "abcdefghijklmnopqrstuvwxyz0123456789.+-"
+#define OPKG_PKG_VERSION_SEP_CHAR '_'
+
+#define OPKG_STATE_DIR_PREFIX OPKGLIBDIR"/opkg"
+#define OPKG_LISTS_DIR_SUFFIX "lists"
+#define OPKG_INFO_DIR_SUFFIX "info"
+#define OPKG_STATUS_FILE_SUFFIX "status"
+
+#define OPKG_BACKUP_SUFFIX "-opkg.backup"
+
+#define OPKG_LIST_DESCRIPTION_LENGTH 128
+
+#endif /* OPKG_DEFINES_H */
Added: trunk/src/target/opkg/libopkg/opkg_error.h
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_error.h 2008-04-11 11:28:27 UTC (rev
4344)
+++ trunk/src/target/opkg/libopkg/opkg_error.h 2008-04-11 11:45:25 UTC (rev
4345)
@@ -0,0 +1,36 @@
+/* opkg_error.h - the opkg package management system
+
+ Copyright (C) 2008 OpenMoko Inc
+
+ 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 2, 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.
+*/
+
+#ifndef OPKG_ERROR_H
+#define OPKG_ERROR_H
+
+enum opkg_error {
+ OPKG_SUCCESS = 0,
+ OPKG_PKG_DEPS_UNSATISFIED,
+ OPKG_PKG_IS_ESSENTIAL,
+ OPKG_PKG_HAS_DEPENDENTS,
+ OPKG_PKG_HAS_NO_CANDIDATE
+};
+typedef enum opkg_error opkg_error_t;
+
+
+struct errlist {
+ char * errmsg;
+ struct errlist * next;
+} ;
+
+struct errlist* error_list;
+
+#endif /* OPKG_ERROR_H */
Modified: trunk/src/target/opkg/libopkg/opkg_state.h
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_state.h 2008-04-11 11:28:27 UTC (rev
4344)
+++ trunk/src/target/opkg/libopkg/opkg_state.h 2008-04-11 11:45:25 UTC (rev
4345)
@@ -20,6 +20,8 @@
#include <opkg_message.h>
+extern int opkg_state_changed;
+
typedef enum _opkg_state {
OPKG_STATE_NONE,
OPKG_STATE_DOWNLOADING_PKG,
--- End Message ---
--- Begin Message ---
Author: thomas
Date: 2008-04-11 16:35:12 +0200 (Fri, 11 Apr 2008)
New Revision: 4346
Modified:
trunk/src/target/opkg/libopkg/libopkg.c
trunk/src/target/opkg/libopkg/libopkg.h
trunk/src/target/opkg/libopkg/opkg_download.c
trunk/src/target/opkg/libopkg/opkg_download.h
trunk/src/target/opkg/libopkg/opkg_message.c
trunk/src/target/opkg/libopkg/opkg_message.h
trunk/src/target/opkg/libopkg/opkg_remove.c
trunk/src/target/opkg/libopkg/opkg_state.c
trunk/src/target/opkg/libopkg/opkg_state.h
trunk/src/target/opkg/libopkg/opkg_utils.h
trunk/src/target/opkg/libopkg/user.c
trunk/src/target/opkg/libopkg/user.h
Log:
libopkg: remove internal dependency on libopkg.h and opkg_cmd.h
Modified: trunk/src/target/opkg/libopkg/libopkg.c
===================================================================
--- trunk/src/target/opkg/libopkg/libopkg.c 2008-04-11 11:45:25 UTC (rev
4345)
+++ trunk/src/target/opkg/libopkg/libopkg.c 2008-04-11 14:35:12 UTC (rev
4346)
@@ -26,8 +26,6 @@
-opkg_message_callback opkg_cb_message = NULL;
-opkg_response_callback opkg_cb_response = NULL;
opkg_status_callback opkg_cb_status = NULL;
opkg_list_callback opkg_cb_list = NULL;
Modified: trunk/src/target/opkg/libopkg/libopkg.h
===================================================================
--- trunk/src/target/opkg/libopkg/libopkg.h 2008-04-11 11:45:25 UTC (rev
4345)
+++ trunk/src/target/opkg/libopkg/libopkg.h 2008-04-11 14:35:12 UTC (rev
4346)
@@ -24,19 +24,17 @@
#include "opkg_conf.h"
#include "opkg_message.h"
#include "opkg_state.h"
+#include "opkg_download.h"
+#include "opkg_utils.h"
#include "args.h"
#include "pkg.h"
+#include "user.h"
-typedef int (*opkg_message_callback)(opkg_conf_t *conf, message_level_t level,
- char *msg);
-typedef int (*opkg_list_callback)(char *name, char *desc, char *version,
- pkg_state_status_t status, void *userdata);
typedef int (*opkg_status_callback)(char *name, int istatus, char *desc,
void *userdata);
-typedef char* (*opkg_response_callback)(char *question);
-typedef void (*opkg_download_progress_callback)(int percent, char *url);
-typedef void (*opkg_state_changed_callback)(opkg_state_t state, const char
*data);
+typedef int (*opkg_list_callback)(char *name, char *desc, char *version,
+ pkg_state_status_t status, void *userdata);
typedef void (*opkg_progress_callback)(int complete, int total, void
*userdata);
extern int opkg_op(int argc, char *argv[]); /* opkglib.c */
@@ -76,15 +74,11 @@
extern int opkg_package_whatconflicts(args_t *args, const char *file);
extern int opkg_package_whatreplaces(args_t *args, const char *file);
-extern opkg_message_callback opkg_cb_message; /* opkglib.c */
-extern opkg_response_callback opkg_cb_response;
+extern opkg_message_callback opkg_cb_message; /* opkg_message.c */
+extern opkg_response_callback opkg_cb_response; /* user.c */
extern opkg_status_callback opkg_cb_status;
extern opkg_list_callback opkg_cb_list;
extern opkg_download_progress_callback opkg_cb_download_progress; /*
opkg_download.c */
extern opkg_state_changed_callback opkg_cb_state_changed; /* opkg_state.c */
-extern void push_error_list(struct errlist **errors,char * msg);
-extern void reverse_error_list(struct errlist **errors);
-extern void free_error_list();
-
#endif
Modified: trunk/src/target/opkg/libopkg/opkg_download.c
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_download.c 2008-04-11 11:45:25 UTC
(rev 4345)
+++ trunk/src/target/opkg/libopkg/opkg_download.c 2008-04-11 14:35:12 UTC
(rev 4346)
@@ -32,7 +32,6 @@
#include "file_util.h"
#include "str_util.h"
-#include "libopkg.h"
opkg_download_progress_callback opkg_cb_download_progress = NULL;
int
Modified: trunk/src/target/opkg/libopkg/opkg_download.h
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_download.h 2008-04-11 11:45:25 UTC
(rev 4345)
+++ trunk/src/target/opkg/libopkg/opkg_download.h 2008-04-11 14:35:12 UTC
(rev 4346)
@@ -20,6 +20,8 @@
#include "opkg_conf.h"
+typedef void (*opkg_download_progress_callback)(int percent, char *url);
+
int opkg_download(opkg_conf_t *conf, const char *src, const char
*dest_file_name);
int opkg_download_pkg(opkg_conf_t *conf, pkg_t *pkg, const char *dir);
/*
Modified: trunk/src/target/opkg/libopkg/opkg_message.c
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_message.c 2008-04-11 11:45:25 UTC
(rev 4345)
+++ trunk/src/target/opkg/libopkg/opkg_message.c 2008-04-11 14:35:12 UTC
(rev 4346)
@@ -18,10 +18,8 @@
#include "opkg_conf.h"
#include "opkg_message.h"
-#include "libopkg.h"
+opkg_message_callback opkg_cb_message = NULL;
-//#define opkg_message(conf, level, fmt, arg...) opkg_cb_message(conf, level,
fmt, ## arg)
-
void
opkg_message (opkg_conf_t * conf, message_level_t level, char *fmt, ...)
{
Modified: trunk/src/target/opkg/libopkg/opkg_message.h
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_message.h 2008-04-11 11:45:25 UTC
(rev 4345)
+++ trunk/src/target/opkg/libopkg/opkg_message.h 2008-04-11 14:35:12 UTC
(rev 4346)
@@ -27,6 +27,9 @@
OPKG_DEBUG2, /* more debug level message */
} message_level_t;
+typedef int (*opkg_message_callback)(opkg_conf_t *conf, message_level_t level,
+ char *msg);
+
extern void opkg_message(opkg_conf_t *conf, message_level_t level, char *fmt,
...);
#endif /* _OPKG_MESSAGE_H_ */
Modified: trunk/src/target/opkg/libopkg/opkg_remove.c
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_remove.c 2008-04-11 11:45:25 UTC (rev
4345)
+++ trunk/src/target/opkg/libopkg/opkg_remove.c 2008-04-11 14:35:12 UTC (rev
4346)
@@ -26,8 +26,6 @@
#include "sprintf_alloc.h"
#include "str_util.h"
-#include "opkg_cmd.h"
-
/*
* Returns number of the number of packages depending on the packages provided
by this package.
* Every package implicitly provides itself.
Modified: trunk/src/target/opkg/libopkg/opkg_state.c
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_state.c 2008-04-11 11:45:25 UTC (rev
4345)
+++ trunk/src/target/opkg/libopkg/opkg_state.c 2008-04-11 14:35:12 UTC (rev
4346)
@@ -15,7 +15,6 @@
General Public License for more details.
*/
-#include "libopkg.h"
#include "opkg_state.h"
Modified: trunk/src/target/opkg/libopkg/opkg_state.h
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_state.h 2008-04-11 11:45:25 UTC (rev
4345)
+++ trunk/src/target/opkg/libopkg/opkg_state.h 2008-04-11 14:35:12 UTC (rev
4346)
@@ -18,7 +18,7 @@
#ifndef OPKG_STATE_H
#define OPKG_STATE_H
-#include <opkg_message.h>
+#include "opkg_message.h"
extern int opkg_state_changed;
@@ -36,5 +36,8 @@
void opkg_set_current_state (opkg_conf_t *conf, opkg_state_t state, const char
*data);
+typedef void (*opkg_state_changed_callback)(opkg_state_t state, const char
*data);
+
+
#endif /* OPKG_STATE_H */
Modified: trunk/src/target/opkg/libopkg/opkg_utils.h
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_utils.h 2008-04-11 11:45:25 UTC (rev
4345)
+++ trunk/src/target/opkg/libopkg/opkg_utils.h 2008-04-11 14:35:12 UTC (rev
4346)
@@ -20,6 +20,10 @@
#include "pkg.h"
+void push_error_list(struct errlist **errors,char * msg);
+void reverse_error_list(struct errlist **errors);
+void free_error_list();
+
int get_available_blocks(char * filesystem);
char **read_raw_pkgs_from_file(const char *file_name);
char **read_raw_pkgs_from_stream(FILE *fp);
Modified: trunk/src/target/opkg/libopkg/user.c
===================================================================
--- trunk/src/target/opkg/libopkg/user.c 2008-04-11 11:45:25 UTC (rev
4345)
+++ trunk/src/target/opkg/libopkg/user.c 2008-04-11 14:35:12 UTC (rev
4346)
@@ -15,17 +15,19 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
*/
-
+#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
+#include <string.h>
#include "file_util.h"
#include "str_util.h"
-#include "libopkg.h"
+#include "user.h"
-
static char *question = NULL;
static int question_len = 255;
+opkg_response_callback opkg_cb_response = NULL;
+
char *get_user_response(const char *format, ...)
{
int len = question_len;
Modified: trunk/src/target/opkg/libopkg/user.h
===================================================================
--- trunk/src/target/opkg/libopkg/user.h 2008-04-11 11:45:25 UTC (rev
4345)
+++ trunk/src/target/opkg/libopkg/user.h 2008-04-11 14:35:12 UTC (rev
4346)
@@ -19,5 +19,6 @@
#include <stdio.h>
#include <stdarg.h>
+typedef char* (*opkg_response_callback)(char *question);
char *get_user_response(const char *format, ...);
--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-04-11 16:55:21 +0200 (Fri, 11 Apr 2008)
New Revision: 4347
Added:
developers/werner/bb_slack.pl
Log:
Quick and dirty script to calculate how many "slack" blocks we'd need per
NAND partition for a certain probability that these blocks will indeed be
sufficient to accommodate the bad blocks that may fall into this area.
Assumes that bad blocks are evenly distributed and don't come in clumps.
Added: developers/werner/bb_slack.pl
===================================================================
--- developers/werner/bb_slack.pl 2008-04-11 14:35:12 UTC (rev 4346)
+++ developers/werner/bb_slack.pl 2008-04-11 14:55:21 UTC (rev 4347)
@@ -0,0 +1,77 @@
+#!/usr/bin/perl
+
+#
+# usage: bb_slack.pl [#good_blocks [max_#slack]]
+#
+
+#
+# n = minimum number of good blocks needed
+# b = probability that block is bad
+# s = slack
+# p = probability that slack is sufficient
+#
+# s ( n+s )
+# p = sum ( ) * b^i*(1-b)^(n+s-i)
+# i = 0 ( i )
+#
+# Note: this assumes that bad blocks are evenly distributed and don't come in
+# clumps.
+#
+
+$n = 2; # u-boot partition (256kB)
+$b = 40/2048; # Samsung K5D2G13ACM-D075
+
+sub binom
+{
+ local ($n, $k) = @_;
+ local ($b, $i);
+
+ $b = 1;
+ for ($i = $n-$k+1; $i <= $n; $i++) {
+ $b *= $i;
+ }
+ for ($i = 2; $i <= $k; $i++) {
+ $b /= $i;
+ }
+ return $b;
+}
+
+
+sub exp
+{
+ local ($b, $e) = @_;
+
+ return exp(log($b)*$e);
+}
+
+
+sub p_good
+{
+ local ($s) = @_;
+ local ($p, $i);
+
+ $p = 0;
+ for ($i = 0; $i <= $s; $i++) {
+ $p += &binom($n+$s, $i)*&exp($b, $i)*&exp(1-$b, $n+$s-$i);
+ }
+ return $p;
+}
+
+$n = $ARGV[0] if @ARGV;
+$t = 20;
+$t = $ARGV[1] if defined $ARGV[1];
+
+for ($s = 0; $s <= $t; $s++) {
+ print "$n+$s: 10^", log(1-&p_good($s))/log(10), "\n";
+}
+
+# Some results:
+# <10^-6 <10^-9
+# u-boot 256kB 2 3 5
+# u-boot_env 256kB 2 3 5
+# kernel 8MB 64 10 13
+# splash 640kB 5 4 6
+# factory 256kB 2 3 5
+# rootfs ~246MB 1973 (don't care)
+#
+# total slack 23 34
Property changes on: developers/werner/bb_slack.pl
___________________________________________________________________
Name: svn:executable
+ *
--- End Message ---
--- Begin Message ---
Author: erin_yueh
Date: 2008-04-11 19:16:15 +0200 (Fri, 11 Apr 2008)
New Revision: 4348
Modified:
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-battery/src/openmoko-panel-battery.c
Log:
openmoko-panel-battery: update battery icon (Erin Yueh)
Modified:
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-battery/src/openmoko-panel-battery.c
===================================================================
---
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-battery/src/openmoko-panel-battery.c
2008-04-11 14:55:21 UTC (rev 4347)
+++
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-battery/src/openmoko-panel-battery.c
2008-04-11 17:16:15 UTC (rev 4348)
@@ -33,6 +33,7 @@
typedef struct {
MokoPanelApplet* mokoapplet;
+ const char *last_icon;
guint timeout_id;
} BatteryApplet;
@@ -110,23 +111,14 @@
{
g_debug( "battery_applet: timeout" );
char* icon;
- static int last_status = -123; /* the status last time we checked */
apm_info info;
// How about g_new0 here?
memset (&info, 0, sizeof (apm_info));
apm_read (&info);
- /* don't do any update if status is the same as the last time */
- if (last_status == info.battery_status)
- {
- return TRUE;
- }
-
//FIXME Can we actually find out, when the battery is full?
- last_status = info.battery_status;
-
if ( info.battery_status == BATTERY_STATUS_ABSENT ||
info.battery_status == BATTERY_STATUS_CHARGING )
{
@@ -148,6 +140,11 @@
icon = PKGDATADIR "/Battery_05.png";
}
+ if (icon == applet->last_icon)
+ return TRUE;
+
+ applet->last_icon = icon;
+
moko_panel_applet_set_icon( applet->mokoapplet, icon );
return TRUE;
@@ -163,6 +160,8 @@
t = time( NULL );
local_time = localtime(&t);
+ applet->last_icon = NULL;
+
timeout( applet );
battery_applet_init_dbus( applet );
applet->timeout_id = g_timeout_add_seconds( 60, (GSourceFunc) timeout,
applet);
--- End Message ---
--- Begin Message ---
Author: erin_yueh
Date: 2008-04-11 19:31:49 +0200 (Fri, 11 Apr 2008)
New Revision: 4349
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-dialer.c
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-listener.c
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-listener.h
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-network.c
Log:
openmoko-dialer2: dial *#06# to get IMEI code
Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
2008-04-11 17:16:15 UTC (rev 4348)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
2008-04-11 17:31:49 UTC (rev 4349)
@@ -1,3 +1,14 @@
+2008-04-12 Erin Yueh <[EMAIL PROTECTED]>
+
+ * src/phone-kit/moko-network.c:
+ (on_imei):
+ * src/phone-kit/moko-dialer.c:
+ (moko_dialer_dial):
+ * src/phone-kit/moko-listener.c:
+ (moko_listener_on_imei):
+ * src/phone-kit/moko-listener.h:
+ (moko_listener_on_imei),(on_imei):
+
2008-04-10 Thomas Wood <[EMAIL PROTECTED]>
* src/dialer/moko-history.c:
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-dialer.c
===================================================================
---
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-dialer.c
2008-04-11 17:16:15 UTC (rev 4348)
+++
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-dialer.c
2008-04-11 17:31:49 UTC (rev 4349)
@@ -174,6 +174,15 @@
return FALSE;
}
+
+ /* dial *#06# to get IMEI code */
+ if(g_strcasecmp(number,"*#06#") == 0) {
+ g_debug("dial *#06# !!");
+ lgsm_get_serial (handle);
+
+ return TRUE;
+ }
+
priv->status = PK_DIALER_DIALING;
/* check for network connection */
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-listener.c
===================================================================
---
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-listener.c
2008-04-11 17:16:15 UTC (rev 4348)
+++
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-listener.c
2008-04-11 17:31:49 UTC (rev 4349)
@@ -111,6 +111,16 @@
}
void
+moko_listener_on_imei (MokoListener *listener,
+ struct lgsm_handle *handle,
+ const gchar *imei)
+{
+ MokoListenerInterface *interface = MOKO_LISTENER_GET_INTERFACE (listener);
+ if (interface->on_imei)
+ interface->on_imei (listener, handle, imei);
+}
+
+void
moko_listener_on_subscriber_number (MokoListener *listener,
struct lgsm_handle *handle,
const gchar *number)
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-listener.h
===================================================================
---
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-listener.h
2008-04-11 17:16:15 UTC (rev 4348)
+++
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-listener.h
2008-04-11 17:31:49 UTC (rev 4349)
@@ -62,6 +62,9 @@
void (*on_imsi) (MokoListener *listener,
struct lgsm_handle *handle,
const gchar *imsi);
+ void (*on_imei) (MokoListener *listener,
+ struct lgsm_handle *handle,
+ const gchar *imei);
void (*on_subscriber_number) (MokoListener *listener,
struct lgsm_handle *handle,
const gchar *number);
@@ -109,6 +112,9 @@
void moko_listener_on_imsi (MokoListener *listener,
struct lgsm_handle *handle,
const gchar *imsi);
+void moko_listener_on_imei (MokoListener *listener,
+ struct lgsm_handle *handle,
+ const gchar *imei);
void moko_listener_on_subscriber_number (MokoListener *listener,
struct lgsm_handle *handle,
const gchar *number);
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-network.c
===================================================================
---
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-network.c
2008-04-11 17:16:15 UTC (rev 4348)
+++
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-network.c
2008-04-11 17:31:49 UTC (rev 4349)
@@ -65,7 +65,7 @@
gchar *network_name;
gchar *network_number;
gchar *imsi;
-
+ gchar *imei;
guint retry_register;
gint retry_register_n;
guint retry_oper;
@@ -419,6 +419,29 @@
lgsm_get_subscriber_num (handle);
}
+/* XXX we don't want GTK+ here */
+#include <gtk/gtk.h>
+static void
+on_imei (MokoListener *listener, struct lgsm_handle *handle,
+ const gchar *imei)
+{
+ MokoNetwork *network = MOKO_NETWORK (listener);
+ MokoNetworkPrivate *priv = network->priv;
+ GtkWidget *dlg;
+
+ g_free (priv->imei);
+ priv->imei = g_strdup (imei);
+
+ dlg = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_INFO, GTK_BUTTONS_OK,
+ imei);
+ gtk_window_set_title (GTK_WINDOW (dlg), "IMEI");
+ gtk_widget_show_all (dlg);
+
+ g_signal_connect (GTK_DIALOG (dlg), "response",
+ G_CALLBACK (gtk_widget_destroy), NULL);
+}
+
+
/* GObject functions */
static void
moko_network_dispose (GObject *object)
@@ -531,6 +554,7 @@
iface->on_network_name = on_network_name;
iface->on_network_number = on_network_number;
iface->on_imsi = on_imsi;
+ iface->on_imei = on_imei;
iface->on_subscriber_number = on_subscriber_number;
}
@@ -750,6 +774,11 @@
}
break;
+ case GSMD_PHONE_GET_SERIAL:
+ for (l = priv->listeners; l; l = l->next)
+ moko_listener_on_imei (MOKO_LISTENER (l->data), priv->handle,
+ (const gchar *)gmh + sizeof (*gmh));
+ break;
default :
return -EINVAL;
}
--- End Message ---
_______________________________________________
commitlog mailing list
commitlog@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/commitlog