how to disable gps

If the number of GPS satellites is less than the specified number, the GPS will be disabled, and if it is more than the specified number, the GPS will be active again.
Does anyone have a parameter or code for this?