preparing data to be sent by Xbee S1 API mode

Hello, I am trying to send a char array (RFID tag number) from a node to the coordinator. I am having trouble converting the char array into the proper format to be sent. I think I need to convert the char array into the uint8_t array, but I am not sure how to do it. Here is what i have thus far:

#include <XBee.h>
XBee xbee = XBee();

char RFID_tag[16];
char byteRead;
uint8_t RFID_out ;

void setup() {
  xbee.begin(9600);
  // xbee intialization time
  delay(6000);
  Serial1.begin(9600);
  Serial.begin(9600);
}

void loop() {

// collected RFID tag info and store in char array
int availableBytes = Serial1.available();
for(int i=0; i<availableBytes; i++)
{
   RFID_tag[i] = Serial1.read();
}

// attempt to convert
RFID_out = (uint8_t)RFID_tag;

// send
  Tx16Request tx16 = Tx16Request(0x0100, RFID_out , sizeof(RFID_out ));
  xbee.send(tx16);
}

Thank you!

int availableBytes = Serial1.available();

In the absence of delays, that will almost always be zero. When it isn't zero, it'll be one.

XBee xbee = XBee();

Wrong.

XBee xbee;

Right.

char RFID_tag[16];
uint8_t RFID_out ;

RFID_out = (uint8_t)RFID_tag;

It is not possible to cast an array to a byte. That doesn’t make sense.

If you fix the problem that AWOL points out, and properly read the tag, there is no need to copy the data from RFID_tag (which is what you seem to be trying to do) to RFID_out. Simply use RFID_tag as the output array, casting as needed (to uint8_t *).

  Tx16Request tx16 = Tx16Request(0x0100, (uint8_t *)RFID_tag , sizeof(RFID_out ));

That works great! thank you for your help.