CustomModbusServer class inherits ModbusServer class and overrides ReadRtuData and HandleRequest methods to implement user-defined function with function code 100 that receives 1 byte and responds with the same byte + data array of random byte values (the array size is determined by the received value).
CustomModbusServer is created with UART0 as a port, Modbus RTU protocol and station address 1.
UART0 is initialized.
UART0 parameters are set to 115200 bps, 8 data bits, even parity, 1 stop bit and no flow control.