Commit 578c2580 authored by Michael J. Chudobiak's avatar Michael J. Chudobiak

Fixed over-active file writing in record mode, pre-rel version bump

parent 3ff62f38
Version 3.0.3
-------------
* fixed over-active file writing in record mode
Version 3.0.2
-------------
* support BSD device names
......
AC_INIT([moserial],[3.0.2],[http://bugzilla.gnome.org/enter_bug.cgi?product=moserial])
AC_INIT([moserial],[3.0.3],[http://bugzilla.gnome.org/enter_bug.cgi?product=moserial])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS(config.h)
AM_INIT_AUTOMAKE([dist-bzip2])
......
......@@ -727,11 +727,11 @@ public class moserial.MainWindow : Gtk.Window //Have to extend Gtk.Winow to get
recordTimeoutID = GLib.Timeout.add_seconds(currentPreferences.timeout, recordTimeout);
}
streamRecorder.writeIncoming(data[x]);
recordDataReceived=true;
bytecountbar.pop(bytecountbarContext);
bytecountbar.push(bytecountbarContext, sc.getBytecountbarString());
}
streamRecorder.writeIncoming(data);
}
}
......
......@@ -47,6 +47,7 @@ public class moserial.SerialConnection : GLib.Object
GLib.N_("ESC end"),
GLib.N_("No end") };
public const string[] LineEndValues = {"\r\n", "\r", "\n", "\t", "\x1b", ""};
public const int max_buf_size = 128;
uint? sourceId;
......@@ -127,8 +128,8 @@ public class moserial.SerialConnection : GLib.Object
}
private bool readBytes(GLib.IOChannel source, GLib.IOCondition condition) {
uchar[] m_buf = new uchar[128];
int bytesRead=(int)Posix.read(m_fd, m_buf, 128);
uchar[] m_buf = new uchar[max_buf_size];
int bytesRead=(int)Posix.read(m_fd, m_buf, max_buf_size);
rx += (ulong) bytesRead;
while(Gtk.events_pending() || Gdk.events_pending())
......@@ -136,9 +137,15 @@ public class moserial.SerialConnection : GLib.Object
if (bytesRead<0)
return false;
newData(m_buf, bytesRead);
uchar[] sized_buf = new uchar[bytesRead];
for (int x=0; x<bytesRead; x++) {
sized_buf[x] = m_buf[x];
}
newData(sized_buf, bytesRead);
if(localEcho)
sendBytes((char[])m_buf, bytesRead);
sendBytes((char[])sized_buf, bytesRead);
return connected;
}
......
......@@ -55,18 +55,29 @@ public class moserial.SerialStreamRecorder {
}
catch(GLib.Error e) {
stdout.printf(_("error: %s\n"), e.message);
// What should be done here?
}
}
}
private void write_array(uchar[] data) {
if(isOpen) {
try {
fos.write(data, null);
}
catch(GLib.Error e) {
stdout.printf(_("error: %s\n"), e.message);
}
}
}
public void writeOutgoing(uchar data) {
if(isOpen && (direction==Direction.OUTGOING || direction==Direction.BOTH))
write(data);
}
public void writeIncoming(uchar data) {
public void writeIncoming(uchar[] data) {
if(isOpen && (direction==Direction.INCOMING || direction==Direction.BOTH))
write(data);
write_array(data);
}
public void close (bool launch){
if(isOpen) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment