Thanks for the reply. I did read the documentation but still made the mistake anyway.
I have got some code working now to convert a string to bytes, then transmit these bytes and then convert them back to a string the other side. However at the other side it just outputs the first character. Here is my code:
Transmit side:
String data = "Transmit Test String";
byte candata[90];
byte packet_number= 0;
byte length,rx_status,i;
uint32_t frame_id;
byte frame_data[8];
byte filter,ext;
data.getBytes(candata, data.length());
packet_number++;
frame_data[0] = *candata;
frame_data[1] = packet_number;
frame_id = *candata << 3;
length = data.length();
CAN.load_ff_0(length,&frame_id,frame_data,false);
Serial.print(",\n");
delay(250);
Receive side:
rx_status = CAN.readStatus();
if (CAN.buffer0DataWaiting()) {
CAN.readDATA_ff_0(&length,frame_data,&frame_id,&ext,&filter);
Serial.print("Packet Number: ");
Serial.print(frame_data[1]);
Serial.print("\n");
Serial.print("Packet Data: ");
Serial.write(frame_data[0]);
Serial.print("\n");
Just to let you know i haven't included all the code here, only what is relevant, i hope you are still able to help me though.
Thanks,
James
P.S. I just checked the value of data.length() and it has a value of 20 which is correct in this case.