Try here https://www.dev-docs.org/docs/
My vague recollection is that you have to first initialize the protocol to match the device you are connecting to. They should both have the same baud rate, number of start and stop bits , error correction (xon/xoff etc) to allow a handshake.
Once that is set you open a port to the device. From there you can read and write packets of data to /from the device when ready. Once finished you close port.
There is more to it but that is simplistic view of it.
('< o o o o |''| STM,2xSTFM,2xSTE+HD,C-Lab Falcon MK2+HD,Satandisk,Ultrasatandisk,Ethernat.