Custom Optical Flow Data to APM

Hi All,
I’m trying to feed data from my custom optical flow algorithm to APM so that it can use it in FlowHld mode. How do you set the EK2_FLOW_DELAY value? Also, my messages will be MavLink based so it should be a drop-in replacement for OpenMV as described here.