<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>Advogato blog for glenn</title>
    <link>http://www.advogato.org/person/glenn/</link>
    <description>Advogato blog for glenn</description>
    <language>en-us</language>
    <generator>mod_virgule</generator>
    <pubDate>Fri, 29 Aug 2008 08:04:10 GMT</pubDate>
    <item>
      <pubDate>Wed, 23 Aug 2000 22:26:21 GMT</pubDate>
      <title>23 Aug 2000</title>
      <link>http://www.advogato.org/person/glenn/diary.html?start=3</link>
      <guid>http://www.advogato.org/person/glenn/diary.html?start=3</guid>
      <description>&lt;p&gt;My problem with reading from a modem is still there.  I
can't figure out why it's behaving like it is. It's very
weird.
&lt;p&gt;You see, when you write ATZ to the modem, it should write
back OK, but what I'm getting is, ATZ again. 
&lt;p&gt;&lt;a href="http://advogato.org/person/Xach" &gt;Xach&lt;/a&gt; told
me that it could be something about ECHO from the modem, but
I'm reasonably sure that I turned that off (unless all the
docs I read about serial communications are wrong, or I
really messed up bad.)
&lt;p&gt; I'll post the part where I'm having the most trouble
&lt;p&gt;&lt;b&gt;&lt;i&gt;disclaimer** &lt;/i&gt;&lt;/b&gt; This part of the code is very
commented 'cause I've been trying out a million differnt
things to get it working.
&lt;pre&gt;
gchar*
read_from_modem(gint modem_fd, gint chars_to_read)
{
  gchar b_read_from_modem[255];
  gchar *p_read_from_modem;
  gint bytes_read;
  //gint chars_read = 0;
  //#define FALSE 0
  //#define TRUE 1

&lt;p&gt;   volatile int STOP=1; 

&lt;p&gt;   fcntl(modem_fd, F_SETFL, FNDELAY);
  
  p_read_from_modem = b_read_from_modem;
  /*  
  while((bytes_read = read(modem_fd,p_read_from_modem,
			   b_read_from_modem + sizeof(b_read_from_modem)
-p_read_from_modem -1 )) &amp;gt; 0)
    {
      p_read_from_modem += bytes_read;
      if(p_read_from_modem[-1] == '\n' ||
p_read_from_modem[-1] == '\r')
	break;    
    }

&lt;p&gt;   g_print("\n %c \n", p_read_from_modem);
  */
  
  while (STOP&amp;gt;=1) {       /* loop for input */
        bytes_read = read(modem_fd,b_read_from_modem,255);  
/* returns after 5 chars have been input */
        //b_read_from_modem[bytes_read]=0;               /*
so we can printf... */
        //printf(":%s:%d\n", b_read_from_modem, bytes_read);
        //if (b_read_from_modem[0]=='z') STOP=1;
	STOP = g_strncasecmp(b_read_from_modem,"ATZ",255);
	//chars_read++;
  }
  printf(":%s:%d\n", b_read_from_modem, bytes_read);
  fcntl(modem_fd, F_SETFL, 0);
  p_read_from_modem = b_read_from_modem;
  return(p_read_from_modem);
}
&lt;/pre&gt;
&lt;p&gt;oh, and I'll also add the line that tells the modem not
to echo stuff back to me.
&lt;p&gt;
 modem_options.c_lflag &amp;amp;= ~(ICANON | ECHO | ECHOE | ISIG );
&lt;p&gt; Yes, I did do a tcsetattr(); after that. 
&lt;p&gt;Thanks for reading my diary, hope you enjoy my proplems
:P</description>
    </item>
    <item>
      <pubDate>Tue, 22 Aug 2000 09:47:32 GMT</pubDate>
      <title>22 Aug 2000</title>
      <link>http://www.advogato.org/person/glenn/diary.html?start=2</link>
      <guid>http://www.advogato.org/person/glenn/diary.html?start=2</guid>
      <description>&lt;p&gt;I'm not sure that this is a good way of doing this, but I
think I need to reply to &lt;a
href="http://advogato.org/person/jdub"&gt;jdub's&lt;/a&gt; diary
entry... you know about 57 ppp thingies.
&lt;p&gt; I'm not really doing this 'cause I feel that if "It's
not invented here", I should shun it or something. I'm doing
Dull 'cause I want to learn. And to be very perfectly
honest, I find it very, very hard to read code, I find it a
lot easier to write code than to read it. So that's what I'm
doing. I'm writing.
&lt;p&gt; To make things clear, I like jdub, and I'm not offended,
I just wanted to say my bit :-)</description>
    </item>
    <item>
      <pubDate>Tue, 22 Aug 2000 07:17:24 GMT</pubDate>
      <title>22 Aug 2000</title>
      <link>http://www.advogato.org/person/glenn/diary.html?start=1</link>
      <guid>http://www.advogato.org/person/glenn/diary.html?start=1</guid>
      <description>&lt;p&gt; Hi everyone, this is my second diary entry. I have 
