FOSS software doesn't mean that it has to be free. We have to remember this. It's perfectly fine to ask for a payment to have the source code. Also the fact that the software is free it doesn't mean that it can't still be covered with patents, for example a lot of patented software is free software (think about video codecs, for example, there are a ton of FOSS implementation, still it's patented). Basically you patent the algorithm, not the implementation, that is anyone that uses it still has to pay you royalties, but anyone can produce it.
If you think about it, it's the same thing with drug formulas: after a period of exclusive then any company can produce it, of course paying the royalties to whoever owns the patent. It can be the same for software. Of course we have to talk about algorithms that are not trivial, as it's the case on most medical devices (most firmware just does very trivial things, that could be in principle be done by dedicated analog circuitry)
If you think about it, it's the same thing with drug formulas: after a period of exclusive then any company can produce it, of course paying the royalties to whoever owns the patent. It can be the same for software. Of course we have to talk about algorithms that are not trivial, as it's the case on most medical devices (most firmware just does very trivial things, that could be in principle be done by dedicated analog circuitry)