Platform: iOS with TCP/IP comms.
The following is an example of my incoming data stream.
$PLTIT,HV,0.20,M,0.00,D,-58.70,D,0.30,M*71
$PLTIT,HV,1.90,M,0.00,D,-8.30,D,1.90,M*41
A valid message frame looks like this:
$PLTIT,HV,1.90,M,0.00,D,-8.30,D,1.90,M*41
But there could be moments where I get this:
[time n+0] $PLTIT,HV,0.20,M,0.00,D,-58.70,D,0.30,M*71
[time n+1] $PLTIT,HV,1.90,M,
[time n+2] 0.00,D,-8.30,D,1.90
[time n+3] ,M*41
[time n+4] $PLTIT,HV,0.20,M,0.00,D,-58.70,D,0.30,M*71
[time n+5] $PLTIT,HV,0.20,M,
[time n+6] 0.00,D,-58.70,D,0.30,M*71
[time n+7] $PLTIT,HV,0.20,M,0.00,D,-58.70,D,0.30,M*71
[time n+8] $PLTIT,HV,0.20,M,0.00,D,-58.70,D,0.30,M*71
The result is a broken up message frame in the middle.
What objects/containers can I use under iOS to enable me to collect all the data bytes correctly for parsing and not lose any bits due to some intermittent comms or equipment?