Python Serial communication protocol