Unable to Arm Drone via mavlink

I am using the mavlink 2 C library (https://github.com/mavlink/c_library_v2) to interact with a drone simulated via ardupilot’s sim_vehicle.py. i am able to decode messages from the drone. but the arming command get refused with a result of 3 meaning unsupported or unknown.
i can arm the drone using qgroundcountrol without any issues.

the arming command is build with
mavlink_msg_command_int_pack(/*self sys_id*/0, /*self comp_id*/255, &msg, /*target sys_id*/0, /*target comp_id*/1, /*frame*/0, /*cmd_id*/400, /*current*/0, /*autocontinue*/0, /*param1*/1, /*param2*/0, ...);
the rest of the parameters are set to 0.

what am i doing wrong ?