Make number of samples per packet configurable and add a quick compile time sanity check.
Consolidate disconnection logic into one place.
Reset buf_overflow when beginning a new log.