ReceivePacket function

I wrote the function that receives packets coming in on the serial port.