Updated implementation with data from PX4 Devs and codebase, using bitwise operations.
Merge branch 'master' of https://github.com/kiorpesc/mavproxy_px4