Sending MAV_CMD_SET_MESSAGE_INTERVAL WITH MAVSDK C++ and Python

I’m trying to use MAVSDK to send the MAV_CMD_SET_MESSAGE_INTERVAL to adjust the streaming rates of a MAVLink message with PX4 SITL. It worked with the pymavlink example on the MAVLink site , code here.

Now with MAVSDK C++, this code works for other commands such as MAV_CMD_COMPONENT_ARM_DISARM, but not for MAV_CMD_SET_MESSAGE_INTERVAL.

As for MAVSDK-Python, I can’t seem to find the equivalent to MavlinkPassthrough, and most examples use action instead.

Ultimately in my case the ideal would be to use MAVSDK C++, but knowing the Python version would be handy too. Many thanks in advance

Update: I discovered that both pymavlink and MAVSDK versions work when they are configured as ground stations and send this command via port 14550. With pymavlink there’s no problem to this. However, with MAVSDK this can’t be achieved if you already have another ground station software such as QGC open, as it will state it is unable to bind to an already occupied port. Strangely this does not occur with pymavlink.

I’m guessing this could be because the vehicle only accepts the MAV_CMD_SET_MESSAGE_INTERVAL when it is sent by a ground station, but I have not done any deep digging into it yet. Any insight on this would be greatly appreciated. Thank you.