Re: [maemo-developers] Re: merged some Maemo-Mapper patches

2006-10-08 Thread Koen Kooi
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

koos vriezen schreef:
> 2006/10/3, Armin M. Warda <[EMAIL PROTECTED]>:
>>   Hi Cezary,
> 
> Hi,
> 
>> I merged your 'GPS-Info patch' for Maemo-Mapper 1.1
>> http://eko.one.pl/files/n770/maemo-mapper/gpsinfo/gpsinfo-20061002.diff
>> with my set of patches.
> 
> Is the original project dead, there have been no traffic in SVN the
> last months or so. In a forom thread I also posted a patch (attached
> because link is broken) that 'fixes' my bt jam (using the method in
> one of the older versions of mapper, now when a certain time no data
> arrived). Also i noticed that 'g_io_channel_read_line' is a real power
> consumer when lines only arrive partial, it keeps generating input
> events until the eol is arrived (ironically this increases the bt jam
> occurrence).

I'm a victim of the bt jam as well, so can this patch get integrated into the 
aw builds as
well? Other than that, maemo-mapper-aw really rocks!

regards,

Koen



> One other thing I noticed that the screen blank protection didn't work
> in fullscreen mode. (I always start an extra app that does that too).
> Given that I have now used mapper over quite some distances, often
> more than four hours drive, and mapper w/o these patch is jammed
> within 10 minutes or so, I'm starting to believe that it's rather
> stable for me.
> 
> 
> 
> 
> Index: src/maemo-mapper.c
> ===
> --- src/maemo-mapper.c(revision 26)
> +++ src/maemo-mapper.c(working copy)
> @@ -505,6 +505,12 @@
>  
>  /** The file descriptor of our connection with the GPS receiver. */
>  static gint _fd = -1;
> +/** Track how often we fail to read a line as an indication of a bluetooth 
> jam*/
> +static gint _fd_read_timeout_check;
> +static gint _fd_read_failure;
> +static gint _fd_read_timeout_timer;
> +static gchar _gps_read_buf[256];
> +static gchar _gps_read_buf_pos;
>  
>  /** The GIOChannel through which communication with the GPS receiver is
>   * performed. */
> @@ -1448,6 +1454,11 @@
>  g_source_remove(_input_sid);
>  _input_sid = 0;
>  }
> +if (_fd_read_timeout_timer)
> +{
> +g_source_remove(_fd_read_timeout_timer);
> +_fd_read_timeout_timer = 0;
> +}
>  
>  /* Destroy the GIOChannel object. */
>  if(_channel)
> @@ -1468,6 +1479,7 @@
>  }
>  
>  static void rcvr_connect_later(); /* Forward declaration. */
> +static gboolean channel_cb_data_timeout(gpointer data);
>  
>  /**
>   * Connect to the receiver.
> @@ -1497,6 +1509,9 @@
>  rcvr_connect_later();
>  else
>  {
> +_gps_read_buf_pos = 0;
> +_fd_read_timeout_check = TRUE;
> +_fd_read_timeout_timer = g_timeout_add(3, 
> channel_cb_data_timeout, NULL);
>  _channel = g_io_channel_unix_new(_fd);
>  g_io_channel_set_flags(_channel, G_IO_FLAG_NONBLOCK, NULL);
>  _error_sid = g_io_add_watch_full(_channel, G_PRIORITY_HIGH_IDLE,
> @@ -5116,6 +5131,42 @@
>  }
>  
>  static gboolean
> +hci_cb_reset(gpointer data)
> +{
> +fprintf(stderr, "%s %d %d\n", __PRETTY_FUNCTION__, _fd_read_failure, 
> _fd_read_timeout_check);
> +
> +if (_fd_read_failure > 100 || _fd_read_timeout_check) /* recheck */
> +{
> +/* An bt jam - reset hci. */
> +rcvr_disconnect();
> +_fd_read_failure = 0;
> +system("/usr/bin/sudo -l | grep -q '/usr/sbin/hciconfig  *hci0  
> *reset'"
> +" && sudo /usr/sbin/hciconfig hci0 reset");
> +track_add(0, FALSE);
> +
> +if(_conn_state > RCVR_OFF)
> +{
> +set_conn_state(RCVR_DOWN);
> +rcvr_connect_now();
> +}
> +}
> +vprintf("%s(): return\n", __PRETTY_FUNCTION__);
> +return FALSE;
> +}
> +
> +static gboolean
> +channel_cb_data_timeout(gpointer data)
> +{
> +fprintf(stderr, "%s\n", __PRETTY_FUNCTION__);
> +if (_fd_read_timeout_check)
> +g_timeout_add(0, hci_cb_reset, NULL);
> +else
> +_fd_read_timeout_check = TRUE;
> +vprintf("%s(): return\n", __PRETTY_FUNCTION__);
> +return TRUE;  /* keep alive */
> +}
> +
> +static gboolean
>  channel_cb_connect(GIOChannel *src, GIOCondition condition, gpointer data)
>  {
>  int error, size = sizeof(error);
> @@ -5356,39 +5407,61 @@
>  static gboolean
>  channel_cb_input(GIOChannel *src, GIOCondition condition, gpointer data)
>  {
> -gchar *sentence;
> +gchar *sentence = _gps_read_buf;
> +gsize bytes_read;
>  vprintf("%s(%d)\n", __PRETTY_FUNCTION__, condition);
> -
> -while(G_IO_STATUS_NORMAL == g_io_channel_read_line(
> +_fd_read_failure++;
> +   
> +if (G_IO_STATUS_NORMAL == g_io_channel_read_chars (
>  _channel,
> -&sentence,
> -NULL,
> -NULL,
> -NULL) && sentence)
> +

Re: [maemo-developers] Update on command line wifi connections

2006-10-08 Thread Andrew J. Barr
On Sunday 08 October 2006 06:22, Matt Clark wrote:
> There's probably a good reason why you haven't tried it, but ISTM that
> if you have an windows PC then you can have a linux box for $0: just
> download VMWare Server (it's completely free of charge), and install
> your favourite distro on it (Can't go far wrong with Ubuntu).  For intel
> macs there's Parallels (not free but cheap).

QEMU is also free as in speech except for the virtualizer/accelerator module 
kqemu, which is free as in beer.

-- 
Andrew
___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers


Re: [maemo-developers] Update on command line wifi connections

2006-10-08 Thread Matt Clark

D. Scott Brown wrote:
I've tried four methods limited or no success (see below for source 
and results), and I'm down to one last possibility. I don't have 
access to a linux box to test the real C API in osso-ic.h, and I would 
be happy to compensate any willing developer for his time if he can 
get this to work.


There's probably a good reason why you haven't tried it, but ISTM that 
if you have an windows PC then you can have a linux box for $0: just 
download VMWare Server (it's completely free of charge), and install 
your favourite distro on it (Can't go far wrong with Ubuntu).  For intel 
macs there's Parallels (not free but cheap).


Matt
___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers