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!