Issue 171 5a

These patches do mainly two things.
(1) Add endian conversion code.
(2) Prepare for sending triggers data.