overcome the bug that I listed yesterday. It was just a 
matter of g_malloc() etc. Whenever something funny is going 
on, I guess you can say that it's probably a memory related 
problem. 
&lt;p&gt; Now, I don't have a new bug to post here.. I dunno if I 
should be happy or sad about that... but anyway, Dull is 
progressing nicely.. well, not as fast as I want it to go, 
but it's getting there. I can now access the modem, I 
haven't been able to read from it though... I'll work on it 
tonight.
&lt;p&gt; I'm posting this from an internet cafe across the 
street from my school. I just got out of an exam. I think 
I'm gonna fail that exam, not that I don't know the stuff 
that the teacher discussed, it's just that the type of exam 
that the teacher gave was a very weird multiple choice 
thingy, wherein two stuff are so similar that it becomes a 
matter of opinion whether or not it is the right answer :(. 
The reason why I'm in this internet cafe is because it's 
even cheaper here than getting internet access from an isp. 
It only costs about $0.5/hr here, while it costs $1 from an 
isp to your house. :( I would've gotten the cable modem 
offer if there was one, but there isn't so, I'm stuck with 
a 33.6kbps modem. 
&lt;p&gt; I'm thinking about the configuration stuff for my 
app... should I use gconf? or should I just do a plain text 
thing. A plain text thing would be easier to do, but I 
wouldn't learn much from it, while gconf may be harder, but 
it's the future... hmm... I don't know what to do. Do you 
have a suggestion? &lt;a href="mailto:glenn2@mozcom.com" &gt;e-
mail me&lt;/a&gt; 
&lt;p&gt; God, it's hard to type when you're not on your own 
keyboard, the spacebar and stuff are smaller... :(
&lt;p&gt; I'm now rambling stuff...  perhaps I should just post 
another diary entry tommorrow.. </description>
    </item>
    <item>
      <pubDate>Mon, 21 Aug 2000 01:03:24 GMT</pubDate>
      <title>21 Aug 2000</title>
      <link>http://www.advogato.org/person/glenn/diary.html?start=0</link>
      <guid>http://www.advogato.org/person/glenn/diary.html?start=0</guid>
      <description>&lt;p&gt;This is my second day on advogato. 
And I'm probably going to post every day after this.
I shall chronicle my experiences from day to day in trying
to learn gtk+ and gnome programming. 
&lt;p&gt;In order to learn, I'm going to write a simple app. It's
called Dull another ppp dialer for gnome. I don't care if
everybody thinks there are too many of those out there....
my problem is that none of them work for me. I'm currently
using kppp to connect to the net. 
&lt;p&gt;I started on Dull about 2 weeks ago. It's been slow, I
have school too, you know. In these two weeks, I have
learned/relearned a lot of things about C and gtk+ and
Gnome. As of now, Dull is nothing but a little program with
a gui, it does nothing yet. It has been fun so far. 
&lt;p&gt; The people on #gnome, #gtk+ and #gimp have been really
helpful with my stupid questions. some people have really
gone out of their way to help me. (whatever, Gs2, more that
I can't remember). I am really grateful, specially to
whatever. 
&lt;p&gt; There were times when I was somewhat flamed or rather
talked to in a harsh manner, but that's ok with me, I have
learned even from these people. 
&lt;p&gt; Right now I'm working on a bug. I hope I can fix this
tonight, after school. (I also need to review 'cause it's
exam week for me).
I'll describe the bug, for anyone who cares to help, just
mail me or something. 
&lt;pre&gt;
void
dull_create_log (void)
{
  RsModemWindow *modem_window;

&lt;p&gt;   modem_window = create_modem_window();
 
gtk_widget_set_usize(GTK_WIDGET(modem_window-&amp;gt;rs_modem_window),300,350);
 
gtk_widget_show(GTK_WIDGET(modem_window-&amp;gt;rs_modem_window));

&lt;p&gt;  
/*dull_main_connect(GTK_WIDGET(modem_window-&amp;gt;rs_txtbox));*/
  
  gtk_signal_connect_object(GTK_OBJECT
(modem_window-&amp;gt;rs_modem_window), "delete_event",
			    GTK_SIGNAL_FUNC (turn_modem_window_off), 
			    GTK_OBJECT(modem_window-&amp;gt;rs_modem_window));
 
}
&lt;/pre&gt;
&lt;p&gt;Now, you see there, the gtk_widget_show() works... but
the gtk_signal_connect_object segfaults if I uncomment it...
I don't know why, but I'll try to figure it out tonight. 
&lt;p&gt;Thanks for reading this. I know it's boring and really
worthless for some people... but it is my diary :)</description>
    </item>
  </channel>
</rss>
