Xbee-Api Send String

Hi all, I follow the examples of the Xbee-Api and I send two byte to another Xbee.(I have two Xbee S2) Now I wanna go further, so I want send a String to another XBEE via Api-Mode, I must create more payload? There is a function for do that? The string is long about hundred character, and the receiver must know the send order of character for reconstruct the string. How can I do that? Thanks Alessandro

I must create more payload?

You must change the size of the payload array.

There is a function for do that?

No. It requires that you define the size at compile time.

The string is long about hundred character

I don’t think that the payload can be that large.

So thanks for your reply.

The string is long about hundred character

I don’t think that the payload can be that large.

If I set a payload array size of hundred character the compilation process didn’t give any error. Now I can’t try with Xbee but I will try in the next days.

For load a string in payoad’s array, I use a function, so everything in theory works, when I try I will update this post.

Thanks
Alessandro

reconstruction is not required. Just copying your string to API Data array: char arr[LEN]={0}; //your string char *ptr = arr; memcpy(API.payload.dataArray, ptr, MAX_SIZE); ptr += MAX_SIZE; ... using a while() loop Send to Dest-XBee