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. r4332 - developers/tick/scripts ([EMAIL PROTECTED])
2. r4333 -
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/src
([EMAIL PROTECTED])
3. r4334 -
trunk/src/target/OM-2007.2/libraries/libmokogsmd2/libmokogsmd
([EMAIL PROTECTED])
4. r4335 -
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/src
([EMAIL PROTECTED])
--- Begin Message ---
Author: tick
Date: 2008-04-09 12:45:51 +0200 (Wed, 09 Apr 2008)
New Revision: 4332
Added:
developers/tick/scripts/inverse_color.script
Log:
add a script the inverse the color setting of edc files
Added: developers/tick/scripts/inverse_color.script
===================================================================
--- developers/tick/scripts/inverse_color.script 2008-04-09 08:16:27 UTC
(rev 4331)
+++ developers/tick/scripts/inverse_color.script 2008-04-09 10:45:51 UTC
(rev 4332)
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+echo Searching all the edc files
+FILES=`find -name '*.edc'`
+
+for ff in $FILES;do
+ echo $ff
+ # sed -n "1045 s/color: *[0-9]* [0-9]* [0-9]*/color: 1 2 3/p"
assassin.edc
+ awk "/color:/ {R=255-\$2;G=255-\$3;B=255-\$4;system(\"sed -i \'\" NR \"
s/color: *[0-9]* [0-9]* [0-9]*/color: \"R\" \"G\" \"B\"/\' \"FILENAME \" \")}"
$ff
+done
Property changes on: developers/tick/scripts/inverse_color.script
___________________________________________________________________
Name: svn:executable
+ *
--- End Message ---
--- Begin Message ---
Author: erin_yueh
Date: 2008-04-09 19:06:03 +0200 (Wed, 09 Apr 2008)
New Revision: 4333
Modified:
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
Log:
openmoko-panel-gsm: display GSM antenna power-up and power-down (Erin Yueh)
Modified:
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
===================================================================
---
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
2008-04-09 10:45:51 UTC (rev 4332)
+++
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
2008-04-09 17:06:03 UTC (rev 4333)
@@ -131,6 +131,25 @@
/* bug#1248 gsm_applet_show_status( 0, theApplet ); */
}
+static void
+gsm_applet_gsm_antenna_status(MokoGsmdConnection* self, gboolean status)
+{
+ g_debug( "gsm_applet_gsm_antenna_status: status = %s", status ? "ON" :
"OFF" );
+ if(status) {
+ theApplet->type = 6;
+ gsm_applet_update_signal_strength( self, 0, theApplet );
+ gsm_applet_show_status( 0, theApplet );
+ }
+ else {
+ /* notify user antenna is OFF */
+ theApplet->type = 7;
+ gsm_applet_update_signal_strength( self, 99, theApplet );
+ gsm_applet_show_status( 0, theApplet );
+ }
+
+
+}
+
static void gsm_applet_network_current_operator_cb(MokoGsmdConnection *self,
const gchar* name)
{
if ( strcmp( name, theApplet->operator_name ) != 0 )
@@ -202,8 +221,14 @@
summary = g_strdup_printf( "Connected to '%s'",
applet->operator_name );
details = g_strdup_printf( "Type: Roaming\nCell ID: %04x :
%04x\nSignal: %i dbM", applet->lac, applet->cell, -113 + applet->strength*2 );
break;
-
- default:
+
+ case 6: summary = g_strdup( "GSM Antenna Power-Up" );
+ break;
+
+ case 7: summary = g_strdup( "GSM Antenna Power-Down" );
+ break;
+
+ default:
summary = g_strdup( "Unknown" );
}
@@ -213,7 +238,6 @@
static void
gsm_applet_power_up_antenna(GtkWidget* menu, GsmApplet* applet)
{
- //TODO notify user
moko_gsmd_connection_set_antenna_power( applet->gsm, TRUE, NULL );
}
@@ -226,7 +250,6 @@
static void
gsm_applet_power_down_antenna(GtkWidget* menu, GsmApplet* applet)
{
- //TODO notify user
moko_gsmd_connection_set_antenna_power( applet->gsm, FALSE, NULL );
}
@@ -236,6 +259,7 @@
moko_gsmd_connection_trigger_current_operator_event( applet->gsm );
}
+
G_MODULE_EXPORT GtkWidget*
mb_panel_applet_create(const char* id, GtkOrientation orientation)
{
@@ -261,7 +285,8 @@
g_signal_connect( G_OBJECT(applet->gsm), "pin-requested",
G_CALLBACK(gsm_applet_sim_pin_requested), applet );
#endif
g_signal_connect( G_OBJECT(applet->gsm), "cipher-status-changed",
G_CALLBACK(gsm_applet_update_cipher_status), applet );
-
+ g_signal_connect( G_OBJECT(applet->gsm), "gsmd-antenna-status",
G_CALLBACK(gsm_applet_gsm_antenna_status), applet );
+
// tap-with-hold menu (NOTE: temporary: left button atm.)
GtkMenu* menu = GTK_MENU (gtk_menu_new());
@@ -291,5 +316,6 @@
#endif
gtk_widget_show_all( GTK_WIDGET(menu) );
moko_panel_applet_set_popup( mokoapplet, GTK_WIDGET (menu),
MOKO_PANEL_APPLET_CLICK_POPUP );
+
return GTK_WIDGET(mokoapplet);
}
--- End Message ---
--- Begin Message ---
Author: erin_yueh
Date: 2008-04-09 19:08:49 +0200 (Wed, 09 Apr 2008)
New Revision: 4334
Modified:
trunk/src/target/OM-2007.2/libraries/libmokogsmd2/libmokogsmd/moko-gsmd-connection.c
trunk/src/target/OM-2007.2/libraries/libmokogsmd2/libmokogsmd/moko-gsmd-connection.h
Log:
libmokogsmd: add antenna status signal and remove unused code (Erin Yueh)
Modified:
trunk/src/target/OM-2007.2/libraries/libmokogsmd2/libmokogsmd/moko-gsmd-connection.c
===================================================================
---
trunk/src/target/OM-2007.2/libraries/libmokogsmd2/libmokogsmd/moko-gsmd-connection.c
2008-04-09 17:06:03 UTC (rev 4333)
+++
trunk/src/target/OM-2007.2/libraries/libmokogsmd2/libmokogsmd/moko-gsmd-connection.c
2008-04-09 17:08:49 UTC (rev 4334)
@@ -98,7 +98,7 @@
SIGNAL_GSMD_EVT_IN_ERROR = 16, /* CME/CMS error */
SIGNAL_GSMD_NET_CURRENT_OPERATOR = 100, /* Current Operator */
-
+ SIGNAL_GSMD_ANTENNA_STATUS = 101,
SIGNAL_GSMD_CONNECTION_STATUS = 200, /* Status of connection to gsmd */
LAST_SIGNAL,
@@ -171,7 +171,18 @@
1,
G_TYPE_BOOLEAN,
NULL );
-
+ moko_gsmd_connection_signals[SIGNAL_GSMD_ANTENNA_STATUS] = g_signal_new
+ ("gsmd-antenna-status",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS,
+ G_STRUCT_OFFSET (MokoGsmdConnectionClass, gsmd_antenna_status),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__BOOLEAN,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_BOOLEAN,
+ NULL );
moko_gsmd_connection_signals[SIGNAL_GSMD_EVT_IN_CALL] = g_signal_new
("incoming-call",
G_TYPE_FROM_CLASS (klass),
@@ -640,35 +651,27 @@
g_set_error (error, MOKO_GSMD_ERROR, MOKO_GSMD_ERROR_CONNECT, "Error
connecting to gsmd");
return;
}
-
+
result = lgsm_phone_power( priv->handle, on ? 1 : 0 );
-
+
if (result == -1)
+ g_set_error (error, MOKO_GSMD_ERROR, MOKO_GSMD_ERROR_POWER, "Error
setting antenna power");
+ else
{
- g_set_error (error, MOKO_GSMD_ERROR, MOKO_GSMD_ERROR_POWER, "Error
setting antenna power");
+ if(on == 1)
+ g_signal_emit( G_OBJECT(self),
+
moko_gsmd_connection_signals[SIGNAL_GSMD_ANTENNA_STATUS],
+ 0,
+ TRUE );
+ else
+ g_signal_emit( G_OBJECT(self),
+
moko_gsmd_connection_signals[SIGNAL_GSMD_ANTENNA_STATUS],
+ 0,
+ FALSE);
}
}
void
-moko_gsmd_connection_send_pin(MokoGsmdConnection* self, const gchar* pin)
-{
- MokoGsmdConnectionPrivate* priv;
-
- g_return_if_fail ( MOKO_IS_GSMD_CONNECTION ( self ) );
- g_return_if_fail( pin );
- g_return_if_fail( strlen( pin ) >= 4 );
- priv = GSMD_CONNECTION_GET_PRIVATE( self );
-
- g_return_if_fail( priv->handle );
- /*
- * FIXME lgsm_pin_auth is not yet implemented, so we call lgsm_pin
- * directly...
- */
- /*lgsm_pin_auth( priv->handle, pin );*/
- lgsm_pin( priv->handle, 1, pin, NULL);
-}
-
-void
moko_gsmd_connection_network_register(MokoGsmdConnection* self)
{
MokoGsmdConnectionPrivate* priv;
@@ -677,7 +680,7 @@
priv = GSMD_CONNECTION_GET_PRIVATE( self );
g_return_if_fail( priv->handle );
-
+
lgsm_netreg_register( priv->handle, "" );
}
@@ -698,66 +701,6 @@
}
void
-moko_gsmd_connection_voice_accept(MokoGsmdConnection* self)
-{
- MokoGsmdConnectionPrivate* priv;
-
- g_return_if_fail ( MOKO_IS_GSMD_CONNECTION ( self ) );
- priv = GSMD_CONNECTION_GET_PRIVATE( self );
-
- g_return_if_fail( priv->handle );
-
- lgsm_voice_in_accept( priv->handle );
-}
-
-void
-moko_gsmd_connection_voice_hangup(MokoGsmdConnection* self)
-{
- MokoGsmdConnectionPrivate* priv;
-
- g_return_if_fail ( MOKO_IS_GSMD_CONNECTION ( self ) );
- priv = GSMD_CONNECTION_GET_PRIVATE( self );
-
- g_return_if_fail( priv->handle );
-
- lgsm_voice_hangup( priv->handle );
-}
-
-void
-moko_gsmd_connection_voice_dial(MokoGsmdConnection* self, const gchar* number)
-{
- MokoGsmdConnectionPrivate* priv;
- struct lgsm_addr addr;
-
- g_return_if_fail ( MOKO_IS_GSMD_CONNECTION (self) );
- g_return_if_fail( number );
- g_return_if_fail( strlen( number ) > 2 );
-
- priv = GSMD_CONNECTION_GET_PRIVATE( self );
-
- g_return_if_fail( priv->handle );
-
-
- addr.type = 129; /* ??? */
- g_stpcpy( &addr.addr[0], number );
- lgsm_voice_out_init( priv->handle, &addr );
-}
-
-void
-moko_gsmd_connection_voice_dtmf(MokoGsmdConnection* self, const gchar number)
-{
- MokoGsmdConnectionPrivate* priv;
-
- g_return_if_fail ( MOKO_IS_GSMD_CONNECTION (self) );
-
- priv = GSMD_CONNECTION_GET_PRIVATE( self );
-
- g_return_if_fail( priv->handle );
-
- lgsm_voice_dtmf( priv->handle, number );
-}
-
-void
moko_gsmd_connection_trigger_signal_strength_event(MokoGsmdConnection* self)
{
MOKO_GSMD_CHECK_CONNECTION_GET_PRIV
Modified:
trunk/src/target/OM-2007.2/libraries/libmokogsmd2/libmokogsmd/moko-gsmd-connection.h
===================================================================
---
trunk/src/target/OM-2007.2/libraries/libmokogsmd2/libmokogsmd/moko-gsmd-connection.h
2008-04-09 17:06:03 UTC (rev 4333)
+++
trunk/src/target/OM-2007.2/libraries/libmokogsmd2/libmokogsmd/moko-gsmd-connection.h
2008-04-09 17:08:49 UTC (rev 4334)
@@ -56,6 +56,7 @@
/* Misc */
void (*gsmd_connection_status) (MokoGsmdConnection* self, gboolean status);
+ void (*gsmd_antenna_status) (MokoGsmdConnection* self,gboolean status);
void (*cme_cms_error) (MokoGsmdConnection *self, int code);
/* Future padding */
@@ -106,23 +107,12 @@
/* power */
void moko_gsmd_connection_set_antenna_power (MokoGsmdConnection *self,
gboolean on, GError **error);
-/* pin */
-void moko_gsmd_connection_send_pin (MokoGsmdConnection *self, const gchar
*pin);
-
/* network */
void moko_gsmd_connection_network_register (MokoGsmdConnection *self);
int moko_gsmd_connection_get_network_status (MokoGsmdConnection *self);
void moko_gsmd_connection_trigger_current_operator_event(MokoGsmdConnection*
self);
void moko_gsmd_connection_trigger_signal_strength_event(MokoGsmdConnection*
self);
-/* TODO add type, i.e. MOKO_GSMD_CONNECTION_NETREG_AUTO */
-/* voice calls */
-void moko_gsmd_connection_voice_accept (MokoGsmdConnection *self);
-void moko_gsmd_connection_voice_hangup (MokoGsmdConnection *self);
-void moko_gsmd_connection_voice_dial (MokoGsmdConnection *self,
- const gchar *number);
-void moko_gsmd_connection_voice_dtmf (MokoGsmdConnection *self,
- const gchar number);
G_END_DECLS
#endif /* _MOKO_GSMD_CONNECTION_H_ */
--- End Message ---
--- Begin Message ---
Author: erin_yueh
Date: 2008-04-10 08:30:54 +0200 (Thu, 10 Apr 2008)
New Revision: 4335
Modified:
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
Log:
openmoko-panel-gsm: detect GSM modem power status (Erin Yueh)
Modified:
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
===================================================================
---
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
2008-04-09 17:08:49 UTC (rev 4334)
+++
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
2008-04-10 06:30:54 UTC (rev 4335)
@@ -26,6 +26,9 @@
#include <string.h>
#include <time.h>
+#define GSM_PWOERON_FILENAME
"/sys/bus/platform/devices/neo1973-pm-gsm.0/power_on"
+#define QUERY_FREQ 5
+
/* Just change this is gsmd changes */
#define _MAX_SIGNAL 30.0
@@ -40,6 +43,8 @@
char operator_name[255];
GtkMenuItem* information;
gboolean cipher;
+ guint timeout_id;
+ int state;
} GsmApplet;
static GsmApplet* theApplet = NULL;
@@ -137,7 +142,7 @@
g_debug( "gsm_applet_gsm_antenna_status: status = %s", status ? "ON" :
"OFF" );
if(status) {
theApplet->type = 6;
- gsm_applet_update_signal_strength( self, 0, theApplet );
+ gsm_applet_update_signal_strength( self, theApplet->strength,
theApplet );
gsm_applet_show_status( 0, theApplet );
}
else {
@@ -155,7 +160,7 @@
if ( strcmp( name, theApplet->operator_name ) != 0 )
{
strcpy( theApplet->operator_name, name );
- gsm_applet_update_signal_strength( self, 0, theApplet );
+ gsm_applet_update_signal_strength( self, theApplet->strength,
theApplet );
gsm_applet_show_status( 0, theApplet );
}
}
@@ -228,6 +233,12 @@
case 7: summary = g_strdup( "GSM Antenna Power-Down" );
break;
+ case 8: summary = g_strdup( "GSM Modem Power-Down" );
+ break;
+
+ case 9: summary = g_strdup( "GSM Modem Power-Up" );
+ break;
+
default:
summary = g_strdup( "Unknown" );
}
@@ -259,7 +270,52 @@
moko_gsmd_connection_trigger_current_operator_event( applet->gsm );
}
+static int
+gsm_applet_power_get()
+{
+ char buf[64];
+ FILE * f = fopen(GSM_PWOERON_FILENAME, "r");
+ int ret;
+ if (!f) {
+ printf("Open file %s failed!!\n",GSM_PWOERON_FILENAME);
+ return 0;
+ }
+ ret = fread(buf,sizeof(char),sizeof(buf)/sizeof(char),f);
+ fclose(f);
+ if (ret > 0 && buf[0]=='1') {
+ return 1;
+ }
+ return 0;
+}
+static void
+gsm_applet_update_visibility (GsmApplet *applet)
+{
+ if(applet->state == gsm_applet_power_get())
+ return;
+
+ if (!gsm_applet_power_get()) {
+ theApplet->type = 8;
+ gsm_applet_update_signal_strength( applet->gsm, 99, applet );
+ gsm_applet_show_status( 0, applet );
+ applet->state = 0;
+ } else {
+ theApplet->type = 9;
+ gsm_applet_update_signal_strength( applet->gsm, 0, applet );
+ gsm_applet_show_status( 0, applet );
+ applet->state = 1;
+ }
+}
+
+
+static gboolean
+gsm_applet_timeout_cb (gpointer data)
+{
+ gsm_applet_update_visibility ((GsmApplet *)data);
+
+ return TRUE;
+}
+
G_MODULE_EXPORT GtkWidget*
mb_panel_applet_create(const char* id, GtkOrientation orientation)
{
@@ -276,6 +332,7 @@
applet->gprs_mode = FALSE;
gtk_widget_show_all( GTK_WIDGET(mokoapplet) );
+ applet->state = 1;
applet->gsm = moko_gsmd_connection_new();
g_signal_connect( G_OBJECT(applet->gsm), "gmsd-connection-status",
G_CALLBACK(gsm_applet_gsmd_connection_status), applet );
g_signal_connect( G_OBJECT(applet->gsm), "signal-strength-changed",
G_CALLBACK(gsm_applet_update_signal_strength), applet );
@@ -317,5 +374,8 @@
gtk_widget_show_all( GTK_WIDGET(menu) );
moko_panel_applet_set_popup( mokoapplet, GTK_WIDGET (menu),
MOKO_PANEL_APPLET_CLICK_POPUP );
+ applet->timeout_id = g_timeout_add_seconds (QUERY_FREQ,
gsm_applet_timeout_cb,
+ applet);
+
return GTK_WIDGET(mokoapplet);
}
--- End Message ---
_______________________________________________
commitlog mailing list
commitlog@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/commitlog