On Sat, Jan 31, 2009 at 02:02:53AM -0500, Josh Kropf wrote:
> To get log entries the command 7400 0200 is used.  This time there is
> no JL_ACK response, but instead, another write occurs which just has
> a 16 bit integer value which increments and starts from zero.
> Following this is the JL_ACK and the log entry data.
> 
> Now Barry seems to know when to send this 16 bit integer packet since I
> don't do any special handling for this.  However the problem is that the
> value 2 is written instead of starting from zero (might not be an
> issue) but never increments.
> 
> I use a loop to get the entries and inside the loop I have:
> 
> packet.GetEventlogEntry();
> m_socket->Packet(packet);
> m_socket->Receive(response);
> MAKE_JLPACKET(jpack, response);
> uint16_t size = be_btohs(jpack->u.logentry.size);


It's a bit hard to tell without seeing your code, but note that
the packet object can build two kinds of packets: one with just a simple
command, or a packet with command + data.  I'm assuming that GetEventlogEntry()
is creating a command + data packet.

If so, then you'll want to pass the argument to GetEventlogEntry() containing
the incrementing count.

For example, from a different function:

int JLPacket::GetSubDir(uint16_t id)
{
        SimpleCmd(SB_COMMAND_JL_GET_SUBDIR, 0, 2);
        return BigEndianData(id);
}

SimpleCmd() gives the command, and the amount of data to follow in the
next data packet (2).  The data is given as a uint16_t big endian value.
The combination of the two, creates a JLPacket object with two chunks
of data to send.

Hopefully I'm answering the right question here. :-)

- Chris


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Barry-devel mailing list
Barry-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/barry-devel

Reply via email to