Read and save IMEI from serial port

char char_buffer;
String string_buffer = "";
int buffer_space = 1000;

int onModulePin = 9;
int8_t answer;
String IMEI;

 int i =1;
 char c;

//==============================================================================
void setup()
{


Serial.begin(9600);           
Serial2.begin(9600);           
delay(2000);

   Serial.println("Reading IMEI...");
   void modem_power_on();
   IMEI_get ();
   void modem_power_off();
   Serial.println("IMEI=" + IMEI);

}
//=========================================================================
void loop()
{
}
// SendATcommand function
byte sendATcommand(String ATcommand, String answer1, String answer2, unsigned int timeout){
   byte reply = 1;
   String content = "";
   char character;
   //Clean the modem input buffer
   while(Serial2.available()>0) Serial2.read();

   //Send the atcommand to the modem
   Serial2.println(ATcommand);
   delay(100);
   unsigned int timeprevious = millis();
   while((reply == 1) && ((millis() - timeprevious) < timeout)){
     while(Serial2.available()>0) {
       character = Serial2.read();
       content.concat(character);
       Serial.print(character);
       delay(10);
     }
     //Stop reading conditions
     if (content.indexOf(answer1) != -1){
       reply = 0;
     }else if(content.indexOf(answer2) != -1){
       reply = 2;
     }else{
       //Nothing to do...
     }
   }
   return reply;
}
// Modem ON fuction
void modem_power_on(){

    uint8_t answer=0;

    // проверяем запущен ли уже модем
    answer = sendATcommand("AT", "OK", "ERROR", 2000);
    if (answer == 1)
    {
        digitalWrite(onModulePin,HIGH);
        delay(3000);
        digitalWrite(onModulePin,LOW);

        while(answer == 1){     // Отправляем запрос каждые 2 сек и ждем ответа модема
            answer = sendATcommand("AT", "OK", "ERROR", 2000);
        }
    }
}
// Modem OFF function
void modem_power_off(){

    uint8_t answer=0;

    // проверяем запущен ли уже модем
    answer = sendATcommand("AT", "OK", "ERROR", 2000);
    if (answer == 0)
    {
        digitalWrite(onModulePin,HIGH);
        delay(3000);
        digitalWrite(onModulePin,LOW);

        while(answer == 0){     // Отправляем запрос каждые 2 сек и ждем ответа модема
            answer = sendATcommand("AT", "OK", "ERROR", 2000);
        }
    }
}
// Get IMEI function
 void IMEI_get () {
sendATcommand("AT+GSN", "OK", "ERROR", 500);
 for (i=0;i < 64;i++){
  if (Serial2.available()) {
  c = Serial2.read();
  IMEI = String(IMEI + c);
 if (IMEI.length()>=64){
 Serial.println(IMEI);
 IMEI ="";
     }
    }
   }
 }