Data from the network (wlan) side is fully processed by the SDK code + LWIP and you will get complete packet payload through a callback function. It's all in the documentation...
Data from the UART is signalled by several interrupts that can call callback functions. The documentation about that isn't very good, for an example see my bridge: https://github.com/eriksl/esp8266-universal-io-bridge.
You cannot busy wait for characters to come. Many have stubbornly tried and many have failed