<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to bugs</title><link>https://sourceforge.net/p/libnodave/bugs/</link><description>Recent changes to bugs</description><atom:link href="https://sourceforge.net/p/libnodave/bugs/feed.rss" rel="self"/><language>en</language><lastBuildDate>Fri, 18 Mar 2016 12:24:37 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/libnodave/bugs/feed.rss" rel="self" type="application/rss+xml"/><item><title>Bug in libnodave-java which limits readable bytes to just 102</title><link>https://sourceforge.net/p/libnodave/bugs/21/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;There is a bug in libnodave-java, which only allows to get 102 Bytes per read.&lt;br/&gt;
In TCPConnection please change readIsoPacket() to:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;    protected int readISOPacket() {
        int res = iface.read(msgIn, 0, 4);
        if (res == 4) {
            //int len = 0x100 * msgIn[2] + msgIn[3]; --&amp;gt; wrong code
            int len = 0x100 *(msgIn[2] &amp;amp; 0xFF) + (msgIn[3] &amp;amp; 0xFF)
            res += iface.read(msgIn, 4, len);
        } else return 0;
        return res;
    }
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;In Java all Bytes are signed, but you were assuming an unsigned Byte here.&lt;br/&gt;
With this error  you will only get 127 Bytes at max - minus header of 25 Bytes, you are getting only 102 Bytes at max.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ralf Kern</dc:creator><pubDate>Fri, 18 Mar 2016 12:24:37 -0000</pubDate><guid>https://sourceforge.netd9a8061318e44573707e9aab798ec1dee0220417</guid></item><item><title>CSharp daveSwapIed_16 incorrect marshalling</title><link>https://sourceforge.net/p/libnodave/bugs/20/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;The dotnet wrapper daveSwapIed_16 seems to be incorrect and returns undefined results:&lt;br /&gt;
&lt;span&gt;[DllImport("libnodave.dll"/&lt;em&gt;, PreserveSig=false &lt;/em&gt;/ )]&lt;/span&gt;&lt;br /&gt;
    public static extern int daveSwapIed_16(int i);&lt;br /&gt;
The input and return type should be short:&lt;br /&gt;
&lt;span&gt;[DllImport("libnodave.dll"/&lt;em&gt;, PreserveSig=false &lt;/em&gt;/ )]&lt;/span&gt;&lt;br /&gt;
    public static extern short daveSwapIed_16(short i);&lt;/p&gt;
&lt;p&gt;Recompiled the wrapper and tested seems to work correctly&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nicola Dell'Amico</dc:creator><pubDate>Fri, 19 Jun 2015 16:05:52 -0000</pubDate><guid>https://sourceforge.netabaab05789f4ffd2de396055b6b68872afd6279d</guid></item><item><title>daveGetBlockInfo doesn't work for all blocks</title><link>https://sourceforge.net/p/libnodave/bugs/19/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;For some blocks  daveBuildAndSendPDU returns data with a DataLength of 96 (normaly the blocks have a DataLength of 82), and because of this check&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;                        &lt;span class="s"&gt;"p2.udlen==sizeof(daveBlockInfo)"&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;daveGetBlockInfo Returns res==0 but without any data in the blockInfo struct. I think it's better if you check like this&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;                         &lt;span class="s"&gt;"p2.udlen&amp;gt;=sizeof(daveBlockInfo)"&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;and copy then only sizeof(daveBlockInfo) to the blockinfo struct.&lt;/p&gt;
&lt;p&gt;Unfortunately, I do not know what is included in the additional Bytes. In my tests the bytes are always empty (as 0x00).&lt;/p&gt;
&lt;p&gt;Best reagds,&lt;br /&gt;
Benji&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Benjamin Prömmer</dc:creator><pubDate>Tue, 31 Mar 2015 06:18:33 -0000</pubDate><guid>https://sourceforge.net38588124037b5fb550060c844cf0a4fe4b06e5c1</guid></item><item><title>Doonread is called twice under different contexes in unit NoDaveComponent.pas for Delphi, Lazarus</title><link>https://sourceforge.net/p/libnodave/bugs/18/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;when using several connection the values were mixed. To solve this problem i found the following solution:&lt;/p&gt;
&lt;p&gt;The Funtion DoOnread is called in TNodave.Readbytes and in TNoDaveReadThread.Execute.&lt;br /&gt;
TNoDaveReadThread.Execute however calls TNodave.Readbyte too so DoOnread is called twice.&lt;br /&gt;
One call is in the cantext of the thread the other is Synchronized. &lt;br /&gt;
So the values to be worked with can come from other connections.&lt;/p&gt;
&lt;p&gt;procedure TNoDave.ReadBytes(Buffer: Pointer);&lt;br /&gt;
begin&lt;br /&gt;
  If not Assigned(Buffer) then Buffer:=FBuffer;&lt;br /&gt;
  If Active then&lt;br /&gt;
  begin&lt;br /&gt;
    DoReadBytes(FArea, FDBNumber, FBufOffs, FBufLen, Buffer);&lt;br /&gt;
    //DoOnRead; &amp;lt;- commending out solves the problem&lt;br /&gt;
  end;&lt;br /&gt;
