How to control the drone orientation (yaw)

Hello everyone,
I’m trying to develop in my code a function to vary the yaw angle with the push of a button. By clicking on this button, I want it to rotate, for example, 45º counterclockwise, so in the following image I show the function created and its call. To do this, I use the message ID mavlink_msg_command_int and the parameter MAV_CMD_CONDITION_YAW.

However, the process is not working, so I start to wonder what my mistake will be. Also, when I try to change other parameters through the message “PARAM_SET” the result is the same. Am I doing something wrong in the message packing?

Please, does somebody know anything that could help me?