Issue 171 5a

These patches do mainly two things.
(1) Add endian conversion code.
(2) Prepare for sending triggers data.
I agree with you. I'll replace that.