internal ParticleState GetRemoteBestState() { if (_particleClient == null) { return(new ParticleState()); } try { var s = _particleClient.GetBestState(); _particleService.UpdateBestState(s); _communicationErrorCount = 0; return(s); } catch { _communicationErrorCount++; if (CommunicationBreakdown != null && _communicationErrorCount >= _communicationErrorLimit) { CommunicationBreakdown(); Debug.WriteLine("{0} cannot connect to: {1}", Address, RemoteAddress); } return(new ParticleState()); } }
public ParticleState GetBestState() { return(_particleService.GetBestState()); }