Fmu.cpp and mixer initialisation via ioctl and pwm_ioctl

Hi together,

I’m quite new to the PX4 flight stack, at the moment I’m reading into the source. Specifically trying to understand the px4fmu and mixer architecture, which works quite well so far.
I saw that fmu initialises a local variable with an instance of MixerGroup class and loads the mixers into the group from a buffer. The initialisation of the _mixers variable only happens once in the fmu code which is inside the method pwm_ioctl(file, cmd, arg) when handed the command parameter MIXERIOCLOADBUF. I know that ioctl() is input/output controller call for device drivers in linux environments and therefore also in Nuttx.

I’m quite sure that when pwm_ioctl() is called with command parameter MIXERIOCLOADBUF, the arg parameter of that function will be the device the mixer was loaded to in the start up script by the “mixer load” or “mixer append” commands inside rc.interface…
But when I look for a caller to the PX4FMU::ioctl() method (which calls PX4FMU::pwm_ioctl() internally) I can’t find any caller.
So how is this function called i.e. who does initialise the PX4FMU instance and sets up the mixers?
I guess this would also be quite interesting since this particular caller would also decide which device (determined by the arg parameter) to load the mixer from.

Can anyone please help me out on this?

Best greets,

Patrick

Never mind. Of course the mixer command triggers initialisation of _mixers inside fmu.cpp. I guess also meaning that fmu has to be started before the “mixer” command is executed.