Read and save IMEI from serial port

I can't figure out what that code should look like. Could you be so kind to help me?