receive serial in Hex convert to integer

hello everyone right now i'm stuck with receive data from serial as hex and i want to convert it to integer value. furthermore i want to store data from serial monitor into array so please help me.

code

char cmd_inventory[] = {0xA0,0x04,0xFF,0x80,0x0A};
char cmd_read[]={0xA0,0x06,0xff,0x81,0x01,0xff,0x02};
char cmd_real_inven[]={0xa0,0x04,0xff,0x89,0xff};
int i = 0;
int check_sum =0;
int total_sum;
void setup(){
  Serial.begin(9600);
  Serial1.begin(115200);
  Serial.println("ready to communication");
  
}
void loop(){
  if(Serial.available()>0){
    char data = Serial.read();
 //================check inventory and store in buffer====   
    if(data == '1'){
        for( i = 0 ; i<=4; i++){
        Serial1.write(cmd_inventory[i]);
      check_sum = check_sum + cmd_inventory[i];
      }
      total_sum = (~check_sum) +1;
      Serial1.write(total_sum);
      check_sum=0;
    }
//================check realtime inventory and not store in buffer============
     if(data == '0'){
      for( i = 0 ; i<=4; i++){
        Serial1.write(cmd_real_inven[i]);
      check_sum = check_sum + cmd_real_inven[i];
      }
      total_sum = (~check_sum) +1;
      Serial1.write(total_sum);
      check_sum=0;
    }
//================get data from buffer=======================================    
    if(data == '2')
    {
       for( i = 0 ; i<=6; i++){
        Serial1.write(cmd_read[i]);
        check_sum = check_sum + cmd_read[i];
      }
      total_sum = (~check_sum) +1;
      Serial1.write(total_sum);
      check_sum=0;
    }
  }
  if(Serial1.available()>0){
    Serial.print(Serial1.read(),HEX);
  }
}

uhf_rfid.ino (1.42 KB)

Hex is just a representation form. Is the data ascii hex? And you want to store it as a value?

yes thank you but when i print it in hex i will receive data like that:

A0131890300AA0112233445566778899E151BA

and i want the value from "AA" to "9E" so how can i cut the number that i don't want.

Although yellow, "A0131890300AA0112233445566778899E151BA" is a perfectly fine string which could contain ascii hex... Don't see how that would just become 0xAA ....

this data i receive from UHF RFID D-100 when they scan the cart and send the data below in hex. so i just want to get only EPC of the rfid card but i don't know how to get only EPC number.