How to retrieve the middle of data in uart receiver?