Problem with partial sysex packages


Hi JUCE friends

I am currently working on a cross platform application for Windows and MAC that is connected to an USB Audio/Midi device.
I have problems getting sysex data from the device to my JUCE application in the Mac version. I have JUCE v2.0.27 and OS X 10.8.2 / XCode 4.5.1

The problem is that sometimes the package from the device is split into smaller packages before they enter the JUCE application. Sometimes the first
package received in the pushMidiData method is the 3 first byte of the complete pacakage. These bytes are handed over to the processSysex method
that stores them (and calls handlePartialSysexMessage that I have not implemented). So far so good. The next package contains the next 3 bytes of the
complete package but as they do not start with 0xF0 they are expected to be a 3 byte message by the pushMidiData method. Since this is not the case it
will run into the jassert in getMessageLengthFromFirstByte method. Since I do not have any control over how the complete package enters the system I
do not see how this is supposed to work? When the complete package, which is only 13 bytes long, enters the system without being split up into smaller
packages it works fine.

Hope someone can help me with this issue

Best regards