private void EnsureConnected() { if (IsConnected) { return; } CheckConnection(); if (!IsConnected) { throw new Exception("Could not get connection to device"); } }