Need Help with Xbee XBP24-B packet transmission

I have Xbee XBP24-B module and i am using it with Arduino Uno.i want to make a packet with following configuration. it is like a structure or 2D string array. now making this kind of message is not a problem. This is a 10 field message and i think Xbee only allows uint8_t type to be sent over the air using ZBTxRequest message. So is there any API or way to send a structure of string type over the air?

Field = datatype (length)
1 = string field (2)
2 = string field (4)
3 = string field (8 )
4 = string field (8 )
5 = string field (8 )
6 = string field (8 )
7 = string field (10)
8 = string field (10)
9 = string field (10)
10 = string field (10)

much appreciated!!!

What does "string field (2)" mean? Is that a character array with 2 elements? Is one of them the NULL?

i think Xbee only allows uint8_t type to be sent over the air using ZBTxRequest message.

Have you determined the difference in size between a char and a uint8_t? Have you determined the difference in the range of values that a char and a uint8_t can hold?

The two types are the same size, and every printable character can be held in either one. So, if you have a char array holding all the characters you want to send, and the package expects a uint8_t array, simply lie to it and tell it that you have a uint8_t array, using a cast.

I think you'll run into a problem, though. 4 * 10 = 40. 4 * 8 = 32. 40 + 32 + 4 + 2 = 78. I don't think you can store that big a payload in a packet.

all of them are not same data type but i'm trying to simplify them by using strings. and i want to make only one structure of them. it's like a message where you have multiple fields like length, type, etc. Actual structure is as following:

datatype (max length)
int (2), int (4), string (8 ), string (8 ), string (8 ), string (8 ), long (10), long (10), long (10), long (10)
example:
12, 1478, q12wdf4g,8899hhdd,147ppl0u,mkliq1e4, 1472583690,1234567890,33664458792,1025478963

this how my message looks like which actually i'm trying to broadcast over the network after every 5 seconds. is it possible or any other alternative is also appreciated.

Rather than converting all the values to strings, you could just store the bytes in the packet. That's why the packet type is not char. The int (2) and int (4) should be byte and int, and will take 4 positions in the packet. The 4 strings will takes 32 bytes. The 4 longs will take 16 bytes. That still totals 51 bytes, which may still be too many.

So is there any API or way to send a structure of string type over the air?

I don't think you need worry about any of this. Just use a Serial.print() function and
send your data, no matter how it's structured. I believe the XBees have a 100-byte buffer,
so if your packet is shorter than this you'll not have to worry about overruns. Give the Xbee
a chance to clear the buffer before the next transmssion, or use the RTS/CTS signals [on
some XBee type modules these may be defined backwards to what you might expect].

Thanks everyone. i got it working.... 8)