@bpupp This is how it is done in Arduino!
https://www.arduino.cc/reference/en/language/functions/communication/serial/read/
Not sure this is helpful, but may give you some insight to convert to ESP-IDF!