end;    &lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;procedure TNoDaveReadThread.Execute;&lt;br /&gt;
var&lt;br /&gt;
  StartTime: Cardinal;&lt;br /&gt;
  NextTime: Cardinal;&lt;br /&gt;
begin&lt;br /&gt;
  While NoDave.Active and (NoDave.Interval &amp;gt; 0) do&lt;br /&gt;
  begin&lt;br /&gt;
    StartTime:=GetTickCount;&lt;br /&gt;
    NextTime:=StartTime + NoDave.Interval;&lt;br /&gt;
    try&lt;br /&gt;
      NoDave.ReadBytes;    // read in context of thread&lt;br /&gt;
      If NoDave.LastError = 0 &lt;br /&gt;
      then Synchronize(DoOnRead)   // read in context of main thread&lt;br /&gt;
      else&lt;br /&gt;
  ....&lt;/p&gt;
&lt;p&gt;I use Lazarus 1.0.13 with FPC 2.6.2 in Windows 7&lt;br /&gt;
and hope this helps.&lt;/p&gt;
&lt;p&gt;Christian&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Christian</dc:creator><pubDate>Tue, 06 May 2014 08:11:43 -0000</pubDate><guid>https://sourceforge.netcc8e0915f3bea858edae63daff1f0e8394e37f6d</guid></item><item><title>problem with daveReadSZL in case of timeout</title><link>https://sourceforge.net/p/libnodave/bugs/17/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;In function daveReadSZL, after the call of daveBuildAndSendPDU the returned PDU p2 is used, even if an error like a timeout occured and p2 is not initialized.&lt;/p&gt;
&lt;p&gt;Original code beginning at line 1127 in nodave.c&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;    &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="n"&gt;daveBuildAndSendPDU&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;p2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;pa&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sizeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pa&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;da&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sizeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;da&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

    &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;0&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;pa7&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="n"&gt;p2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;param&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;7&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="o"&gt;//&lt;/span&gt;    &lt;span class="n"&gt;pa6&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="n"&gt;p2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;param&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;6&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;param&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;9&lt;span class="p"&gt;]&lt;/span&gt;!&lt;span class="p"&gt;=&lt;/span&gt;0&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;....&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Better would be &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;    &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="n"&gt;daveBuildAndSendPDU&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;p2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;pa&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sizeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pa&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;da&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sizeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;da&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;!&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="n"&gt;daveResOK&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;0&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;pa7&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="n"&gt;p2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;param&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;7&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="o"&gt;//&lt;/span&gt;    &lt;span class="n"&gt;pa6&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="n"&gt;p2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;param&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;6&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;param&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;9&lt;span class="p"&gt;]&lt;/span&gt;!&lt;span class="p"&gt;=&lt;/span&gt;0&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;....&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;At least, there are some more functions which have a problem if daveBuildAndSendPDU gets an error, like daveGetBlockInfo, daveListBlocks&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Markus Strehlau</dc:creator><pubDate>Tue, 14 May 2013 09:05:55 -0000</pubDate><guid>https://sourceforge.net1cc32b2bb0b76c43be1f0a00af006be128518078</guid></item><item><title>Assigning wrong rack number on isoTCP</title><link>https://sourceforge.net/p/libnodave/bugs/16/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Hi. In source file nodave.c (version 0.8.4.6) on line 4025 is wrong assigning CPU rack number. &lt;br /&gt;
