private static void SetAvailability() { //Get the current availability value from Lync ContactAvailability currentAvailability = 0; try { currentAvailability = (ContactAvailability)lyncClient.Self.Contact.GetContactInformation(ContactInformationType.Availability); Console.WriteLine("Availability changed: " + currentAvailability); arduinoSerial.Set(currentAvailability); } catch (LyncClientException e) { Console.WriteLine(e); } catch (SystemException systemException) { if (IsLyncException(systemException)) { // Log the exception thrown by the Lync Model API. Console.WriteLine("Error: " + systemException); } else { // Rethrow the SystemException which did not come from the Lync Model API. throw; } } }