i dont find how to convert string to hex
The concept of string to hex is what you need to explain. All data is stored internally in binary.
Where is your code? How can we help you fix code we can't see?
If you have a string that contains hex characters, like 0xFF00FF, you can convert that to a numeric value using strtoul(). The internal storage in the variable will NOT be in hex. It will be in binary, but you can print it in any base you like. The function that uses the value in the variable expects the value to be in binary.