MQTT to IR

hello All,

I m trying to to control my TV over Wifi, i hv subscribed to the mqtt and receiving the HEX code in String now my problem id that i m not able to send the data to IR in string format i.e

irsend.sendRC6(data, 24);

gives an error saying "no matching function for call to 'IRsend::sendRC6(String&, int)"
so i tried converting string to uint16_t but that gave me the decimal number which again m not able to convert into hexadecimal.

can anyone help me in this respect , the code i m using is below:

void callback(char* topic, byte* payload, unsigned int length) {
String myString = "";
myString = String((char )payload);
Serial.println(myString);
const char
hexstring = myString.c_str();
uint16_t hex = atoi((char *)hexstring);

Serial.print("Hexa code : ");

Serial.println(hex);

irsend.sendRC6(hex, 24);
delay(2000);

}