Originally was in there:&lt;/p&gt;
&lt;p&gt;dc-&amp;gt;msgOut[17]=dc-&amp;gt;rack+1;&lt;br /&gt;
dc-&amp;gt;msgOut[18]=dc-&amp;gt;slot;&lt;/p&gt;
&lt;p&gt;and it should be:&lt;/p&gt;
&lt;p&gt;dc-&amp;gt;msgOut[18]= dc-&amp;gt;slot | (dc-&amp;gt;rack &amp;lt;&amp;lt; 5);&lt;/p&gt;
&lt;p&gt;Byte with Rack/Slot definition: bit 0..4 Slot; bit 5..7 Rack&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">vita</dc:creator><pubDate>Tue, 04 Sep 2012 14:26:52 -0000</pubDate><guid>https://sourceforge.neta6d8a2348c764c4633c22ba1d37ff0eb3d94cbc0</guid></item><item><title>Memory Leak in openSocketw.c</title><link>https://sourceforge.net/p/libnodave/bugs/15/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;There is a memory leak due to not calling WSACleanup().&lt;br /&gt;
Fixed lines in openSocketw.c is supplied below:&lt;/p&gt;
&lt;p&gt;.....&lt;br /&gt;
if (connect(fd, (struct sockaddr *) &amp;amp; addr, addrlen)) {&lt;br /&gt;
if (daveDebug &amp;amp; daveDebugOpen) {&lt;br /&gt;
LOG2(ThisModule "connect Socket error: %s \n", strerror(errno));&lt;br /&gt;
}  &lt;br /&gt;
//  socketClose(fd);&lt;br /&gt;
closesocket(fd);&lt;br /&gt;
WSACleanup(); // FIXED MEMORY LEAK&lt;br /&gt;
fd = 0;&lt;br /&gt;
} else {&lt;br /&gt;
....&lt;/p&gt;
&lt;p&gt;and&lt;br /&gt;
......&lt;br /&gt;
__declspec (dllexport) int __stdcall closeSocket(SOCKET h) {&lt;br /&gt;
closesocket(h);&lt;br /&gt;
WSACleanup(); // FIXED MEMORY LEAK&lt;/p&gt;
&lt;p&gt;return 0;&lt;br /&gt;
}&lt;br /&gt;
....&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Klaus Albert</dc:creator><pubDate>Sat, 04 Dec 2010 22:54:10 -0000</pubDate><guid>https://sourceforge.net117bd0f1b80547c443ed85778268a8fecdb27671</guid></item><item><title>SetPLCTimeS has problems with the year 2010</title><link>https://sourceforge.net/p/libnodave/bugs/14/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;If you try to set the PC-systemtime with the function SetPLCTimeS, all was fine in year 2000 ... 2009. &lt;br /&gt;
But now in 2010, the date will be setted to 2000, it seems to be a problem with modulo division. &lt;/p&gt;
&lt;p&gt;If i can find a solution, than i will pos it. &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">klaly</dc:creator><pubDate>Tue, 05 Jan 2010 12:11:03 -0000</pubDate><guid>https://sourceforge.net733578cd01de40589938e43320871a7dd2590b09</guid></item><item><title>libnodave java PLCinterface swallows IOExceptions</title><link>https://sourceforge.net/p/libnodave/bugs/13/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;PLCinterface classes write- and read-methods both swallows IOExceptions. Would it be more helpfull for the application writer if libnodave library reports when the underlying connection is not valid anymore.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">polac</dc:creator><pubDate>Thu, 11 Jun 2009 10:46:42 -0000</pubDate><guid>https://sourceforge.netbc7a6a590b782c43d753df381097fb57c158211d</guid></item><item><title>function toPLCfloat</title><link>https://sourceforge.net/p/libnodave/bugs/12/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;The function toPLCfloat does no byte swapping even if DAVE_LITTLE_ENDIAN is defined.&lt;br /&gt;
This is caused by the following line in this function:&lt;br /&gt;
f.a=ff;&lt;br /&gt;
After removing this line, the function works well.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Fri, 18 Jul 2008 05:28:37 -0000</pubDate><guid>https://sourceforge.net6b682fbb1e0463070b67d460ce4af5d24175d37f</guid></item></channel></rss>