ask help with ConnectPortx4 and some Xbee module(S2B) system

Hi, anyone may help me

I have one Connectport X4 and two Xbee modules (S2B version) system to detect some environment parameters.

here I have some questions:

  1. the xbee module works only as a RF device. The SiliconLAB C8051F MCU detect the environment parameters from the 4-wire SPI interface , then MCU send these parameters to XBee module through the hardware UART on MCU,

2)the Connectport x4 communicates with these two Xbee modules, then send these paramters to PC through DB9 serial port on it.

Now I have some problems herein:

1)these two xbee modules can be seen in Device Discovery Utility program and on Idigi platform, but how to write driver with Dia provided from Digi? with which py driver file, xbee_serial_terminal?

2)with ESP, I want the parameters to send out from the DB9 serial port, how to modify the yml file or presentation layer to reliease my idea?

Thanks in advance, and I know it is not common use of CP X4 and Xbee module. this confused me for long time. I think, Digi provide high quality product to use in industry, but with bad reference and material.

Best is to look at the ‘xbee_serial’ samples drivers - such as the src/devices/xbee/xbee_serial_terminal.py.

If the src/devices/vendors/massa/massa_m300.py is included in ESP, that is another example of a serial-via-xbee driver.