packet data control

Hello,

I’m using S2C Xbee (802.14.5) to send sensor data gathered by a microprocessor to my computer (as serial data). The microprocessor and Xbee are communicating thru UART at a baud rate of 115200. The base station is an xbee on a ftdi-to-serial converter in API mode. Everything is working as I hoped, but to speed up the sensors sampling rate the Xbee needs to put multiple sensor readings into one packet…

Is there a command (like .println for example) that will cut off the packet and send it? I need to control how many readings and which types sensor readings are going into a packet, so that the data can be parsed on the other side correctly.

For example:

Current packet structure:
(packet 1)
I.51,.32,.45e
S2,2,2,2e
S2,2,2,2e
S2,2
(packet 2)
,2,2e

Desired packet structure
(packet 1)
I.51,.32,.45e
(packet 2)
S2,2,2,2e
S2,2,2,2e
S2,2,2,2e

Where s & I are start bytes denoting the type of data and e is the stop byte.

Thanks in advance for your time and help!

Best,
Twain