private void ProcessAvailability(string[] response) { if (response != null && response.Length > 1) { adapter.mAvail.Value = "AVAILABLE"; } else { adapter.mAvail.Value = "UNAVAILABLE"; } adapter.SendChanged(); }
private void ProcessAvailability(string response) { var pattern = "^>SERIAL NUMBER, (.*)$"; var match = new Regex(pattern).Match(response); if (match.Success) { adapter.mAvail.Value = "AVAILABLE"; } else { adapter.mAvail.Value = "UNAVAILABLE"; } adapter.SendChanged(); }