I think I may have found a bug in the FastSerial Library...
In trying to get the CLI test to perform a XBee test, I found that no data was being written to the telemetry port, after checking my APM_Config.h settings, my XBee setup and hooking up my osciloscope up to the telemetry transmit pin, I turned to the code to start debugging...
I found that in the XBee test routine the line that should transmit the data read
and although this line was clearly directing output to serial port 3, the data was in fact coming back on serial port 1, I also found that using Serial3.printf instead worked fine.
I therefore looked in the FastSerial Library source, where these two functions are declared on the base class and found that in the printf_P function, the code was passing stdout instead of a pointer the local _fd member variable to the stdio vfprintf_P function (while in the printf routine this code was correct)
So, in the prinf_P routine, I replaced the line
i = vfprintf_P(stdout, fmt, ap);
i = vfprintf_P(&_fd, fmt, ap);
and this seemed to solve all my problems.
Since stdout seems to default to serial port 1, this would not have caused a problem when using Serial.printf_P and therefore would also only have affected the APM with it's multiple ports.
Any thoughts or collaborations on my findings, my c++ is a bit rusty so wanna be sure I am on the right track.