Move into protocol function to encode or decode protocol message. Use device cfg directly. Clean up device structure.