i’m trying to write a module for IBus telemetry via telemetry uart/port 2.
First step is to see that I can read out the discovery message from the IBus device (FS-I6AB).
I started with adapting the uart example and put in the setup:
hal.uartD->begin(115200);
and in the loop function:
while (hal.uartD->available())
{
uint8_t val = hal.uartD->read();
hal.console->printf(“%X\n”,val);
}
hal.scheduler->delay(1);
This works well and I can see the correct hex discovery messages from the FS-I6AB.
I created a new module AP_IBus_Telemetry (took some example code from AP_Devo_Telem).
I added a new serial protocol and configured it.
The serial manager finds the protocol and provides me the UARTDriver uartD (I named the variable _port).
When I do the same as in the example:
if (hal.uartD == nullptr) {
// that UART doesn't exist on this platform
hal.console->println("AP_IBus_Telem: uart issue");
return;
}
if (hal.uartD->available())
{
uint8_t val = hal.uartD->read();
hal.console->printf("%X\n",val);
}
}
It only returns “FF” multiple times but not my discovery messages.