Import fix in USB protocol.
When you wish ADD or SET a record in a BlackBerry database, you need to
send packet :
void Socket::Packet(Data &send, Data &receive, int timeout)
The MAX size of packet is 0x400 (seems is 0x404 on the BlackBerry Storm,
but 0x400 works also).
So if, the packet size is higher than the MAX size, you have to fragment
your packet :
if( send.GetSize() <= MAX_PACKET_SIZE )
While the last packet isn't sent, you haven't to sequence received packet.
Indeed, from the RIM's USB logs :
>>> URB [size = 0x404 ; fragmented = 0x60]
00000000: 07 00 04 04 60 03 41 57 00 00 9f ff ff ff ....
<<< URB (read SetSequencePacket(false))
00000000: 00 00 0c 00 13 07 01 00 13 00 00 00
>>> URB [size = 0x404 ; fragmented = 0x60]
00000000: 07 00 04 04 60 03 d1 6b 3c 51 73 3b 12 48 ....
<<< URB (read SetSequencePacket(false))
00000000: 00 00 0c 00 13 07 01 00 14 00 00 00
[...]
>>> URB [size = 0x2b ; not fragmented == data = 0x40]
00000000: 07 00 2b 00 40 03 00 00 00 00 00 00 00 00 00 00
<<< URB (read SetSequencePacket(true))
00000000: 00 00 0c 00 13 07 01 00 16 00 00 00
<<< URB
00000000: 07 00 07 00 41 00 00