Shop OBEX P1 Docs P2 Docs Learn Events
Need Help with Xbee XBP24-B packet transmission — Parallax Forums

Need Help with Xbee XBP24-B packet transmission

don007don007 Posts: 1
edited 2012-11-24 06:54 in Accessories
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?

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!!!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-11-24 06:54
    No. You have to send (or receive) data a byte at a time.

    One way to do this, particularly if you have a structure already, is to define a union type where one variant is your packet and the other is a single string long enough to hold the entire packet. You then set up a loop that goes through the packet-sized string and transmits one byte at a time. Another scheme is to set up a pointer to a string, initialize it to the address of the first byte of your packet, then go through a loop transmitting one byte at a time from the address in the pointer and incrementing the pointer each byte.
Sign In or Register to comment.